Exemplo n.º 1
0
 private static void SkipInit(PlatformInitCallback callback = null)
 {
     UnityEngine.Debug.Log("Platform already Initialized");
     if (callback != null)
     {
         callback(null);
     }
 }
Exemplo n.º 2
0
        private static void LoadComplete(object sender, LoadCompleteArgs args)
        {
            initState = NPNFPlatformInitState.HasInitialized;

            if (InitCallback != null)
            {
                InitCallback(args.error);
                InitCallback = null;
            }

            foreach (PlatformInitCallback callback in CallbackQueue)
            {
                callback(args.error);
            }
            CallbackQueue.Clear();
        }
Exemplo n.º 3
0
        /**
         * Call this method to initialize the NPNF platform
         **/
        public static void Init(PlatformInitCallback callback = null)
        {
            switch (initState)
            {
            case NPNFPlatformInitState.NotInitialize:
                ProcessInit(callback);
                break;

            case NPNFPlatformInitState.Initializing:
                QueueInit(callback);
                break;

            case NPNFPlatformInitState.HasInitialized:
                SkipInit(callback);
                break;
            }
        }
Exemplo n.º 4
0
        private static void ProcessInit(PlatformInitCallback callback = null)
        {
            initState = NPNFPlatformInitState.Initializing;

            InitCallback = callback;
            UnityEngine.Debug.Log("NPNF Platform Init");
            Settings          = NPNFSettings.Instance;
            NPNFMain.Settings = Settings;
            if (NPNFMain.Settings != null)
            {
                NPNFMain.OnInitProfile  += InitProfile;
                NPNFMain.OnLoadComplete += LoadComplete;
            }
            CustomFeaturesInitialization();

            NPNFMain.Init();
            #if !UNITY_WEBPLAYER
            Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "yes");
            #endif
        }
Exemplo n.º 5
0
 private static void QueueInit(PlatformInitCallback callback = null)
 {
     CallbackQueue.Enqueue((callback != null)? callback : InternalInitCallback);
 }