Skip to content

Commit af88b1d

Browse files
committed
fist commit
1 parent 39d0037 commit af88b1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1557
-0
lines changed

Assets/DemoUI.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/DemoUI/LOGO.jpg

75.8 KB
Loading

Assets/DemoUI/LOGO.jpg.meta

Lines changed: 68 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/DemoUI/mainUI.cs

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
using UnityEngine.UI;
5+
using UnityEngine.Events;
6+
7+
public class mainUI : MonoBehaviour {
8+
9+
// Use this for initialization
10+
void Start () {
11+
12+
13+
GameObject btnObj = GameObject.Find("Canvas/initBtn");
14+
15+
Button initBtn = btnObj.GetComponent<Button>();
16+
17+
initBtn.onClick.AddListener(delegate() {
18+
OneWaySDK.init ("yd9npds4pfb0qufi", "yd9npds4pfb0qufi", false);
19+
});
20+
21+
22+
23+
GameObject btnObj2 = GameObject.Find("Canvas/showBtn");
24+
25+
Button showBtn = btnObj2.GetComponent<Button>();
26+
showBtn.enabled = false;
27+
28+
showBtn.onClick.AddListener(delegate() {
29+
OneWaySDK.showPlacementID("2");
30+
});
31+
32+
33+
34+
35+
OneWaySDK.onOneWaySDKReadyEvent += ( placement ) =>{
36+
Debug.Log ("OneWaySDK is Ready for placement: " + placement);
37+
38+
showBtn.enabled = true;
39+
40+
};
41+
42+
OneWaySDK.onOneWaySDKDidStartEvent += ( placement ) =>{
43+
Debug.Log ("OneWaySDK start to show placement: " + placement);
44+
};
45+
46+
OneWaySDK.onOneWaySDKDidFinishEvent += ( placement ,state) =>{
47+
Debug.Log ("OneWaySDK Finished placement " + placement +"finish state is :" + state);
48+
};
49+
50+
OneWaySDK.onOneWaySDKDidErrorEvent += ( err, msg) =>{
51+
Debug.Log ("OneWaySDK is err: " + err + ",message:" + msg);
52+
};
53+
54+
}
55+
56+
void Update () {
57+
58+
}
59+
60+
61+
void OnGUI() {
62+
}
63+
}

Assets/DemoUI/mainUI.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor/OneWaySDKSetting.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using UnityEngine;
2+
3+
#if UNITY_EDITOR
4+
using UnityEditor;
5+
using UnityEditor.Callbacks;
6+
using UnityEditor.iOS.Xcode;
7+
using System.Xml;
8+
#endif
9+
using System.IO;
10+
11+
12+
public static class OneWaySDKSetting
13+
{
14+
[PostProcessBuildAttribute (100)]
15+
static void OnPostprocessBuild(BuildTarget target, string pathToBuildProject){
16+
17+
if (target != BuildTarget.iOS) {
18+
Debug.LogWarning ("Target is not iPhone. XCodePostProcess will not run");
19+
return;
20+
}
21+
22+
string _projPath = PBXProject.GetPBXProjectPath (pathToBuildProject);
23+
PBXProject _pbxProj = new PBXProject ();
24+
25+
_pbxProj.ReadFromString (File.ReadAllText (_projPath));
26+
string _targetGuid = _pbxProj.TargetGuidByName ("Unity-iPhone");
27+
28+
//*******************************设置buildsetting*******************************//
29+
_pbxProj.SetBuildProperty (_targetGuid, "OTHER_LDFLAGS", "-all_load");
30+
31+
File.WriteAllText (_projPath, _pbxProj.WriteToString ());
32+
}
33+
}

Assets/Editor/OneWaySDKSetting.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Plugins.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Plugins/OneWaySDK.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)