Exemplo n.º 1
0
        public IHttpActionResult PutSHOW(int id, SHOW sHOW)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != sHOW.ShowID)
            {
                return(BadRequest());
            }

            db.Entry(sHOW).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SHOWExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 2
0
        public IHttpActionResult GetSHOW(int id)
        {
            SHOW sHOW = db.SHOWs.Find(id);

            if (sHOW == null)
            {
                return(NotFound());
            }

            return(Ok(sHOW));
        }
Exemplo n.º 3
0
        public IHttpActionResult PostSHOW(SHOW sHOW)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.SHOWs.Add(sHOW);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = sHOW.ShowID }, sHOW));
        }
Exemplo n.º 4
0
        public IHttpActionResult DeleteSHOW(int id)
        {
            SHOW sHOW = db.SHOWs.Find(id);

            if (sHOW == null)
            {
                return(NotFound());
            }

            db.SHOWs.Remove(sHOW);
            db.SaveChanges();

            return(Ok(sHOW));
        }
Exemplo n.º 5
0
		public Atom()
		{
            cShow = new SHOW();
            cShow.nDelay = 0;
            cShow.bShow = true;
            cHide = new HIDE();
            cHide.nDelay = 0;
            cHide.enType = HIDE.TYPE.stop;
            oTag = ""; // logging
			_cEffect = null;
			_bDone = false;
			cTemplate = null;
		}
Exemplo n.º 6
0
        private void menuAction()
        {
            switch (mSelection)
            {
                case (int)MENU_SELECTIONS.PLAY:
                    mMenuManager.event_menuDirectionPressed -= new InputManager.menuDirectionPressDelegate(menuNavigation);
                    mMenuManager.event_actionPressed -= new InputManager.buttonPressDelegate(menuAction);
                    eScreenEvent.Invoke(this, new EventArgs());
                    break;

                case (int)MENU_SELECTIONS.CONTROLS:
                    show = SHOW.CONTROLS;
                    showTime = MAX_CONTROL_TIME;
                    break;

                case (int)MENU_SELECTIONS.LANGUAGE:
                    if (mCurrentLanguage == Languages.English)
                        mCurrentLanguage = Languages.German;
                    else
                        mCurrentLanguage = Languages.English;
                    break;

                case (int)MENU_SELECTIONS.CREDITS:
                    show = SHOW.CREDITS;
                    showTime = MAX_CREDIT_TIME;
                    break;

                case (int)MENU_SELECTIONS.QUIT:
                    isOver = true;
                    break;
            }
        }
Exemplo n.º 7
0
        public override void update(GameTime pGameTime)
        {
            mBG.update(pGameTime);

            if (coolDown > 0)
            {
                coolDown = coolDown - pGameTime.ElapsedGameTime.Milliseconds;
            }
            else
            {
                switch (show)
                {
                    case SHOW.MENU:
                        mMenuManager.update(pGameTime);
                        mCursor.updatePos(mCursorLocation);
                        break;

                    case SHOW.CONTROLS:
                        showTime = showTime - pGameTime.ElapsedGameTime.Milliseconds;
                        if (showTime < 0)
                        {
                            show = SHOW.MENU;
                            //showTime = MAX_CONTROL_TIME;
                        }
                        break;
                    case SHOW.CREDITS:

                        showTime = showTime - pGameTime.ElapsedGameTime.Milliseconds;
                        if (showTime < 0)
                        {
                            show = SHOW.MENU;
                            //showTime = MAX_CONTROL_TIME;
                        }
                        break;
                }
            }
        }
Exemplo n.º 8
0
        void OnEnable()
        {
            dir       = "Assets/Data/";
            toShow    = SHOW.NOTHING;
            viewIndex = 1;
            EditorPrefs.SetString("ObjectPath", dir);

            if (EditorPrefs.HasKey("SettingsPath"))
            {
                string path = EditorPrefs.GetString("SettingsPath");
                settingsDB = AssetDatabase.LoadAssetAtPath <SettingsDatabase>(path);
            }
            else
            {
                settingsDB = AssetDatabase.LoadAssetAtPath <SettingsDatabase>("Assets/Data/SettingsDB.asset");
            }

            if (EditorPrefs.HasKey("ItemsPath"))
            {
                string path = EditorPrefs.GetString("ItemsPath");
                itemDB = AssetDatabase.LoadAssetAtPath <ItemDatabase>(path);
            }
            else
            {
                itemDB = AssetDatabase.LoadAssetAtPath <ItemDatabase>("Assets/Data/ItemDB.asset");
            }

            if (EditorPrefs.HasKey("WeaponsPath"))
            {
                string path = EditorPrefs.GetString("WeaponsPath");
                weaponDB = AssetDatabase.LoadAssetAtPath <WeaponDatabase>(path);
            }
            else
            {
                weaponDB = AssetDatabase.LoadAssetAtPath <WeaponDatabase>("Assets/Data/WeaponDB.asset");
            }

            if (EditorPrefs.HasKey("EnvPath"))
            {
                string path = EditorPrefs.GetString("EnvPath");
                envDB = AssetDatabase.LoadAssetAtPath <EnvironmentDatabase>(path);
            }
            else
            {
                envDB = AssetDatabase.LoadAssetAtPath <EnvironmentDatabase>("Assets/Data/EnvDB.asset");
            }

            if (EditorPrefs.HasKey("SupplyPath"))
            {
                string path = EditorPrefs.GetString("SupplyPath");
                supplyDB = AssetDatabase.LoadAssetAtPath <SupplyDatabase>(path);
            }
            else
            {
                supplyDB = AssetDatabase.LoadAssetAtPath <SupplyDatabase>("Assets/Data/SupplyDB.asset");
            }

            if (EditorPrefs.HasKey("CharPath"))
            {
                string path = EditorPrefs.GetString("CharPath");
                charDB = AssetDatabase.LoadAssetAtPath <CharacterDatabase>(path);
            }
            else
            {
                charDB = AssetDatabase.LoadAssetAtPath <CharacterDatabase>("Assets/Data/CharDB.asset");
            }
        }
Exemplo n.º 9
0
        void OnGUI()
        {
            GUILayout.BeginVertical();
            GUILayout.Label("SHT Data Editor", EditorStyles.boldLabel);
            if (GUILayout.Button("Game Settings", GUILayout.ExpandWidth(false)))
            {
                EditorUtility.FocusProjectWindow();
                Selection.activeObject = settingsDB;
                toShow = SHOW.SETTINGS;
            }
            if (GUILayout.Button("Weapons DB", GUILayout.ExpandWidth(false)))
            {
                EditorUtility.FocusProjectWindow();
                Selection.activeObject = weaponDB;
                toShow = SHOW.WEAPONS;
            }
            if (GUILayout.Button("Items DB", GUILayout.ExpandWidth(false)))
            {
                EditorUtility.FocusProjectWindow();
                Selection.activeObject = itemDB;
                toShow = SHOW.ITEMS;
            }
            if (GUILayout.Button("Env DB", GUILayout.ExpandWidth(false)))
            {
                EditorUtility.FocusProjectWindow();
                Selection.activeObject = envDB;
                toShow = SHOW.ENVIRONMENTS;
            }
            if (GUILayout.Button("Supply DB", GUILayout.ExpandWidth(false)))
            {
                EditorUtility.FocusProjectWindow();
                Selection.activeObject = supplyDB;
                toShow = SHOW.SUPPLIES;
            }
            if (GUILayout.Button("Char DB", GUILayout.ExpandWidth(false)))
            {
                EditorUtility.FocusProjectWindow();
                Selection.activeObject = charDB;
                toShow = SHOW.CHARS;
            }
            GUILayout.EndVertical();

            GUILayout.Space(20);

            switch (toShow)
            {
            case SHOW.SETTINGS:
                if (settingsDB == null)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(10);
                    if (GUILayout.Button("Create New Settings List", GUILayout.ExpandWidth(false)))
                    {
                        createNewSettingsDB();
                    }
                    GUILayout.EndHorizontal();
                }
                GUILayout.Space(20);
                if (settingsDB != null)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(10);
                    if (GUILayout.Button("Prev", GUILayout.ExpandWidth(false)))
                    {
                        if (viewIndex > 1)
                        {
                            viewIndex--;
                        }
                    }
                    GUILayout.Space(5);
                    if (GUILayout.Button("Next", GUILayout.ExpandWidth(false)))
                    {
                        if (viewIndex < settingsDB.settings.Count)
                        {
                            viewIndex++;
                        }
                    }
                    GUILayout.Space(60);
                    if (GUILayout.Button("Add Item", GUILayout.ExpandWidth(false)))
                    {
                        settingsDB.add();
                        viewIndex = itemDB.items.Count;
                    }
                    if (GUILayout.Button("Delete Item", GUILayout.ExpandWidth(false)))
                    {
                        settingsDB.removeSettingsAtIndex(viewIndex - 1);
                        viewIndex = settingsDB.settings.Count;
                    }
                    GUILayout.EndHorizontal();
                    if (settingsDB.settings.Count > 0)
                    {
                        GUILayout.BeginHorizontal();
                        viewIndex = Mathf.Clamp(EditorGUILayout.IntField("Current Item", viewIndex, GUILayout.ExpandWidth(false)), 1, settingsDB.settings.Count);
                        EditorGUILayout.LabelField("of   " + settingsDB.settings.Count.ToString() + "  items", "", GUILayout.ExpandWidth(false));
                        GUILayout.EndHorizontal();
                        int dbIndex = viewIndex - 1;
                        GUILayout.Label("Common game settings");
                        settingsDB.getSettingsAtIndex(dbIndex).turnTime = EditorGUILayout.FloatField("Turn Time", settingsDB.getSettingsAtIndex(dbIndex).turnTime);
                        GUILayout.Space(20);
                        GUILayout.Label("Default hero settings");
                        settingsDB.getSettingsAtIndex(dbIndex).hero.health = EditorGUILayout.FloatField("Hero health", settingsDB.getSettingsAtIndex(dbIndex).hero.health);
                        settingsDB.getSettingsAtIndex(dbIndex).hero.armor  = EditorGUILayout.FloatField("Hero armor", settingsDB.getSettingsAtIndex(dbIndex).hero.armor);
                        settingsDB.getSettingsAtIndex(dbIndex).hero.shield = EditorGUILayout.FloatField("Hero shield", settingsDB.getSettingsAtIndex(dbIndex).hero.shield);
                        settingsDB.getSettingsAtIndex(dbIndex).hero.shieldReplenishTime = EditorGUILayout.FloatField("Shield replenish time", settingsDB.getSettingsAtIndex(dbIndex).hero.shieldReplenishTime);
                        settingsDB.getSettingsAtIndex(dbIndex).hero.speed = EditorGUILayout.FloatField("Hero speed", settingsDB.getSettingsAtIndex(dbIndex).hero.speed);
                        GUILayout.Space(20);
                        GUILayout.Label("Default guard settings");
                        settingsDB.getSettingsAtIndex(dbIndex).guard.health = EditorGUILayout.FloatField("Guard health", settingsDB.getSettingsAtIndex(dbIndex).guard.health);
                        settingsDB.getSettingsAtIndex(dbIndex).guard.armor  = EditorGUILayout.FloatField("Guard armor", settingsDB.getSettingsAtIndex(dbIndex).guard.armor);
                        settingsDB.getSettingsAtIndex(dbIndex).guard.speed  = EditorGUILayout.FloatField("Guard speed", settingsDB.getSettingsAtIndex(dbIndex).guard.speed);
                        GUILayout.Space(10);
                    }
                    else
                    {
                        GUILayout.Label("The settings list is empty");
                    }
                }
                break;

            case SHOW.WEAPONS:
                if (weaponDB == null)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(10);
                    if (GUILayout.Button("Create New Weapon List", GUILayout.ExpandWidth(false)))
                    {
                        createNewWeaponDB();
                    }
                    GUILayout.EndHorizontal();
                }

                GUILayout.Space(20);

                if (weaponDB != null)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(10);
                    if (GUILayout.Button("Prev", GUILayout.ExpandWidth(false)))
                    {
                        if (viewIndex > 1)
                        {
                            viewIndex--;
                        }
                    }
                    GUILayout.Space(5);
                    if (GUILayout.Button("Next", GUILayout.ExpandWidth(false)))
                    {
                        if (viewIndex < weaponDB.weapons.Count)
                        {
                            viewIndex++;
                        }
                    }
                    GUILayout.Space(60);
                    if (GUILayout.Button("Add Item", GUILayout.ExpandWidth(false)))
                    {
                        weaponDB.add();
                        viewIndex = weaponDB.weapons.Count;
                    }
                    if (GUILayout.Button("Delete Item", GUILayout.ExpandWidth(false)))
                    {
                        weaponDB.removeWeaponAtIndex(viewIndex - 1);
                        viewIndex = weaponDB.weapons.Count;
                    }
                    GUILayout.EndHorizontal();
                    if (weaponDB.weapons.Count > 0)
                    {
                        GUILayout.BeginHorizontal();
                        viewIndex = Mathf.Clamp(EditorGUILayout.IntField("Current Item", viewIndex, GUILayout.ExpandWidth(false)), 1, weaponDB.weapons.Count);
                        EditorGUILayout.LabelField("of   " + weaponDB.weapons.Count.ToString() + "  items", "", GUILayout.ExpandWidth(false));
                        GUILayout.EndHorizontal();
                        int dbIndex = viewIndex - 1;
                        weaponDB.getWeaponAtIndex(dbIndex).name        = EditorGUILayout.TextField("Name", weaponDB.getWeaponAtIndex(dbIndex).name as string);
                        weaponDB.getWeaponAtIndex(dbIndex).description = EditorGUILayout.TextField("Description", weaponDB.getWeaponAtIndex(dbIndex).description as string);
                        weaponDB.getWeaponAtIndex(dbIndex).slot        = (WeaponSlot)EditorGUILayout.EnumPopup("Slot", weaponDB.getWeaponAtIndex(dbIndex).slot);
                        weaponDB.getWeaponAtIndex(dbIndex).damage      = EditorGUILayout.FloatField("Damage", weaponDB.getWeaponAtIndex(dbIndex).damage);
                        weaponDB.getWeaponAtIndex(dbIndex).rate        = EditorGUILayout.FloatField("Rate", weaponDB.getWeaponAtIndex(dbIndex).rate);
                        weaponDB.getWeaponAtIndex(dbIndex).range       = EditorGUILayout.FloatField("Range", weaponDB.getWeaponAtIndex(dbIndex).range);
                        weaponDB.getWeaponAtIndex(dbIndex).ammo        = EditorGUILayout.IntField("Ammo capacity", weaponDB.getWeaponAtIndex(dbIndex).ammo);
                        weaponDB.getWeaponAtIndex(dbIndex).reloadTime  = EditorGUILayout.FloatField("Reload time", weaponDB.getWeaponAtIndex(dbIndex).reloadTime);
                        weaponDB.getWeaponAtIndex(dbIndex).hasEffect   = EditorGUILayout.Toggle("Does it have effect?", weaponDB.getWeaponAtIndex(dbIndex).hasEffect);
                        if (weaponDB.getWeaponAtIndex(dbIndex).hasEffect)
                        {
                            GUILayout.Space(5);
                            weaponDB.getWeaponAtIndex(dbIndex).effect.name     = EditorGUILayout.TextField("Name", weaponDB.getWeaponAtIndex(dbIndex).effect.name as string);
                            weaponDB.getWeaponAtIndex(dbIndex).effect.type     = (EffectType)EditorGUILayout.EnumPopup("Type", weaponDB.getWeaponAtIndex(dbIndex).effect.type);
                            weaponDB.getWeaponAtIndex(dbIndex).effect.duration = EditorGUILayout.FloatField("Duration", weaponDB.getWeaponAtIndex(dbIndex).effect.duration);
                            weaponDB.getWeaponAtIndex(dbIndex).effect.value    = EditorGUILayout.FloatField("Value", weaponDB.getWeaponAtIndex(dbIndex).effect.value);
                        }
                        weaponDB.getWeaponAtIndex(dbIndex).prefab       = EditorGUILayout.ObjectField("Prefab", weaponDB.getWeaponAtIndex(dbIndex).prefab, typeof(GameObject), true) as GameObject;
                        weaponDB.getWeaponAtIndex(dbIndex).triggerSound = EditorGUILayout.ObjectField("OnTrigger sound effect", weaponDB.getWeaponAtIndex(dbIndex).triggerSound, typeof(AudioClip), true) as AudioClip;
                        weaponDB.getWeaponAtIndex(dbIndex).reloadSound  = EditorGUILayout.ObjectField("OnReload sound effect", weaponDB.getWeaponAtIndex(dbIndex).reloadSound, typeof(AudioClip), true) as AudioClip;
                        GUILayout.Space(10);
                    }
                    else
                    {
                        GUILayout.Label("The weapon list is empty");
                    }
                }
                break;

            case SHOW.ITEMS:
                if (itemDB == null)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(10);
                    if (GUILayout.Button("Create New Item List", GUILayout.ExpandWidth(false)))
                    {
                        createNewItemDB();
                    }
                    GUILayout.EndHorizontal();
                }
                GUILayout.Space(20);
                if (itemDB != null)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(10);
                    if (GUILayout.Button("Prev", GUILayout.ExpandWidth(false)))
                    {
                        if (viewIndex > 1)
                        {
                            viewIndex--;
                        }
                    }
                    GUILayout.Space(5);
                    if (GUILayout.Button("Next", GUILayout.ExpandWidth(false)))
                    {
                        if (viewIndex < itemDB.items.Count)
                        {
                            viewIndex++;
                        }
                    }
                    GUILayout.Space(60);
                    if (GUILayout.Button("Add Item", GUILayout.ExpandWidth(false)))
                    {
                        itemDB.add();
                        viewIndex = itemDB.items.Count;
                    }
                    if (GUILayout.Button("Delete Item", GUILayout.ExpandWidth(false)))
                    {
                        itemDB.removeItemAtIndex(viewIndex - 1);
                        viewIndex = itemDB.items.Count;
                    }
                    GUILayout.EndHorizontal();
                    if (itemDB.items.Count > 0)
                    {
                        GUILayout.BeginHorizontal();
                        viewIndex = Mathf.Clamp(EditorGUILayout.IntField("Current Item", viewIndex, GUILayout.ExpandWidth(false)), 1, itemDB.items.Count);
                        EditorGUILayout.LabelField("of   " + itemDB.items.Count.ToString() + "  items", "", GUILayout.ExpandWidth(false));
                        GUILayout.EndHorizontal();
                        int dbIndex = viewIndex - 1;
                        itemDB.getItemAtIndex(dbIndex).name        = EditorGUILayout.TextField("Item Name", itemDB.getItemAtIndex(dbIndex).name as string);
                        itemDB.getItemAtIndex(dbIndex).description = EditorGUILayout.TextField("Weapon Description", itemDB.getItemAtIndex(dbIndex).description as string);
                        itemDB.getItemAtIndex(dbIndex).prefab      = EditorGUILayout.ObjectField("Weapon Prefab", itemDB.getItemAtIndex(dbIndex).prefab, typeof(GameObject), true) as GameObject;
                        GUILayout.Space(10);
                    }
                    else
                    {
                        GUILayout.Label("The item list is empty");
                    }
                }
                break;

            case SHOW.ENVIRONMENTS:
                if (envDB == null)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(10);
                    if (GUILayout.Button("Create New Env List", GUILayout.ExpandWidth(false)))
                    {
                        createNewEnvDB();
                    }
                    GUILayout.EndHorizontal();
                }
                GUILayout.Space(20);
                if (envDB != null)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(10);
                    if (GUILayout.Button("Prev", GUILayout.ExpandWidth(false)))
                    {
                        if (viewIndex > 1)
                        {
                            viewIndex--;
                        }
                    }
                    GUILayout.Space(5);
                    if (GUILayout.Button("Next", GUILayout.ExpandWidth(false)))
                    {
                        if (viewIndex < envDB.environments.Count)
                        {
                            viewIndex++;
                        }
                    }
                    GUILayout.Space(60);
                    if (GUILayout.Button("Add Environment", GUILayout.ExpandWidth(false)))
                    {
                        envDB.add();
                        viewIndex = envDB.environments.Count;
                    }
                    if (GUILayout.Button("Delete Environment", GUILayout.ExpandWidth(false)))
                    {
                        envDB.removeEnvAtIndex(viewIndex - 1);
                        viewIndex = envDB.environments.Count;
                    }
                    GUILayout.EndHorizontal();
                    if (envDB.environments.Count > 0)
                    {
                        GUILayout.BeginHorizontal();
                        viewIndex = Mathf.Clamp(EditorGUILayout.IntField("Current Item", viewIndex, GUILayout.ExpandWidth(false)), 1, envDB.environments.Count);
                        EditorGUILayout.LabelField("of   " + envDB.environments.Count.ToString() + "  items", "", GUILayout.ExpandWidth(false));
                        GUILayout.EndHorizontal();
                        int dbIndex = viewIndex - 1;
                        envDB.getEnvAtIndex(dbIndex).theme = (Theme)EditorGUILayout.EnumPopup("Theme", envDB.getEnvAtIndex(dbIndex).theme);
                        GUILayout.Label("Setup covers and interior in the right panel");
                        GUILayout.Space(10);
                    }
                    else
                    {
                        GUILayout.Label("The environment list is empty");
                    }
                }
                break;

            case SHOW.SUPPLIES:
                if (supplyDB == null)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(10);
                    if (GUILayout.Button("Create New Supply List", GUILayout.ExpandWidth(false)))
                    {
                        createNewSupplyDB();
                    }
                    GUILayout.EndHorizontal();
                }
                GUILayout.Space(20);
                if (supplyDB != null)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(10);
                    if (GUILayout.Button("Prev", GUILayout.ExpandWidth(false)))
                    {
                        if (viewIndex > 1)
                        {
                            viewIndex--;
                        }
                    }
                    GUILayout.Space(5);
                    if (GUILayout.Button("Next", GUILayout.ExpandWidth(false)))
                    {
                        if (viewIndex < supplyDB.supplies.Count)
                        {
                            viewIndex++;
                        }
                    }
                    GUILayout.Space(60);
                    if (GUILayout.Button("Add Supply", GUILayout.ExpandWidth(false)))
                    {
                        supplyDB.add();
                        viewIndex = supplyDB.supplies.Count;
                    }
                    if (GUILayout.Button("Delete Supply", GUILayout.ExpandWidth(false)))
                    {
                        supplyDB.removeSupplyAtIndex(viewIndex - 1);
                        viewIndex = supplyDB.supplies.Count;
                    }
                    GUILayout.EndHorizontal();
                    if (supplyDB.supplies.Count > 0)
                    {
                        GUILayout.BeginHorizontal();
                        viewIndex = Mathf.Clamp(EditorGUILayout.IntField("Current Item", viewIndex, GUILayout.ExpandWidth(false)), 1, supplyDB.supplies.Count);
                        EditorGUILayout.LabelField("of   " + supplyDB.supplies.Count.ToString() + "  items", "", GUILayout.ExpandWidth(false));
                        GUILayout.EndHorizontal();
                        int dbIndex = viewIndex - 1;
                        supplyDB.getSupplyAtIndex(dbIndex).name        = EditorGUILayout.TextField("Name", supplyDB.getSupplyAtIndex(dbIndex).name as string);
                        supplyDB.getSupplyAtIndex(dbIndex).description = EditorGUILayout.TextField("Description", supplyDB.getSupplyAtIndex(dbIndex).description as string);
                        supplyDB.getSupplyAtIndex(dbIndex).prefab      = EditorGUILayout.ObjectField("Prefab", supplyDB.getSupplyAtIndex(dbIndex).prefab, typeof(GameObject), true) as GameObject;
                        GUILayout.Space(10);
                    }
                    else
                    {
                        GUILayout.Label("The supply list is empty");
                    }
                }
                break;

            case SHOW.CHARS:
                if (charDB == null)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(10);
                    if (GUILayout.Button("Create New Char List", GUILayout.ExpandWidth(false)))
                    {
                        createNewCharDB();
                    }
                    GUILayout.EndHorizontal();
                }
                GUILayout.Space(20);
                if (charDB != null)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(10);
                    if (GUILayout.Button("Prev", GUILayout.ExpandWidth(false)))
                    {
                        if (viewIndex > 1)
                        {
                            viewIndex--;
                        }
                    }
                    GUILayout.Space(5);
                    if (GUILayout.Button("Next", GUILayout.ExpandWidth(false)))
                    {
                        if (viewIndex < charDB.lists.Count)
                        {
                            viewIndex++;
                        }
                    }
                    GUILayout.Space(60);
                    if (GUILayout.Button("Add List", GUILayout.ExpandWidth(false)))
                    {
                        charDB.add();
                        viewIndex = charDB.lists.Count;
                    }
                    if (GUILayout.Button("Delete List", GUILayout.ExpandWidth(false)))
                    {
                        charDB.removeListAtIndex(viewIndex - 1);
                        viewIndex = charDB.lists.Count;
                    }
                    GUILayout.EndHorizontal();
                    if (charDB.lists.Count > 0)
                    {
                        GUILayout.BeginHorizontal();
                        viewIndex = Mathf.Clamp(EditorGUILayout.IntField("Current List", viewIndex, GUILayout.ExpandWidth(false)), 1, charDB.lists.Count);
                        EditorGUILayout.LabelField("of   " + charDB.lists.Count.ToString() + "  lists", "", GUILayout.ExpandWidth(false));
                        GUILayout.EndHorizontal();
                        int dbIndex = viewIndex - 1;
                        charDB.getListAtIndex(dbIndex).name = EditorGUILayout.TextField("Name", charDB.getListAtIndex(dbIndex).name as string);
                        GUILayout.Space(10);
                    }
                    else
                    {
                        GUILayout.Label("The char list is empty");
                    }
                }
                break;

            case SHOW.NOTHING:
                GUILayout.Label("Press on content button you want to edit");
                break;

            default:
                break;
            }
            if (GUI.changed)
            {
                if (weaponDB != null)
                {
                    EditorUtility.SetDirty(weaponDB);
                }
                if (itemDB != null)
                {
                    EditorUtility.SetDirty(itemDB);
                }
                if (settingsDB != null)
                {
                    EditorUtility.SetDirty(settingsDB);
                }
                if (envDB != null)
                {
                    EditorUtility.SetDirty(envDB);
                }
                if (supplyDB != null)
                {
                    EditorUtility.SetDirty(supplyDB);
                }
                if (charDB != null)
                {
                    EditorUtility.SetDirty(charDB);
                }
            }
        }