コード例 #1
0
        public static RoomParameters CreateRoomParameter(string name)
        {
            RoomParameters asset = ScriptableObject.CreateInstance <RoomParameters>();

            AssetDatabase.CreateAsset(asset, $"Assets/ParametersObjects/MAPS/ROOM_MANAGER_{name}.asset");
            AssetDatabase.SaveAssets();

            return(asset);
        }
コード例 #2
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;
                }
            }
        }
コード例 #3
0
 public void SetRoomParameter(RoomParameters roomParameters)
 {
     _previousRoom = roomParameters;
 }