示例#1
0
        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();
            }
        }
示例#3
0
 public static void CreateDefault()
 {
     ScriptableObjectUtils.CreateOrGet <RoomMaterialPreset>("default");
 }