示例#1
0
    void Awake()
    {
        DebugConsole.Instance.enabled = false;
#if UNITY_EDITOR
        if (!AutoUpdateScene.jumped)
        {
            return;
        }
#endif
        Instance = this;
        SetKey();
        ProgressBar.Show();
        //gameObject.AddComponent<Main>();
        if (User_Config.internal_sdk == 1)
        {
            SDKCallback.InitCallback();
#if UNITY_ANDROID && !UNITY_EDITOR
            AndroidJavaClass  jc = new AndroidJavaClass("com.unity3d.player.UnityActivity");
            AndroidJavaObject jo = jc.GetStatic <AndroidJavaObject>("currentActivity");
            SDKInterface.sdkInit = jo.Call <bool>("isFDSDKinitOk");
#else
            SDKInterface.sdkInit = true;
#endif
            SDKInterface.Instance.Init();
            StartCoroutine(WaitForSDKInit());
        }
        else
        {
            StartUp();
        }
    }
        public void ScanStartUpPluginsTest()
        {
            int StartUpCount = 0;

            foreach (StartUpTemplateClass Instance in StartUpController.ScanStartUpPlugins(@"..\..\..\Debug\StartUps\"))
            {
                StartUpCount++;
            }
            if (StartUpCount == 0)
            {
                Assert.Fail();
            }
        }
        public void GetStartUpPluginTest()
        {
            StartUpTemplateClass TestClass = null;

            TestClass = StartUpController.GetStartUpPlugin(@"..\..\..\Debug\StartUps\ScientistStartUp.dll", "ScientistStartUpClass");
            if (TestClass == null)
            {
                Assert.Fail();
            }
            if (TestClass.FileName != @"ScientistStartUp.dll")
            {
                Assert.Fail();
            }

            TestClass = StartUpController.GetStartUpPlugin(@"..\..\..\Debug\StartUps\DefaultStartUp.dll", "DefaultStartUpClass");
            if (TestClass == null)
            {
                Assert.Fail();
            }
            if (TestClass.FileName != @"DefaultStartUp.dll")
            {
                Assert.Fail();
            }

            TestClass = StartUpController.GetStartUpPlugin(@"..\..\..\Debug\StartUps\FileNotExists.dll", "ClassNotFound");
            if (TestClass != null)
            {
                Assert.Fail();
            }

            TestClass = StartUpController.GetStartUpPlugin(@"C:\Windows\System32\user32.dll", "llalalalla");
            if (TestClass != null)
            {
                Assert.Fail();
            }
        }
示例#4
0
 // Use this for initialization
 void Start()
 {
     controller = this.gameObject.AddComponent <StartUpController>();
     controller.startUpEvent = OnStartUp;
 }
示例#5
0
 void OnDestroy()
 {
     Instance = null;
 }