예제 #1
0
    // Start is called before the first frame update
    void Start()
    {
        VirusGreed greed = FindObjectOfType <VirusGreed>();

        _state = FindObjectOfType <GameState>();
        if (!_state)
        {
            _state = Instantiate(gameStatePrefab).GetComponent <GameState>();
        }

        greed.NewGamePoints    += AddGamePoints;
        greed.NewMoves         += AddMoves;
        greed.NotPossibleMoves += SetNotPossibleMoves;

        Time.timeScale = 1.0f;

        GamePointsChange?.Invoke(_gamePoinst);
        MovesChange?.Invoke(_moves);
    }
예제 #2
0
 /// <summary>
 /// Добавить очки к счёту.
 /// </summary>
 /// <param name="gp"></param>
 public void AddGamePoints(int gp)
 {
     _gamePoinst += gp;
     GamePointsChange?.Invoke(_gamePoinst);
 }