示例#1
0
    public void CashPlanetoid(Planetoid toCash)
    {
        toCash.gameObject.SetActive(false);
        if (!_cashedPlanetoids.Contains(toCash))
        {
            _cashedPlanetoids.Add(toCash);
            _planetoids.Remove(toCash);
        }

        PlanetoidLeftPlay.CallOnceAtEndOfFrame();
    }
示例#2
0
    void Start()
    {
                #if UNITY_EDITOR
        //PlayGamesPlatform.DebugLogEnabled = true;
                #endif
        PlayGamesPlatform.Activate();

        SetupFinished.CallOnceAtEndOfFrame();
    }
示例#3
0
    void Damage(float damage)
    {
        if (_gameManager.GameRunning && _health > 0)
        {
            _health -= damage;
            UpdateShieldColor();

            if (_health <= 0)
            {
                Died.CallOnceAtEndOfFrame();
            }
        }
    }
示例#4
0
 void TryAuthenticateGooglePlay(Action successCallback)
 {
     Social.localUser.Authenticate((bool success) => {
         if (success)
         {
             GooglePlayAuthenticated.CallOnceAtEndOfFrame();
             successCallback();
         }
         else
         {
             _notLoggedInIndicator.SetActive(true);
         }
     });
 }
示例#5
0
    public void StopGameMode(bool instantly = false)
    {
        _gameMode.EndGame();

        GameModeEnded.CallOnceAtEndOfFrame();

        if (instantly)
        {
            _gameMenu.gameObject.SetActive(true);
        }
        else
        {
            StartCoroutine(DelayShowGameMenu());
        }
    }
示例#6
0
    public Planetoid GetNewOrCashedPlanetoid()
    {
        Planetoid planetoid;

        if (_cashedPlanetoids.Count > 0)
        {
            planetoid = _cashedPlanetoids[0];
            planetoid.gameObject.SetActive(true);
            _cashedPlanetoids.Remove(planetoid);
            _planetoids.Add(planetoid);
        }
        else
        {
            GameObject newPlanetoidObject = Instantiate(_planetoidPrefab.gameObject, Vector3.zero, Quaternion.identity) as GameObject;
            newPlanetoidObject.transform.parent = transform;
            planetoid = newPlanetoidObject.GetComponent <Planetoid>();
            _planetoids.Add(planetoid);
        }

        PlanetoidEnteredPlay.CallOnceAtEndOfFrame();

        return(planetoid);
    }