Exemple #1
0
        private void Awake()
        {
            if (_currentSpawner == null)
            {
                _currentSpawner = this;
            }

            if (this._priority > _currentSpawner._priority)
            {
                this.SetCurrentSpawner();
            }
        }
Exemple #2
0
        public static void OnDrawSceneGizmos(RoomSpawner spawner, GizmoType gizmoType)
        {
            Color color = Color.white;

            if ((gizmoType & GizmoType.Selected) != 0)
            {
                color = Color.yellow;
            }

            var gizmo = "SpawnIcon.tiff";

            Gizmos.DrawIcon(spawner.transform.position, gizmo, true, color);
        }
Exemple #3
0
        private void OnValidate()
        {
            this.name = $"[ROOM_MANAGER_{this.gameObject.scene.name}]";

            _roomParameters = AssetDatabase.LoadAssetAtPath <RoomParameters>(
                $"Assets/ParametersObjects/MAPS/ROOM_MANAGER_{this.gameObject.scene.name}.asset");

            // if (_roomParameters != null)
            // {
            //     if (!_roomParameters.IsInitiated())
            //         _roomParameters.InitAtPath(this.gameObject.scene.path);
            // }

            // if (_roomParameters != null)
            // {
            //     if (_roomParameters.ThisSceneAsset == null || _roomParameters.ThisSceneAsset.SafeIsUnityNull())
            //     {
            //
            //     }
            //
            //     // if (_roomTransitions != null && _roomTransitions.Count > 0)
            //     // {
            //     //     _roomTransitions.RemoveAll(room => room == null);
            //     // }
            // }

            if (_initialCheckpoint == null)
            {
                var roomSpawner = this.GetComponentInChildren <RoomSpawner>();

                if (roomSpawner != null)
                {
                    _initialCheckpoint = roomSpawner;
                }
                else
                {
                    _initialCheckpoint = RoomSpawner.CreateSpawner();
                    _initialCheckpoint.transform.parent = this.transform;
                }
            }
        }
Exemple #4
0
 public void SetCurrentSpawner()
 {
     _currentSpawner = this;
 }