Пример #1
0
        public void SetupScene(GameObject _player, GameObject background, GameObject gameRoot)
        {
            this._player = _player.AddComponent <Player>();
            _player.AddComponent <PlayerInput>();
            FindObjectOfType <SpawnerBase>().playerEntity = _player;
            if (Camera.main != null)
            {
                _gameCameraAnimator = Camera.main.gameObject.AddComponent <Animator>();
                _gameCameraAnimator.runtimeAnimatorController = cameraAnimatorController;
            }
            else
            {
                Debug.LogError("Camera is null");
            }

            SoundManager.Instance.LevelThemeClip = theme;

            // TO-DO  actions with background and gameRoot
            ResetLevelEvent?.Invoke();
            InvokeGameStarted();
        }
Пример #2
0
        //////////////////
        //Event Invokers//
        //////////////////

        public void InvokeResetLevel()
        {
            ResetLevelEvent?.Invoke();
        }