コード例 #1
0
        IEnumerator WaitForOnlineServiceInit()
        {
            // wait for authenticating,
            // always wait 1 frame
            do
            {
                yield return(null);
            } while (!OnlineService.IsAuthenicated);

            OnSignIn?.Invoke(OnlineService);

            // authenticated, now load inventory
            OnlineService.Load();

            // wait for load
            do
            {
                yield return(null);
            } while (!OnlineService.IsLoaded);

            // load data to inventory
            DataSystem.LoadInventory(CurrentPlayer.Inventory, OnlineService.LoadedData, out lastLoadedInventoryData);

            OnGameInit?.Invoke(this);
        }
コード例 #2
0
ファイル: GameManager.cs プロジェクト: Seiphyre/SpaceShooter
    private void InitGame()
    {
        _currentState = GameState.INIT;

        InitPlayer();

        OnGameInit?.Invoke();
    }
コード例 #3
0
ファイル: GameManager.cs プロジェクト: yeonhong/snipet
        private void ShowGameStart(int level)
        {
            _currentTurn = Turn.Wait;
            OnGameInit?.Invoke(this, new GameDayArgs(level));

            DOTween.Sequence().Wait(_levelStartDelay, () => {
                _currentTurn = Turn.Player;
                OnGameStart?.Invoke(this, null);
            });
        }
コード例 #4
0
        void Start()
        {
            mainMenuBackground.SetActive(true);
            Background.CreateCutsceneBackground(Vector3.zero);

            if (OnlineService == null)
            {
                // load data to inventory from file
                DataSystem.LoadInventory(CurrentPlayer.Inventory, out lastLoadedInventoryData);

                // if there is no service, everything is initialized
                OnGameInit?.Invoke(this);
            }

            Shop.OnAmmoBuy      += Shop_OnAmmoBuy;
            Shop.OnWeaponBuy    += Shop_OnWeaponBuy;
            Shop.OnWeaponRepair += Shop_OnWeaponRepair;
        }