// 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); }
/// <summary> /// Добавить очки к счёту. /// </summary> /// <param name="gp"></param> public void AddGamePoints(int gp) { _gamePoinst += gp; GamePointsChange?.Invoke(_gamePoinst); }