Esempio n. 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>();
            }
        }
        private void OnValidate()
        {
            if (_characterSelect == null)
            {
                _characterSelect = GetComponentInParent <CharacterSelect>();
            }

            if (_camera == null)
            {
                _camera = FindObjectOfType <CameraWrapper>();
            }

            if (_rect == null)
            {
                _rect = _selection.GetComponent <RectTransform>();
            }

#if UNITY_EDITOR
            if (_characterResources == null)
            {
                Utils.AssetDatabase.FindObjectOfType <World.Objects.Characters.Resources>();
            }
#endif
            int i = 0;
            foreach (var res in _characterResources.Characters)
            {
                _images[i].sprite = res.Portrait;
                i++;
            }

            _bound = (_height * _characterResources.Characters.Length) / 2;
        }