Пример #1
0
 private void Awake()
 {
     //System.Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "yes"); <- добавить это если будет юзаться на айфоне для декодинга левела
     _saveScorePopup.Close += SaveScorePopupOnClose;
     _gameField = new Field();
     _gameFieldManager.Init(_gameField);
     _player = new Player();
     _player.Init(_gameField);
     _player.OnLifesCountChange += Player_OnLifesCountChange;
     _player.OnScoreChange += Player_OnScoreChange;
     _player.OnSnakeLengthChange += Player_OnSnakeLengthChange;
     _hudPanel.ChangeSnakeLength(_gameField.Snake.Count);
     _cameraController.Init(_gameFieldManager.SnakeHead);
     _audioController.PlayMusic();
     _gameFieldManager.Play();
 }
Пример #2
0
        public void Init(Field field)
        {
            _field = field;
            _field.CreateBodyPart += FieldOnCreateBodyPart;
            _field.FoodIted += OnFoodIted;
            _field.Initialize();
            GenerateField();
               /* for (int i = 0; i < _field.Snake.Count; i++)
            {
                _snake[i].Cell = _field.Snake[i];
                _snake[i].Init();
            }*/

            //Play();
        }
Пример #3
0
 public void Init(Field gameField)
 {
     //_gameField = gameField;
     Init();
 }