コード例 #1
0
ファイル: TricksController.cs プロジェクト: limonlimonn/Race
        // Use this for initialization
        void Start()
        {
            _playerManager   = Core.Instance.GetService <PlayerManager>();
            _safePlayerPrefs = Core.Instance.GetService <SafePlayerPrefs>();

            increaseParent = GameObject.Find("Increase_parent").transform;
            trickRoot      = increaseParent.Find("TrickRoot").transform;
            trickScript    = trickRoot.GetComponent <TrickRoot>();

            Transform tempWcs = transform.Find("WheelColliders");

            vehicleCtrl = GetComponent <VehicleController>() as VehicleController;
            wc_FL       = vehicleCtrl.wheels[0].wheelCollider;
            wc_FR       = vehicleCtrl.wheels[1].wheelCollider;
            wc_RL       = vehicleCtrl.wheels[2].wheelCollider;
            wc_RR       = vehicleCtrl.wheels[3].wheelCollider;

            nitroCtrl = GetComponent <NewNitroController>() as NewNitroController;
            nitroPlus = GameObject.Find("NitroPlus").GetComponent <Text>();

            balanceNitro = nitroCtrl.maxNitro * balanceNitroPercent;
            airNitro     = nitroCtrl.maxNitro * airNitroPercent;
            flipNitro    = nitroCtrl.maxNitro * flipNitroPercent;
            candleNitro  = nitroCtrl.maxNitro * candleNitroPercent;

            chas = GameObject.Find("chas");
            chas.transform.parent = null;
            strelka = GameObject.Find("strelka");
            //Debug.LogError(nitroCtrl.maxNitro);
        }
コード例 #2
0
        // UNITY

        private void Start()
        {
            AssertSerialiedFields();

            //
            _gameManager = Core.Instance.GetService <GameManager>();
            Assert.AreNotEqual(null, _gameManager);

            _safePlayerPrefs = Core.Instance.GetService <SafePlayerPrefs>();
            Assert.AreNotEqual(null, _safePlayerPrefs);

            _enternetWindow = Core.Instance.GetService <UIManager>().GetWindow(UIWindowEnum.IS_ENTERNET) as EnternetWindow;
        }
コード例 #3
0
        // METHODS

        private void InitVariables()
        {
            _safePlayerPrefs = Core.Instance.GetService <SafePlayerPrefs>();
            Assert.AreNotEqual(null, _safePlayerPrefs);

            _gameManager = Core.Instance.GetService <GameManager>();
            Assert.AreNotEqual(null, _gameManager);

            _uiManager = Core.Instance.GetService <UIManager>();
            Assert.AreNotEqual(null, _uiManager);

            _audioService = Core.Instance.GetService <AudioService>();

            //
            var gameWindowHandler = new GameWindowResolver();

            _gameWindow = gameWindowHandler.GetGameWindow();
        }
コード例 #4
0
        public void Enable()
        {
            Debug.Log("MAIN_MULTIPLAYER_WINDOW  Enable");
            _audioService = Core.Instance.GetService <AudioService>();

            _uiManager = Core.Instance.GetService <UIManager>();
            _header    = _uiManager.GetWindow(UIWindowEnum.HEADER) as Header;
            _header.Show();
            _sPlayerP = Core.Instance.GetService <SafePlayerPrefs>();

            _mainScreenStateManager = _uiManager.Get_MainScreenStateManager();

            _eventSecvice = Core.Instance.GetService <EventService>();

            _notificationWindow = _uiManager.NotificationWindow;

            _enternetWindow = _uiManager.GetWindow(UIWindowEnum.IS_ENTERNET) as EnternetWindow;

            if (_core == null)
            {
                _core = Core.Instance;
            }
            _audioService.StartMenuMusic();

            _gameManager   = _core.GetService <GameManager>();
            _playerManager = _core.GetService <PlayerManager>();

            _multiplayerWindow = (MultiplayerWindow)_uiManager.GetWindow(UIWindowEnum.MAIN_MULTIPLAYER);
            //chooseCarWindow = (ChooseCarWindow)_uim.GetWindow(UIWindowEnum.CHOOSECAR);

            _multiplayerWindow.OnPlay       += OnPlayGame;
            _multiplayerWindow.OnRandomGame += OnRandomGame;

            //
            _gameManager.OnGamesUpdated  += OnUpdateGamesList;
            _gameManager.OnFriendsUpdate += OnUpdateFriendList;


            if (_eventSecvice.IsEventComplete())
            {
                Debug.Log("IsEventComplete");
                _uiManager.ShowWindow(UIWindowEnum.SPLASH, true);
                _eventSecvice.ShowCompleteAnim(() => {
                    if (_playerManager.IsDone != -1)
                    {
                        _gameManager.LoadGames(() => { _notificationWindow.ShowYouOpenTrack(_playerManager.IsDone); _playerManager.IsDone = -1; });
                    }
                    else
                    {
                        _gameManager.LoadGames();
                    }
                });
            }
            else
            {
                if (_playerManager.IsDone != -1)
                {
                    _gameManager.LoadGames(() => { _notificationWindow.ShowYouOpenTrack(_playerManager.IsDone); _playerManager.IsDone = -1; });
                }
                else
                {
                    _gameManager.LoadGames();
                }
            }
        }
コード例 #5
0
        // I_SERVICE

        public void Init()
        {
            Games = new List <GameData>();

            //
            _networkManager = Core.Instance.GetService <NetworkManager>();
            Assert.AreNotEqual(null, _networkManager);

            _playerManager = Core.Instance.GetService <PlayerManager>();
            Assert.AreNotEqual(null, _playerManager);

            _statesManager = Core.Instance.GetService <StatesManager>();
            Assert.AreNotEqual(null, _statesManager);

            //
            _uiManager = Core.Instance.GetService <UIManager>();
            Assert.AreNotEqual(null, _uiManager);

            _chooseTrackWindow = _uiManager.GetWindow(UIWindowEnum.CHOOSE_TRACK) as ChooseTrackWindow;
            Assert.AreNotEqual(null, _chooseTrackWindow);

            _mainScreenStateManager = _uiManager.Get_MainScreenStateManager();
            Assert.AreNotEqual(null, _mainScreenStateManager);

            _splashScreen = _uiManager.GetWindow(UIWindowEnum.SPLASH) as SplashScreen;
            Assert.AreNotEqual(null, _splashScreen);

            _multiplayerWindow = _uiManager.GetWindow(UIWindowEnum.MAIN_MULTIPLAYER) as MultiplayerWindow;
            Assert.AreNotEqual(null, _multiplayerWindow);



            _safePlayerPrefs = Core.Instance.GetService <SafePlayerPrefs>();
            Assert.AreNotEqual(null, _safePlayerPrefs);

            _header = _uiManager.GetWindow(UIWindowEnum.HEADER) as Header;
            Assert.AreNotEqual(null, _header);

            _enternetWindow = _uiManager.GetWindow(UIWindowEnum.IS_ENTERNET) as EnternetWindow;
            Assert.AreNotEqual(null, _enternetWindow);

            _carParent = GameObject.Find("CarParent").transform;
            _podiumNew = _carParent.Find("PodiumNew").gameObject;



            // =======================================================
            //

            /*
             * TrackNamesById = new Dictionary<int, string>()
             * {
             *  {0,     ""    },
             *  {1,     ""     },
             *  {2,     ""    },
             *  {3,     ""      },
             *  {4,     ""    },
             *  {5,     "West_Indian_1"     },
             *  {6,     ""     },
             *  {7,     ""      },
             *  {8,     "West _Town_2"      },
             *  {9,     ""     },
             *  {10,    "West_Shahta_1"     },
             *  {11,    "West _Canyon_1"    },
             *  {12,    "West_Tornado"      },
             *  {13,    "Island"            },
             *  {14,    "West_Tunnel_3"     },
             *  {15,    "West_Mountains_2"   },
             *  {16,    "West _Koleso_2"   },
             *  {17,    "West _Canyon_2"   },
             *
             *
             *  {99,    "Tutorial1"   },
             *  {100,    "Tutorial2"   },
             * };
             */



            //

            /*
             * TrackTimeById = new Dictionary<int, TrackTimePrice>()
             * {
             *  {0,    new TrackTimePrice{Time = 120 , Price= 20  } },
             *  {1,    new TrackTimePrice{Time = 120 , Price = 21  } },
             *  {2,    new TrackTimePrice{Time = 120 , Price = 22  } },
             *  {3,    new TrackTimePrice{Time = 120 , Price = 23  } },
             *  {4,    new TrackTimePrice{Time = 120 , Price = 24  } },
             *  {5,    new TrackTimePrice{Time = 120 , Price = 25  } },
             *  {6,    new TrackTimePrice{Time = 120 , Price = 26  } },
             *  {7,    new TrackTimePrice{Time = 120 , Price= 27  } },
             *  {8,    new TrackTimePrice{Time = 120 , Price = 28  } },
             *  {9,    new TrackTimePrice{Time = 120 , Price= 29  } },
             *  {10,   new TrackTimePrice{Time = 120 , Price = 30  } },
             *  {11,   new TrackTimePrice{Time = 100 , Price = 31  } },
             *  {12,   new TrackTimePrice{Time = 72 , Price = 32  } },
             *  {13,   new TrackTimePrice{Time = 93 , Price = 33  } },
             *  {14,   new TrackTimePrice{Time = 74 , Price = 34  } },
             *  {15,   new TrackTimePrice{Time = 95 , Price = 35  } },
             *  {16,   new TrackTimePrice{Time = 76 , Price = 36  } },
             *  {17,   new TrackTimePrice{Time = 87 , Price = 37  } },
             *
             * };
             */
            // =======================================================

            _multiplayerWindow.OnSingleNew    += CreateNewSingleplayerGame;
            _multiplayerWindow.OnNewGame      += CreateNewGame;
            _multiplayerWindow.OnNewGameForFB += CreateNewGameForFB;
            IsEntryPointLoad = true;
        }