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); }
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; } } }
public void SetRoomParameter(RoomParameters roomParameters) { _previousRoom = roomParameters; }