Пример #1
0
        protected override void GameSetup()
        {
            base.GameSetup();

            if (AppConstants.DebugPanelEnabled)
            {
                SRDebug.Init();
            }

            // GameplayModule
            if (GetComponentInChildren <ModuleInstaller <IGameplayModule> >())
            {
                IGameplayModule moduleInstance = GetComponentInChildren <ModuleInstaller <IGameplayModule> >().InstallModule();
                Modules.GameplayModule.SetupModule(moduleInstance, moduleInstance.Settings);
            }

            gameObject.AddComponent <MiniGameAPI>();

            LogManager           = new LogManager();
            PlayerProfileManager = new PlayerProfileManager();

            gameObject.AddComponent <DebugManager>();
            gameObject.AddComponent <NavigationManager>();
            gameObject.AddComponent <KeeperManager>();

            RewardSystemManager.Init();

            InitTeacherForPlayer();
            GameSettings.HighQualityGfx = false;
        }
Пример #2
0
 //初始化DebugCanvas
 private void InitDebugCanvas()
 {
     if (GameConfig.Inst.DebugEnable)
     {
         SRDebug.Init();
     }
 }
        public override void Execute()
        {
            Retain();
            Debug.Log("/SrDebuggerFixCommand/ ---> Execute");
            //Settings.Instance.IsEnabled = false;
#if UNITY_EDITOR
            Settings.Instance.IsEnabled = false;
            if (Application.isEditor)
            {
                GameModel.IsEnableSrDebugger = true;
                SRDebug.Init();
                Release();
                return;
            }
#endif
#if UNITY_ANDROID
            //Bu alan release de kapatılacak
            GameModel.IsEnableSrDebugger = true;
            SRDebug.Init();

            Release();
            return;
#endif
            Application.RequestAdvertisingIdentifierAsync(IdfaCheck);
        }
Пример #4
0
        public void Initialize()
        {
#if DEVELOPMENT_BUILD || UNITY_EDITOR
            SRDebug.Init();
#endif
            TriggerEvent(Event.START_BOOTSTRAP);
        }
Пример #5
0
 public static void OnLoad()
 {
     if (Settings.Instance.IsEnabled && Settings.Instance.AutoLoad)
     {
         SRDebug.Init();
     }
 }
        public static void OnLoad()
        {
            if (Settings.Instance.IsEnabled && Settings.Instance.AutoLoad)
            {
#if POLYPLAY_DEBUG
                SRDebug.Init();
#endif
            }
        }
Пример #7
0
        private void Start()
        {
            Debug.Log($"~~~~~~~~~~~ GM Start is called at {Time.frameCount}");
            // Inventory.Instance.lastLoginTime.Value = TimeManager.getTimeSecondsNow;

            // Debug.unityLogger.logEnabled = false;

            SRDebug.Init();
            DOTween.Init();
        }
        protected override void Awake()
        {
            base.Awake();

            if (!Settings.Instance.IsEnabled)
            {
                return;
            }

            SRDebug.Init();
        }
Пример #9
0
        private void Awake()
        {
            InstallDIContainer();
            InitialiseGesture();
            InitializeGameSystem();

            #if ADHOC || UNITY_EDITOR
            SRDebug.Init();
            #endif

            container.Resolve <CampSystem>().LoadCamp();
        }
Пример #10
0
 void Start()
 {
     if (UnityEngine.Debug.isDebugBuild)
     {
         SRDebug.Init();
         SceneManager.sceneLoaded += SceneLoaded;
         debugDisplay.SetActive(true);
     }
     else
     {
         debugDisplay.SetActive(false);
     }
 }
Пример #11
0
 private void IdfaCheck(string advertisingId, bool trackingEnabled, string error)
 {
     Debug.Log("SrDebuggerFixCommand --> IdfaCheck --> Execute");
     foreach (DeviceVo info in Game.TestDeviceList.List)
     {
         if (info.IDFA == advertisingId)
         {
             Game.IsEnableSrDebugger = true;
             SRDebug.Init();
             break;
         }
     }
     Release();
 }
Пример #12
0
    protected IEnumerator Start()
    {
        SoundManager.Instance.SetBGMVolume(Preference.LoadPreference(Pref.BGM_V, 0.8f));
        SoundManager.Instance.SetSFXVolume(Preference.LoadPreference(Pref.SFX_V, 1f));

#if USE_SRDEBUG
        if (!Application.isEditor)
        {
            SRDebug.Init();
        }
#endif

        yield return(new WaitForSeconds(2f));

        this.readyToLogin = true;
        this.loginObj.SetActive(true);
    }
Пример #13
0
    private MainMenu InitializeCanvas()
    {
        GameObject canvas = SRResources.Menu.UI.Canvas.Instantiate();

        canvas.name = "Canvas";
        canvas.transform.SetParent(this.gameObject.transform, false);
        _menuCanvas = canvas.GetComponent <MenuCanvas>();
        GameObject eventSystem = SRResources.Menu.UI.EventSystem.Instantiate();

        eventSystem.name = "EventSystem";
        eventSystem.transform.SetParent(transform, false);
        if (Debug.isDebugBuild && SRDebug.Instance == null)
        {
            SRDebug.Init();
        }
        _menuCanvas.DisableButtons();
        return(this);
    }
Пример #14
0
    private SpaceRoaches InitializeCanvas()
    {
        GameObject canvas = SRResources.Core.UI.Canvas.Instantiate();

        canvas.name = "Canvas";
        canvas.transform.SetParent(this.gameObject.transform, false);
        _canvasObject  = canvas.GetComponent <Canvas>();
        _canvasManager = canvas.GetComponent <CanvasManager>();
        _canvasManager.Initialize(this);
        GameObject eventSystem = SRResources.Core.UI.EventSystem.Instantiate();

        eventSystem.name = "EventSystem";
        eventSystem.transform.SetParent(transform, false);
        if (Debug.isDebugBuild && SRDebug.Instance == null)
        {
            SRDebug.Init();
        }
        return(this);
    }
Пример #15
0
        public void Initialize()
        {
            if (!initialized && IsEnable())
            {
                SRDebug.Init();

                var srDebug = SRDebug.Instance;

                UnityUtility.SetActive(blockCollider, srDebug.IsDebugPanelVisible);

                VisibilityChangedDelegate onPanelVisibilityChanged = visible =>
                {
                    if (visible)
                    {
                        background.color = defaultColor;
                        currentLogType   = null;
                        lastShowLogTime  = Time.realtimeSinceStartup;
                    }

                    UnityUtility.SetActive(blockCollider, visible);
                };

                srDebug.PanelVisibilityChanged += onPanelVisibilityChanged;

                button.OnClickAsObservable()
                .Subscribe(_ => srDebug.ShowDebugPanel())
                .AddTo(this);

                ApplicationLogHandler.Instance.OnLogReceiveAsObservable()
                .Subscribe(x => OnLogReceive(x))
                .AddTo(this);

                #if ENABLE_SRDEBUGGER
                SRTrackLogService.Initialize();
                #endif

                UnityUtility.SetActive(blockCollider, false);

                background.color = defaultColor;

                initialized = true;
            }
        }
Пример #16
0
        //----- method -----

        public void Initialize()
        {
            if (!initialized && IsEnable)
            {
                SRDebug.Init();

                var srDebug               = SRDebug.Instance;
                var logTracker            = UnityLogTracker.Instance;
                var applicationLogHandler = ApplicationLogHandler.Instance;

                SetTouchBlock(touchBlock);

                VisibilityChangedDelegate onPanelVisibilityChanged = visible =>
                {
                    if (visible)
                    {
                        background.color = defaultColor;
                        currentLogType   = null;
                        lastShowLogTime  = Time.realtimeSinceStartup;
                    }

                    UnityUtility.SetActive(touchBlock, visible);
                };

                srDebug.PanelVisibilityChanged += onPanelVisibilityChanged;

                button.OnClickAsObservable()
                .Subscribe(_ => srDebug.ShowDebugPanel())
                .AddTo(this);

                applicationLogHandler.OnReceivedThreadedAllAsObservable()
                .ObserveOnMainThread()
                .Subscribe(x => OnLogReceive(x))
                .AddTo(this);

                logTracker.Initialize();

                background.color = defaultColor;

                initialized = true;
            }
        }
Пример #17
0
        public override void Start()
        {
            base.Start();

            Application.targetFrameRate = maxFps;

            SRDebug.Init();

            controls = new InputMaster();
            controls.Disable();

            Container.Register(controls);
            Container.Register(config);
            Container.Register(cameraSettings);
            Container.Register(uiController);
            Container.Register(fxData);
            Container.Register(Debug.unityLogger);
            Container.RegisterSingleton <IAssetManager, AssetsManager>();

            uiController.Init(Container);
            uiController.LoadingUI.Show();

            AppConfig.LoadByUrlAsync().ContinueWith(OnConfigLoaded);
        }
Пример #18
0
    private IEnumerator Start()
    {
        BootstrapLoadingCanvas.LoadingBarImage.fillAmount = 0f;
        bool connectionTestIsComplete = false;
        bool hasConnection            = false;

        // Setup a callback that will handle a true or false result from our internet connection test
        System.Action <bool> cbOnConnectionTestComplete = delegate(bool connectionStatus)
        {
            if (connectionStatus)
            {
                Debug.Log("Bootstrap| Connection Test Successful!");
                hasConnection = true;
            }
            else
            {
                Debug.Log("Bootstrap| ***Connection Test NOT Successful!");
                hasConnection = false;
            }

            connectionTestIsComplete = true;
        };

        Debug.Log("Bootstrap| Checking internet connection...");
        // Check for internet connectivity
        yield return(Backend.Utility.InternetConnectionTest(cbOnConnectionTestComplete));

        float timer = 0f;

        while (connectionTestIsComplete == false)
        {
            timer += Time.deltaTime;
            if (timer % 1 == 0)
            {
                Debug.Log("Bootstrap| Waiting for Dynamic Properties... " + timer);
            }
            yield return(Backend.Utility.WaitForFrame);
        }

        // If we have internet, download a set of dynamic program properties from the cloud
        if (hasConnection)
        {
            yield return(MoveStatusBar(0.25f));

            Debug.Log("Bootstrap| Checking Dynamic Properties");


            // @TODO: Get any asset bundles necessary here


            yield return(MoveStatusBar(1f));

            yield return(new WaitForSeconds(1f));

            Debug.Log("Bootstrap| Load complete");

            // Attempt to login the last user
            // Attempt to login the last user
            if (PlayerPrefs.HasKey("LastUserEmail") && PlayerPrefs.HasKey("LastUserPassword"))
            {
                string email = PlayerPrefs.GetString("LastUserEmail");
                string pwd   = PlayerPrefs.GetString("LastUserPassword");
                new GameSparks.Api.Requests.AuthenticationRequest().SetUserName(email).SetPassword(pwd).Send((response) => {
                    if (!response.HasErrors)
                    {
                        System.Action onUserInitialized = delegate
                        {
                            Nux.SceneManager.Instance.LoadScene("MainMenu");
                        };

                        Debug.Log("Bootstrap| Player Authenticated SUCCESS -- " + response.DisplayName + " -- " + email + " -- " + pwd);

                        User.ActiveUser = new User(response.DisplayName, email, pwd, onUserInitialized);

                        Backend.DynamicProgramProperties.Initialize();

                        bool shouldInitSRDebugger = false;
                        Backend.DynamicProgramProperties.TryGetValue <bool>("DebuggerEnabled", out shouldInitSRDebugger);

                        // Enable SR Debugger on development builds ALWAYS
                        if (UnityEngine.Debug.isDebugBuild)
                        {
                            SRDebug.Init();
                        }
                        else // Otherwise check our DP to see if we should enable it for release builds
                        {
                            if (shouldInitSRDebugger)
                            {
                                SRDebug.Init();
                            }
                        }
                    }
                    else
                    {
                        GenericPopup popup = Backend.Utility.MakeNewGenericPopup("Error!", "Unable to relog you in. Press Ok to continue.", false, okButtonCallback: () => { Nux.SceneManager.Instance.LoadScene("Login"); });

                        Debug.Log("Bootstrap| Error Authenticating Player...Sending to Login screen");
                    }
                });
            }
            else
            {
                Debug.Log("Bootstrap| No player info found, loading Login scene...");
                Nux.SceneManager.Instance.LoadScene("Login");
            }
        }
        // If we don't have internet, notify the user that this app requires internet etc etc.
        else
        {
            Backend.Utility.MakeNewGenericPopup("ERROR", "Unable to connect to the internet. Please enable your connection and restart the app", false);
            Debug.Log("Bootstrap| Error, no connection");
        }

        Backend.Utility.CleanMemory();
    }
Пример #19
0
 private void Start()
 {
     this.StartAsync().Coroutine();
     SRDebug.Init();
 }