public static Room Create(Apartment parent) { Room room = CreateInstance <Room>(); room.MaterialPreset = ScriptableObjectUtils.CreateOrGet <RoomMaterialPreset>("default"); room.name = parent.GetRoomName(room.MaterialPreset); AssetDatabase.AddObjectToAsset(room, parent); room._ParentApartment = parent; room.WallObjects = new List <ContourObject>(); EditorUtility.SetDirty(parent); room._Contour = new List <RoomVert>(); AssetDatabase.SaveAssets(); return(room); }
public void SelectMode(Mode mode) { _CurrentMode = mode; switch (mode) { case Mode.Doors: _SelectedObject = ScriptableObjectUtils.CreateOrGet <Door>("default"); break; case Mode.Windows: _SelectedObject = ScriptableObjectUtils.CreateOrGet <Window>("default"); break; case Mode.Vert: _SelectedObject = new RoomVert(null, new Vector2()); break; } if (OnChangeMode != null) { OnChangeMode(); } }
public static void CreateDefault() { ScriptableObjectUtils.CreateOrGet <RoomMaterialPreset>("default"); }