Exemplo n.º 1
0
    public void GameStart(string color)
    {
        for (int i = 0; i < _Stones.Count; i++)
        {
            _Stones[i].Clean(_SoundMng.isSoundOn());
            _UseStoneNumber = 0;
        }
        _SceneMng.OpenOmGamePopup();
        _SceneMng.CloseAlGamePopup();
        _SceneMng.CloseGameQuitPopup();
        _SceneMng.CloseOptionPopup();
        _SceneMng.CloseLogoutPopup();
        _SceneMng.CloseCreditPopup();
        _IsBlackTurn = true;
        _NowGameOm   = true;
        _GameStarted = true;
        _MustGoLobby = false;
        _TimerOn     = true;
        _ImBlack     = color == "black" ? true : false;
        _OmGameMng.GameStart();

        if (_ImBlack)
        {
            _ChangeStoneCount_My    = 2;
            _ChangeStoneCount_Enemy = 3;
            _MyColorIcon.sprite     = _OmGameMng._SpareStoneImage_Black;
            _EnemyColorIcon.sprite  = _OmGameMng._SpareStoneImage_White;
        }
        else
        {
            _ChangeStoneCount_My    = 3;
            _ChangeStoneCount_Enemy = 2;
            _MyColorIcon.sprite     = _OmGameMng._SpareStoneImage_White;
            _EnemyColorIcon.sprite  = _OmGameMng._SpareStoneImage_Black;
        }



        _OmGameUI.SetActive(true);
        _AlGameUI.SetActive(false);


        _MyTurnTimer = _TurnTime;
        _EnemyTimer  = _TurnTime;
    }
Exemplo n.º 2
0
    void UserLoginCheck()
    {
        if (auth.CurrentUser != _user)
        {
            bool signedIn = _user != auth.CurrentUser && auth.CurrentUser != null;
            if (!signedIn && _user != null)
            {
                Debug.Log("Signed out " + _user.UserId);
                _EmailField_Login.text      = "";
                _PasswordField_Login.text   = "";
                _EmailField_Account.text    = "";
                _PasswordField_Account.text = "";
                _SceneMng.CloseOptionPopup();
                _SceneMng.OpenLoginScene();
                _SceneMng.CloseLobbyScene();

                for (int i = 0; i < 10; i++)
                {
                    _RecordBlockObjects[i].gameObject.SetActive(false);
                }
                for (int i = 0; i < 5; i++)
                {
                    _UserRecordValue[i] = "";
                }
            }
            _user = auth.CurrentUser;
            if (signedIn)
            {
                Debug.Log("Signed in " + _user.UserId);
                _SceneMng.CloseLoginScene();
                _SceneMng.CloseUserAccountPopup();
                _SceneMng.OpenLobbyScene();
                UpdateRecordBlocks();
            }
        }
    }