Exemple #1
0
        public void OnValidate()
        {
            if (_camera == null)
            {
                _camera = FindObjectOfType <CameraWrapper>();
            }

            _levels        = GetComponentsInChildren <World.Level>(true);
            _selectedLevel = _levels.Length == 0 ? null : _levels[0];

            if (_transitionEffect == null)
            {
                _transitionEffect = FindObjectOfType <Transitions.Transition>();
            }

            if (_characterSelect == null)
            {
                _characterSelect = FindObjectOfType <UI.CharacterSelect>();
            }

            if (_startMenu == null)
            {
                _startMenu = FindObjectOfType <UI.StartMenu>();
            }
        }
Exemple #2
0
 void OnValidate()
 {
     // if no camera referenced, grab the main camera
     if (!referenceCamera)
     {
         referenceCamera = FindObjectOfType <CameraWrapper>();
     }
 }