Exemple #1
0
    public IEnumerator SessionHandler(Session session, CampaignDefinition selectedCampaign, int selectedCampaignIndex)
    {
        if (!Definitions.initialized)
        {
            Definitions.Initialize(Assets.Get(Assets.ObjectDataSets.Default));
        }

        session.Hide();

        while (!session.player.progress.HasCampaignProgress(selectedCampaignIndex))
        {
            session.player.progress.AddCampaignProgress();
        }

        MissionDefinition missionDefinition = session.player.progress.IsNewGame(selectedCampaignIndex) ? selectedCampaign.GetMissionDefinition(selectedCampaign.firstMissionIndex) : null;
        int missionIndex = selectedCampaign.firstMissionIndex;

        if (missionDefinition == null)
        {
            Vector3     offset         = Camera.main.ViewportToWorldPoint(new Vector3(0.5f, 0.5f, Camera.main.transform.position.y)) + (Vector3.left * selectedCampaign.width * 0.5f) + (Vector3.forward * selectedCampaign.height * 0.5f);
            CampaignMap campaignMap    = new CampaignMap(selectedCampaign.width, selectedCampaign.height, selectedCampaign.columns, selectedCampaign.rows, offset);
            Layout      campaignLayout = new Layout("Campaign", gameObject);

            for (int i = 0; campaignMap.tileMap.count > i; i++)
            {
                int iIndex = i;

                if (selectedCampaign.Has(i) && session.player.progress.HasCompleted(selectedCampaignIndex, i))
                {
                    Button button = new Button(selectedCampaign.GetMissionDefinition(i).name, campaignMap.tileMap.tileWidth - 1, campaignMap.tileMap.tileHeight * 0.5f, gameObject, "CampaignMap" + i,
                                               fontSize: 20,
                                               Enter: (Button b) => b.SetColor(Color.green),
                                               Stay: (Button b) =>
                    {
                        if (Input.GetMouseButtonDown(0))
                        {
                            missionIndex      = iIndex;
                            missionDefinition = selectedCampaign.GetMissionDefinition(iIndex);
                        }
                    },
                                               Exit: (Button b) => b.SetColor(Color.cyan));

                    campaignLayout.Add(button);
                    button.SetColor(Color.cyan);
                    button.SetPosition(campaignMap.tileMap.PositionOf(i));

                    for (int j = 0; selectedCampaign.connections.Count > j; j++)
                    {
                        int jIndex = j;
                        if (selectedCampaign.connections[j].fromIndex == i)
                        {
                            if (!session.player.progress.HasCompleted(selectedCampaignIndex, selectedCampaign.connections[j].toIndex))
                            {
                                Button butt = new Button(selectedCampaign.GetMissionDefinition(selectedCampaign.connections[j].toIndex).name, campaignMap.tileMap.tileWidth - 1, campaignMap.tileMap.tileHeight * 0.5f, gameObject, "CampaignMap" + selectedCampaign.connections[j].toIndex,
                                                         fontSize: 20,
                                                         Enter: (Button b) => b.SetColor(Color.green),
                                                         Stay: (Button b) =>
                                {
                                    if (Input.GetMouseButtonDown(0))
                                    {
                                        missionIndex      = selectedCampaign.connections[jIndex].toIndex;
                                        missionDefinition = selectedCampaign.GetMissionDefinition(selectedCampaign.connections[jIndex].toIndex);
                                    }
                                },
                                                         Exit: (Button b) => b.SetColor(Color.white));

                                campaignLayout.Add(butt);
                                butt.SetPosition(campaignMap.tileMap.PositionOf(selectedCampaign.connections[jIndex].toIndex));
                            }
                        }
                    }
                }
            }

            while (missionDefinition == null)
            {
                campaignLayout.Update();
                yield return(null);
            }

            campaignLayout.Hide();
            campaignLayout.Destroy();
        }

        GameObject quad = GameObject.CreatePrimitive(PrimitiveType.Quad);

        quad.transform.rotation   = Quaternion.Euler(90, 0, 0);
        quad.transform.position   = Camera.main.ViewportToWorldPoint(new Vector3(0.5f, 0.5f, Camera.main.transform.position.y));
        quad.transform.localScale = new Vector3(12, 4, 1);

        TextMesh textMesh = new GameObject("StartText").AddComponent <TextMesh>();

        textMesh.transform.localRotation = quad.transform.rotation;
        textMesh.transform.SetPositionAndRotation(quad.transform.position + Vector3.up, quad.transform.rotation);
        textMesh.fontSize      = 200;
        textMesh.color         = Color.black;
        textMesh.characterSize = 0.15f;
        textMesh.anchor        = TextAnchor.MiddleCenter;
        textMesh.alignment     = TextAlignment.Center;
        textMesh.text          = "START";

        float wait = Time.time + 3;

        while (wait > Time.time)
        {
            yield return(null);
        }

        quad.SetActive(false);
        textMesh.gameObject.SetActive(false);

        StageDefinition stageDefinition = missionDefinition.stageDefinition;

        session.SetConveyor(new Conveyor(
                                speed: 7,
                                width: 4,
                                height: 15 + (1 * (stageDefinition.laneCount - 1)),
                                itemInterval: 1,
                                itemLimit: 8,
                                itemWidthPadding: 1,
                                itemSpacing: 0.1f));

        session.SetStage(new Stage(stageDefinition, session.player, session.conveyor));

        Level level = new Level(missionDefinition.duration);

        for (int i = 0; missionDefinition.waveDefinitions.Count > i; i++)
        {
            Wave wave = new Wave(missionDefinition.waveTimes[i] * missionDefinition.duration, session.stage);
            level.Add(wave);

            for (int j = 0; missionDefinition.waveDefinitions[i].waveEvents.Count > j; j++)
            {
                switch ((WaveEvent.Type)missionDefinition.waveDefinitions[i].waveEvents[j].type)
                {
                case WaveEvent.Type.SpawnEnemy:
                    wave.Add(new SpawnEnemyEvent(Definitions.Enemy(Definitions.Enemies.Mini), missionDefinition.waveDefinitions[i].waveEvents[j]));
                    break;
                }
            }
        }

        session.SetLevel(level);
        session.Show();

        int heroCount = session.player.inventory.heroes.Count;
        int start     = heroCount == 1
            ? 2
            : heroCount == 2
                ? 1
                : 0;

        int stride = start == 2
            ? 0
            : 2;

        for (int i = 0; session.player.inventory.heroes.Count > i; i++)
        {
            session.stage.AddHero(session.stage.LaneBy(start + (stride * i)), Definitions.Hero(Definitions.Heroes.Default));
        }

        while (1 > session.level.progress || session.stage.enemies > 0 || session.stage.items > 0)
        {
            session.Update(1 > session.level.progress || session.stage.enemies > 0);
            yield return(null);
        }

        quad.SetActive(true);
        textMesh.gameObject.SetActive(true);
        session.stage.DestroyLanes();
        session.level.HideProgress();
        session.coinCounter.Hide();

        if (session.heldItem != null)
        {
            session.heldItem.conveyorItem.Destroy();
            session.heldItem.Destroy();
        }

        session.Destroy();

        textMesh.text = "STOP";
        wait          = Time.time + 3;

        while (wait > Time.time)
        {
            yield return(null);
        }

        quad.SetActive(false);
        textMesh.gameObject.SetActive(false);
        Destroy(textMesh.gameObject);
        Destroy(quad);

        //boss warning?
        //boss battle?

        //end of level fanfare

        if (!session.player.progress.HasCompleted(selectedCampaignIndex, missionIndex))
        {
            session.player.progress.AddCompleted(selectedCampaignIndex, missionIndex);
        }

        Shop shop = new Shop();

        shop.Show(session.player);

        while (!Input.GetMouseButtonDown(1))
        {
            shop.Update();
            yield return(null);
        }

        shop.Hide();

        PlayerPrefs.SetString(session.player.name, JsonUtility.ToJson(session.player));
        PlayerPrefs.Save();

        StartSession(session.player, selectedCampaign, selectedCampaignIndex);
    }
Exemple #2
0
            public static void Create()
            {
                float headr = HeadR / W;

                Standard.Add(new Orbit(.1f, .2f, 1f / 13));
                Standard.Add(new Orbit(.367f, .2f, 1f / 13));
                Standard.Add(new Orbit(.633f, .2f, 1f / 13));
                Standard.Add(new Orbit(.9f, .2f, 1f / 13));
                Standard.Add(new Orbit(2f / 9, .5f, 1f / 13));
                Standard.Add(new Orbit(.5f, .5f, 1f / 13));
                Standard.Add(new Orbit(7f / 9, .5f, 1f / 13));
                Standard.Add(new Orbit(.1f, .8f, 1f / 13));
                Standard.Add(new Orbit(.367f, .8f, 1f / 13));
                Standard.Add(new Orbit(.633f, .8f, 1f / 13f));
                Standard.Add(new Orbit(.9f, .8f, 1f / 13));

                First.Add(new Orbit(1 / 12f, 1 / 6f, 1 / 21f));
                First.Add(new Orbit(11 / 12f, 1 / 6f, 1 / 21f));
                First.Add(new Orbit(1 / 12f, 5 / 6f, 1 / 21f));
                First.Add(new Orbit(11 / 12f, 5 / 6f, 1 / 21f));
                First.Add(new Orbit(.5f, .5f, 3 / 16f));
                First.Add(new Orbit(1 / 6f, .5f, 3 / 32f));
                First.Add(new Orbit(5 / 6f, .5f, 3 / 32f));
                First.Add(new Orbit(1 / 4f, 1 / 5f, 1 / 28f));
                First.Add(new Orbit(3 / 4f, 1 / 5f, 1 / 28f));
                First.Add(new Orbit(1 / 4f, 4 / 5f, 1 / 28f));
                First.Add(new Orbit(3 / 4f, 4 / 5f, 1 / 28f));

                Dense.Add(new Orbit(1 / 12f, 1 / 8f, 1 / 25f));
                Dense.Add(new Orbit(1 / 12f, 3 / 8f, 1 / 25f));
                Dense.Add(new Orbit(1 / 12f, 5 / 8f, 1 / 25f));
                Dense.Add(new Orbit(1 / 12f, 7 / 8f, 1 / 25f));
                Dense.Add(new Orbit(1 / 6f, 1 / 4f, 1 / 25f));
                Dense.Add(new Orbit(1 / 6f, 1 / 2f, 1 / 25f));
                Dense.Add(new Orbit(1 / 6f, 3 / 4f, 1 / 25f));
                Dense.Add(new Orbit(1 / 4f, 1 / 8f, 1 / 25f));
                Dense.Add(new Orbit(1 / 4f, 3 / 8f, 1 / 25f));
                Dense.Add(new Orbit(1 / 4f, 5 / 8f, 1 / 25f));
                Dense.Add(new Orbit(1 / 4f, 7 / 8f, 1 / 25f));
                Dense.Add(new Orbit(1 / 3f, 1 / 4f, 1 / 25f));
                Dense.Add(new Orbit(1 / 3f, 1 / 2f, 1 / 25f));
                Dense.Add(new Orbit(1 / 3f, 3 / 4f, 1 / 25f));
                Dense.Add(new Orbit(5 / 12f, 1 / 8f, 1 / 25f));
                Dense.Add(new Orbit(5 / 12f, 3 / 8f, 1 / 25f));
                Dense.Add(new Orbit(5 / 12f, 5 / 8f, 1 / 25f));
                Dense.Add(new Orbit(5 / 12f, 7 / 8f, 1 / 25f));
                Dense.Add(new Orbit(1 / 2f, 1 / 4f, 1 / 25f));
                Dense.Add(new Orbit(1 / 2f, 1 / 2f, 1 / 25f));
                Dense.Add(new Orbit(1 / 2f, 3 / 4f, 1 / 25f));
                Dense.Add(new Orbit(7 / 12f, 1 / 8f, 1 / 25f));
                Dense.Add(new Orbit(7 / 12f, 3 / 8f, 1 / 25f));
                Dense.Add(new Orbit(7 / 12f, 5 / 8f, 1 / 25f));
                Dense.Add(new Orbit(7 / 12f, 7 / 8f, 1 / 25f));
                Dense.Add(new Orbit(2 / 3f, 1 / 4f, 1 / 25f));
                Dense.Add(new Orbit(2 / 3f, 1 / 2f, 1 / 25f));
                Dense.Add(new Orbit(2 / 3f, 3 / 4f, 1 / 25f));
                Dense.Add(new Orbit(3 / 4f, 1 / 8f, 1 / 25f));
                Dense.Add(new Orbit(3 / 4f, 3 / 8f, 1 / 25f));
                Dense.Add(new Orbit(3 / 4f, 5 / 8f, 1 / 25f));
                Dense.Add(new Orbit(3 / 4f, 7 / 8f, 1 / 25f));
                Dense.Add(new Orbit(5 / 6f, 1 / 4f, 1 / 25f));
                Dense.Add(new Orbit(5 / 6f, 1 / 2f, 1 / 25f));
                Dense.Add(new Orbit(5 / 6f, 3 / 4f, 1 / 25f));
                Dense.Add(new Orbit(11 / 12f, 1 / 8f, 1 / 25f));
                Dense.Add(new Orbit(11 / 12f, 3 / 8f, 1 / 25f));
                Dense.Add(new Orbit(11 / 12f, 5 / 8f, 1 / 25f));
                Dense.Add(new Orbit(11 / 12f, 7 / 8f, 1 / 25f));

                Simple.Add(new Orbit(1 / 4f, .5f, .2f));
                Simple.Add(new Orbit(3 / 4f, .5f, .2f));
                Simple.Add(new Orbit(.5f, 1 / 6f, .05f));
                Simple.Add(new Orbit(.5f, 5 / 6f, .05f));

                Steps.Add(new Orbit(.12f + headr, .24f + headr * 2, .12f));
                Steps.Add(new Orbit(1 / 3f, .6f, .1f));
                Steps.Add(new Orbit(.5f, 14 / 16f - headr * 2, 1 / 16f));
                Steps.Add(new Orbit(2 / 3f, .6f, .1f));
                Steps.Add(new Orbit(.88f - headr, .24f + headr * 2, .12f));

                Isles.Add(new Orbit(1 / 12f + headr, 3 / 5f, 1 / 12f));
                Isles.Add(new Orbit(3 / 12f, 1 / 6f + headr * 2, 1 / 12f));
                Isles.Add(new Orbit(5 / 12f, 5 / 6f - headr * 2, 1 / 12f));
                Isles.Add(new Orbit(7 / 12f, 1 / 6f + headr * 2, 1 / 12f));
                Isles.Add(new Orbit(9 / 12f, 5 / 6f - headr * 2, 1 / 12f));
                Isles.Add(new Orbit(11 / 12f - headr, 2 / 5f, 1 / 12f));

                Moon.Add(new Orbit(1 / 4f, .3f + headr * 2, .15f));
                Moon.Add(new Orbit(.42f, .87f, 1 / 30f));
                Moon.Add(new Orbit(.3f, .5f, 1 / 30f));
                Moon.Add(new Orbit(.72381f, .18924f, 1 / 32f));
                Moon.Add(new Orbit(.62348f, .54328f, 1 / 18f));
                Moon.Add(new Orbit(.76483f, .43617f, 1 / 32f));
                Moon.Add(new Orbit(.32732f, .32711f, 1 / 26f));
                Moon.Add(new Orbit(.17231f, .79801f, 1 / 24f));
                Moon.Add(new Orbit(.79782f, .79701f, 1 / 20f));
                Moon.Add(new Orbit(.87982f, .33241f, 1 / 22f));
                Moon.Add(new Orbit(.54311f, .12411f, 1 / 28f));
                Moon.Add(new Orbit(.06251f, .56781f, 1 / 30f));
                Moon.Add(new Orbit(.52879f, .78232f, 1 / 34f));

                Ring.Add(new Orbit(3 / 13f, 1 / 9f + headr * 2, 1 / 18f));
                Ring.Add(new Orbit(5 / 13f, 1 / 9f + headr * 2, 1 / 18f));
                Ring.Add(new Orbit(7 / 13f, 1 / 9f + headr * 2, 1 / 18f));
                Ring.Add(new Orbit(9 / 13f, 1 / 9f + headr * 2, 1 / 18f));
                Ring.Add(new Orbit(4 / 13f, 8 / 9f - headr * 2, 1 / 18f));
                Ring.Add(new Orbit(6 / 13f, 8 / 9f - headr * 2, 1 / 18f));
                Ring.Add(new Orbit(8 / 13f, 8 / 9f - headr * 2, 1 / 18f));
                Ring.Add(new Orbit(10 / 13f, 8 / 9f - headr * 2, 1 / 18f));
                Ring.Add(new Orbit(1 / 15f + headr, 1 / 3f, 1 / 15f));
                Ring.Add(new Orbit(14 / 15f - headr, 2 / 3f, 1 / 15f));
                //Ring.Add(new Orbit(1/18f+headr, 1/8f, 1/18f));
                //Ring.Add(new Orbit(17/18f-headr, 7/8f, 1/18f));
                Ring.Add(new Orbit(.1f + headr, .8f - headr * 2, .1f));
                Ring.Add(new Orbit(.9f - headr, .2f + headr * 2, .1f));

                Wave.Add(new Orbit(1 / 6f, 2 / 9f + headr * 2, 1 / 9f));
                Wave.Add(new Orbit(2 / 6f, 7 / 9f - headr * 2, 1 / 9f));
                Wave.Add(new Orbit(3 / 6f, 2 / 9f + headr * 2, 1 / 9f));
                Wave.Add(new Orbit(4 / 6f, 7 / 9f - headr * 2, 1 / 9f));
                Wave.Add(new Orbit(5 / 6f, 2 / 9f + headr * 2, 1 / 9f));

                /*
                 * Me.Add(new Orbit(1/4f, 1/4f, .12f));
                 * Me.Add(new Orbit(1/4f, 3/4f, .12f));
                 * Me.Add(new Orbit(.52f, .155f, .06f));
                 * Me.Add(new Orbit(.67f, .155f, .06f));
                 * Me.Add(new Orbit(.82f, .155f, .06f));
                 * Me.Add(new Orbit(.595f, .5f, .12f));
                 * Me.Add(new Orbit(.52f, .85f, .06f));
                 * Me.Add(new Orbit(.875f, .85f, .05f));
                 */

                Me.Add(new Orbit(1 / 11f + headr, 9 / 11f - 2 * headr, 1 / 11f));
                Me.Add(new Orbit(13 / 44f + headr / 2, 29 / 44f - headr, 1 / 11f));
                Me.Add(new Orbit(.5f, .5f, 1 / 11f));
                Me.Add(new Orbit(31 / 44f - headr / 2, 15 / 44f + headr, 1 / 11f));
                Me.Add(new Orbit(10 / 11f - headr, 2 / 11f + 2 * headr, 1 / 11f));
            }
Exemple #3
0
    public Editor(Player player, GameObject parent) : base("Editor", parent)
    {
        session = new Session(new Player());
        session.Hide();

        waveData     = Assets.Get(Assets.WaveDataSets.Default);
        stageData    = Assets.Get(Assets.StageDataSets.Default);
        objectData   = Assets.Get(Assets.ObjectDataSets.Default);
        campaignData = Assets.Get(Assets.CampaignDataSets.Default);

        if (waveData == null)
        {
            waveData = Assets.Create <WaveData>(Assets.waveDataPath);
        }

        if (stageData == null)
        {
            stageData = Assets.Create <StageData>(Assets.stageDataPath);
        }

        if (campaignData == null)
        {
            campaignData = Assets.Create <CampaignData>(Assets.campaignDataPath);
        }

        if (objectData == null)
        {
            objectData = Assets.Create <ObjectData>(Assets.objectDataPath);
        }

        if (objectData.enemySets.Count == 0)
        {
            ScriptableObjects.Add(ScriptableObject.CreateInstance <EnemySet>(), objectData);
        }

        if (objectData.itemSets.Count == 0)
        {
            ScriptableObjects.Add(ScriptableObject.CreateInstance <ItemSet>(), objectData);
        }

        if (objectData.heroSets.Count == 0)
        {
            ScriptableObjects.Add(ScriptableObject.CreateInstance <HeroSet>(), objectData);
        }

        for (int i = objectData.enemySets[(int)Assets.ObjectDataSets.Default].enemyDefinitions.Count; (int)Definitions.Enemies.Count > i; i++)
        {
            ScriptableObjects.Add(ScriptableObject.CreateInstance <EnemyDefinition>().Initialize(((Definitions.Enemies)i).ToString(), 2, 1, (Definitions.Enemies)i), objectData.enemySets[(int)Assets.ObjectDataSets.Default]);
        }

        for (int i = objectData.heroSets[(int)Assets.ObjectDataSets.Default].heroDefinitions.Count; (int)Definitions.Heroes.Count > i; i++)
        {
            ScriptableObjects.Add(ScriptableObject.CreateInstance <HeroDefinition>().Initialize(((Definitions.Heroes)i).ToString(), 2, 1, (Definitions.Heroes)i), objectData.heroSets[(int)Assets.ObjectDataSets.Default]);
        }

        for (int i = objectData.itemSets[(int)Assets.ObjectDataSets.Default].itemDefinitions.Count; (int)Definitions.Items.Count > i; i++)
        {
            ScriptableObjects.Add(ScriptableObject.CreateInstance <ItemDefinition>().Initialize(((Definitions.Items)i).ToString(), 2, 1, (Definitions.Items)i), objectData.itemSets[(int)Assets.ObjectDataSets.Default]);
        }

        Definitions.Initialize(objectData);

        Add(testButton = new Button("Test", 1.5f, 0.5f, container, "Test",
                                    fontSize: 20,
                                    Enter: (Button button) => button.SetColor(stage != null && missionEditor.selectedMission != null ? Color.green : button.color),
                                    Stay: (Button button) =>
        {
            if (stage != null && missionEditor.selectedMission != null && Input.GetMouseButtonDown(0))
            {
                if (level == null)
                {
                    stage.conveyor.Show();
                    session.SetLevel(new Level(missionEditor.selectedMission.duration, showProgress: false));

                    for (int i = 0; missionEditor.selectedMission.waveDefinitions.Count > i; i++)
                    {
                        Wave wave = new Wave(missionEditor.selectedMission.waveTimes[i] * missionEditor.selectedMission.duration, stage);
                        level.Add(wave);

                        for (int j = 0; missionEditor.selectedMission.waveDefinitions[i].waveEvents.Count > j; j++)
                        {
                            switch ((WaveEvent.Type)missionEditor.selectedMission.waveDefinitions[i].waveEvents[j].type)
                            {
                            case WaveEvent.Type.SpawnEnemy:
                                wave.Add(new SpawnEnemyEvent(Definitions.Enemy((Definitions.Enemies)missionEditor.selectedMission.waveDefinitions[i].waveEvents[j].subType), missionEditor.selectedMission.waveDefinitions[i].waveEvents[j]));
                                break;
                            }
                        }
                    }

                    button.SetLabel("Stop");
                    button.SetPosition(saveButton.position);

                    saveButton.Hide();
                    saveButton.Disable();
                    objectsButton.Hide();
                    campaignButton.Hide();
                    stageEditor.HideStageSets();
                    stageEditor.HideStageEditor();
                    stageEditor.HideStageDefinitions();
                    missionEditor.HideMissionEditor();
                    waveEditor.HideWaveEventButtons();
                    session.Start();
                }
                else
                {
                    session.Stop();
                    stage.ClearLanes();
                    conveyor.Hide();
                    conveyor.Clear();
                    button.SetLabel("Test");
                    level.DestroyProgress();
                    session.SetLevel(null);
                    _heldItem = null;
                    _itemTime = 0;

                    saveButton.Show();
                    saveButton.Enable();
                    objectsButton.Show();
                    campaignButton.Show();
                    stageEditor.ShowStageSets();
                    stageEditor.ShowStageEditor();
                    missionEditor.ShowMissionEditor();
                    testButton.SetPosition(saveButton.position + Vector3.right * (saveButton.width));

                    if (waveEditor.selectedWaveDefinition != null)
                    {
                        waveEditor.ShowWaveEventButtons();
                    }
                }
            }
        },
                                    Exit: (Button button) => button.SetColor(Color.white)));


        Add(saveButton = new Button("Save", 1.5f, 0.5f, container, "Save",
                                    fontSize: 20,
                                    Enter: (Button button) => button.SetColor(Color.green),
                                    Stay: (Button button) =>
        {
            if (Input.GetMouseButtonDown(0))
            {
                EditorUtility.SetDirty(campaignData);
                EditorUtility.SetDirty(objectData);
                EditorUtility.SetDirty(stageData);
                EditorUtility.SetDirty(waveData);
                ScriptableObjects.Save();
            }
        },
                                    Exit: (Button button) => button.SetColor(Color.white)));

        saveButton.SetViewportPosition(new Vector2(0, 1));
        saveButton.SetPosition(saveButton.position + Vector3.up);
        testButton.SetPosition(saveButton.position + Vector3.right * (saveButton.width));
        testButton.Disable();
        testButton.Hide();

        Add(campaignButton = new Button("Campaigns", 2, 0.5f, container, "CampaignsButton",
                                        fontSize: 20,
                                        Enter: (Button button) => button.SetColor(button.selected ? button.color : Color.green),
                                        Stay: (Button button) =>
        {
            if (!button.selected && Input.GetMouseButtonDown(0))
            {
                ShowCampaignEditor();
            }
        },
                                        Exit: (Button button) => button.SetColor(button.selected ? button.color : Color.white)));

        campaignButton.SetViewportPosition(new Vector2(1, 1));
        campaignButton.SetPosition(campaignButton.position + (Vector3.left * campaignButton.width) + Vector3.up);

        Add(objectsButton = new Button("Objects", 2, 0.5f, container, "ObjectsButton",
                                       fontSize: 20,
                                       Enter: (Button button) => button.SetColor(button.selected ? button.color : Color.green),
                                       Stay: (Button button) =>
        {
            if (!button.selected && Input.GetMouseButtonDown(0))
            {
                ShowObjectEditors();
            }
        },
                                       Exit: (Button button) => button.SetColor(button.selected ? button.color : Color.white)));

        objectsButton.SetPosition(campaignButton.position + Vector3.left * (objectsButton.width));

        Add(campaignMapEditor = new CampaignMapEditor(this, container));
        Add(campaignEditor    = new CampaignEditor(this, Vector3.zero, container));
        Add(timelineEditor    = new TimelineEditor(this, container));
        Add(missionEditor     = new MissionEditor(this, container));
        Add(stageEditor       = new StageEditor(this, container));
        Add(enemyEditor       = new EnemyEditor(this, container));
        Add(waveEditor        = new WaveEditor(this, container));
        Add(itemEditor        = new ItemEditor(this, container));
        Add(heroEditor        = new HeroEditor(this, container));
        ShowCampaignEditor();
    }