private void OnBecameInvisible()
 {
     print("outofsight");
     if (!disableReload)
     {
         gameManager.Reload();
         energyManager.ResetEnergy();
     }
 }
    IEnumerator RestartFromLastCheckPoint(float time)
    {
        //print("restart");
        GameObject checkPoint = GameObject.Find("checkpoint");

        yield return(new WaitForSeconds(time));

        littleOne.transform.position = checkPoint.transform.position;
        //print(checkPoint.transform.position);
        //print(littleOne.transform.position);


        health = GameState.maxHealth;
        energyManager.ResetEnergy();
        //stateManager.SaveState();
        EventManager.TriggerReload();
    }
Exemple #3
0
    public IEnumerator StartPlayerTurn()
    {
        yield return(null);

        _energyManager.ResetEnergy();
        _commandPointManager.AddPerTUrnPoints();
        _enemyManager.PickNextActions();

        // prob turn this into a coroutine to dish cards out over the course of half a second rather than instantly?
        for (int i = 0; i < _cardDrawPerTurn; i++)
        {
            _deckManager.DrawCard();
            yield return(new WaitForSeconds(0.25f));
        }

        GamePhase = GamePhase.PlayerTurn;

        yield return(null);
    }