Пример #1
0
    void OnMouseDown()
    {
        gameManager.audioManager.PlaySound(9);
        if (gameManager.currentGameScreen == GameManager.CurrentGameScreen.upgradeAbility || gameManager.currentGameScreen == GameManager.CurrentGameScreen.upgradeArmament || gameManager.currentGameScreen == GameManager.CurrentGameScreen.upgradeShip)
        {
            hanger.CheckSave();
        }

        gameManager.currentGameScreen = GameManager.CurrentGameScreen.hanger;
        hanger.ToggleUpgradeButtons(true);
        upgradePanel.SetActive(false);
    }
Пример #2
0
    public IEnumerator HangerTutorialPartTwo()
    {
        Hanger hanger = gameManager.hanger;

        fader = images.transform.GetChild(0).GetComponent <SpriteRenderer>();
        fader.sortingOrder = 92;
        gridCollider       = hanger.buttonUpgradeAbility.GetComponent <BoxCollider>();
        boardFade          = gameManager.board.frontFade;

        hanger.ToggleUpgradeButtons(false);
        gameManager.ToggleFade(false);
        gameManager.optionsMenu.ToggleOptionMenuButton(false);

        yield return(StartCoroutine(gameManager.messageScreen.PlayMessagePause(0, "We just unlocked our\nfourth module! As cool as\nthat is, I have a\nconfession to make.\n\nOur ship is only fancy\nenough to bring three\nmodules at any time. We\ncan choose our three in\nthe module panel.")));

        textMesh.text = "";
        textMesh.transform.localPosition = new Vector2(0.0f, -2.02f);
        images.SetActive(true);
        Highlight("FadeMatch9", "MODULES CAN BE\nSELECTED IN THE\nHANGER", 180.0f, 1.87f, -3.6f, true);
        gridCollider.GetComponent <SpriteRenderer>().sortingOrder = 115;

        GameObject          upgradePanelObject = hanger.upgradePanelAbility.gameObject;
        UpgradePanelAbility upgradePanelModule = upgradePanelObject.GetComponent <UpgradePanelAbility>();

        while (!upgradePanelObject.activeSelf)
        {
            yield return(null);
        }
        upgradePanelModule.ChangeTabDetails(0);
        gridCollider.GetComponent <SpriteRenderer>().sortingOrder = 46;
        BoxCollider subpanelButton0 = upgradePanelModule.transform.GetChild(7).GetComponent <BoxCollider>();
        BoxCollider subpanelButton1 = upgradePanelModule.transform.GetChild(8).GetComponent <BoxCollider>();
        BoxCollider upgradeButton0  = upgradePanelModule.boxColliderUpgradeAbility[0];
        BoxCollider upgradeButton1  = upgradePanelModule.boxColliderUpgradeAbility[1];

        upgradeButton0.enabled  = false;
        upgradeButton1.enabled  = false;
        subpanelButton0.enabled = false;
        subpanelButton1.enabled = false;
        upgradePanelModule.buttonUpgradeConfirm.enabled = false;
        textMesh.text = "";
        arrow.SetActive(false);
        fader.sortingOrder = 114;
        gameManager.messageScreen.spriteGif.sortingOrder        = 116;
        gameManager.messageScreen.spriteMessageBox.sortingOrder = 115;
        gameManager.messageScreen.textMessage.GetComponent <MeshRenderer>().sortingOrder   = 116;
        gameManager.messageScreen.textMessage2.GetComponent <MeshRenderer>().sortingOrder  = 117;
        gameManager.messageScreen.tapToContinue.GetComponent <MeshRenderer>().sortingOrder = 116;
        yield return(StartCoroutine(gameManager.messageScreen.PlayMessagePause(0, "The modules selected in\nthis panel will be the ones\nthat we take with us into\nbattle.\n\nLet's go ahead and equip\nthe new module, Mega\nLaser.")));

        SpriteRenderer spriteButton = upgradePanelModule.spriteRendererUpgradeAbility[1];

        arrow.transform.GetChild(0).GetComponent <SpriteRenderer>().sortingOrder = 115;
        spriteButton.sortingOrder = 115;
        upgradeButton1.enabled    = true;

        Highlight("FadeMatch9", "SELECT MEGA LASER", 0.0f, -0.9f, 2.3f, false);
        fader.sortingOrder = 114;
        textMesh.transform.localPosition = new Vector2(0.0f, -1.1f);
        textMesh.GetComponent <MeshRenderer>().sortingOrder = 115;
        arrow.SetActive(true);

        SpriteRenderer laserNew = upgradePanelModule.spriteUpgradeNew[4];

        while (laserNew.enabled)
        {
            yield return(null);
        }
        upgradePanelModule.buttonUpgradeConfirm.enabled = false;
        images.SetActive(false);

        yield return(StartCoroutine(gameManager.messageScreen.PlayMessagePause(0, "Feel free to choose any\nmodule that you would like\nto use.")));

        gameManager.messageScreen.spriteGif.sortingOrder        = 104;
        gameManager.messageScreen.spriteMessageBox.sortingOrder = 102;
        gameManager.messageScreen.textMessage.GetComponent <MeshRenderer>().sortingOrder   = 103;
        gameManager.messageScreen.textMessage2.GetComponent <MeshRenderer>().sortingOrder  = 104;
        gameManager.messageScreen.tapToContinue.GetComponent <MeshRenderer>().sortingOrder = 104;
        upgradePanelModule.buttonUpgradeConfirm.enabled = true;
        spriteButton.sortingOrder = 110;
        upgradeButton0.enabled    = true;
        upgradeButton1.enabled    = true;
        subpanelButton0.enabled   = true;
        subpanelButton1.enabled   = true;
        gameManager.optionsMenu.ToggleOptionMenuButton(true);

        Destroy(gameObject);
    }
Пример #3
0
    public IEnumerator HangerTutorial()
    {
        Hanger hanger = gameManager.hanger;

        fader = images.transform.GetChild(0).GetComponent <SpriteRenderer>();
        fader.sortingOrder = 114;
        gridCollider       = hanger.buttonUpgradeShip.GetComponent <BoxCollider>();
        hanger.ToggleUpgradeButtons(false);
        gameManager.ToggleFade(false);
        boardFade = gameManager.board.frontFade;
        gameManager.optionsMenu.ToggleOptionMenuButton(false);

        yield return(StartCoroutine(gameManager.messageScreen.PlayMessagePause(0, "Welcome to my humble\nabode. I know what you\nare thinking, \"This looks\nlike a heap of scrap\nmetal.\"\nWell it isn't...Okay, I guess\nit is. But it is OUR heap of\nscrap metal!\n\n\nBut enough of that, we\ngot some ship\nmodifications while we\nwere out! Let's check 'em\nout!")));

        textMesh.text = "";
        textMesh.transform.localPosition = new Vector2(0.0f, -2.02f);
        images.SetActive(true);
        Highlight("FadeMatch9", "SHIP CAN BE UPGRADED\nIN THE HANGER", 180.0f, 0.0f, -3.6f, true);
        gridCollider.GetComponent <SpriteRenderer>().sortingOrder = 115;

        GameObject           upgradePanelObject   = hanger.buttonUpgradeArmament.upgradePanelObject;
        UpgradePanelArmament upgradePanelArmament = upgradePanelObject.GetComponent <UpgradePanelArmament>();

        while (!upgradePanelObject.activeSelf)
        {
            yield return(null);
        }

        gridCollider.GetComponent <SpriteRenderer>().sortingOrder = 46;
        GameObject objectButton = upgradePanelArmament.buttonUpgrade0;

        upgradePanelArmament.transform.GetChild(0).GetComponent <BoxCollider>().enabled = false;
        upgradePanelArmament.subPanel1.enabled            = false;
        upgradePanelArmament.subPanel2.enabled            = false;
        objectButton.GetComponent <BoxCollider>().enabled = false;
        upgradePanelArmament.buttonUpgrade1.GetComponent <BoxCollider>().enabled = false;
        upgradePanelArmament.buttonUpgrade2.GetComponent <BoxCollider>().enabled = false;
        textMesh.text = "";
        arrow.SetActive(false);
        fader.sortingOrder = 114;
        gameManager.messageScreen.spriteGif.sortingOrder        = 116;
        gameManager.messageScreen.spriteMessageBox.sortingOrder = 115;
        gameManager.messageScreen.textMessage.GetComponent <MeshRenderer>().sortingOrder   = 116;
        gameManager.messageScreen.textMessage2.GetComponent <MeshRenderer>().sortingOrder  = 117;
        gameManager.messageScreen.tapToContinue.GetComponent <MeshRenderer>().sortingOrder = 115;
        yield return(StartCoroutine(gameManager.messageScreen.PlayMessagePause(0, "Let's beef up our armor\nsome more. I would rather\nnot explode in space...\nor anywhere.")));

        SpriteRenderer spriteButton = objectButton.transform.GetChild(1).GetComponent <SpriteRenderer>();

        //fader.sortingOrder = 114;
        arrow.transform.GetChild(0).GetComponent <SpriteRenderer>().sortingOrder = 115;
        spriteButton.sortingOrder = 115;
        objectButton.transform.GetChild(2).GetComponent <MeshRenderer>().sortingOrder = 115;
        objectButton.GetComponent <BoxCollider>().enabled = true;

        yield return(new WaitForSeconds(0.2f));

        Highlight("FadeMatch9", "SELECT\nARMOR UPGRADE", 180.0f, -1.54f, -1.35f, false);
        textMesh.transform.localPosition = new Vector2(-0.81f, 0.18f);
        textMesh.GetComponent <MeshRenderer>().sortingOrder = 115;
        fader.sortingOrder = 114;
        arrow.SetActive(true);

        while (spriteButton.color.b < 1.0f)
        {
            yield return(null);
        }
        objectButton.GetComponent <BoxCollider>().enabled = false;
        spriteButton.sortingOrder = 110;
        objectButton.transform.GetChild(2).GetComponent <MeshRenderer>().sortingOrder = 110;

        Highlight("FadeMatch9", "SELECT UPGRADE", 180.0f, 0.77f, -3.95f, false);
        upgradePanelArmament.buttonUpgradeConfirmSprite.sortingOrder = 115;
        upgradePanelArmament.buttonUpgradeConfirmText.GetComponent <MeshRenderer>().sortingOrder = 116;
        textMesh.transform.localPosition = new Vector2(0.76f, -2.58f);
        fader.sortingOrder = 114;

        while (PlayerStats.playerStats.upgradeStatus[9] < 2)
        {
            yield return(null);
        }
        //spriteButton.sortingOrder = 110;
        upgradePanelArmament.buttonUpgradeConfirmSprite.sortingOrder = 110;
        upgradePanelArmament.buttonUpgradeConfirmText.GetComponent <MeshRenderer>().sortingOrder = 111;

        textMesh.text = "";
        arrow.SetActive(false);
        yield return(StartCoroutine(gameManager.messageScreen.PlayMessagePause(0, "Can never have too much\narmor. Close the panel\nwhen you are done.")));

        spriteBox.sortingOrder            = 113;
        fader.enabled                     = false;
        spriteBox.enabled                 = true;
        animatorbox.enabled               = true;
        spriteBox.transform.localPosition = new Vector2(1.96f, 3.78f);
        upgradePanelArmament.transform.GetChild(0).GetComponent <BoxCollider>().enabled = true;
        upgradePanelArmament.subPanel1.enabled            = true;
        upgradePanelArmament.subPanel2.enabled            = true;
        objectButton.GetComponent <BoxCollider>().enabled = true;
        upgradePanelArmament.buttonUpgrade1.GetComponent <BoxCollider>().enabled = true;
        upgradePanelArmament.buttonUpgrade2.GetComponent <BoxCollider>().enabled = true;

        while (upgradePanelObject.activeSelf)
        {
            yield return(null);
        }

        spriteBox.sortingOrder = 104;
        hanger.ToggleUpgradeButtons(false);
        //spriteBox.enabled = false;
        //animatorbox.enabled = false;

        fader.enabled = true;
        spriteBox.transform.localPosition = new Vector2(2.2f, 0.8f);
        spriteBox.transform.localScale    = new Vector2(1.96f, 6.0f);
        yield return(StartCoroutine(gameManager.messageScreen.PlayMessagePause(0, "You ready to save\nMittens? Tap the\narrows in front of the\nship when you want to\nget back out there.")));

        fader.enabled = false;
        hanger.ToggleUpgradeButtons(true);
        //spriteBox.enabled = true;
        //animatorbox.enabled = true;
        textMesh.transform.localPosition = new Vector2(1.3f, 2.0f);
        textMesh.text = "TAP ARROWS\nTO TAKE OFF";
        textMesh.GetComponent <MeshRenderer>().sortingOrder = 104;

        Transform   transformShip         = gameManager.ship.transform;
        GameObject  levelOne              = hanger.buttonLevelSelect[0].animator;
        BoxCollider boxColliderEnterLevel = hanger.buttonEnterLevel.GetComponent <BoxCollider>();

        boxColliderEnterLevel.enabled = false;
        hanger.buttonLevelSelect[0].GetComponent <BoxCollider>().enabled = false;
        hanger.buttonLevelSelect[1].GetComponent <BoxCollider>().enabled = false;
        while (transformShip.localScale.y < 2.4f)
        {
            yield return(null);
        }
        hanger.buttonHangerToLevelSelect.GetComponent <BoxCollider>().enabled = false;
        textMesh.text       = "";
        spriteBox.enabled   = false;
        animatorbox.enabled = false;

        while (transformShip.localPosition.x > -2.0f)
        {
            yield return(null);
        }

        fader.enabled = true;
        spriteBox.transform.localPosition = new Vector2(-0.55f, -1.4f);
        spriteBox.transform.localScale    = new Vector2(7.0f, 4.0f);
        spriteBox.enabled   = true;
        animatorbox.enabled = true;
        yield return(StartCoroutine(gameManager.messageScreen.PlayMessagePause(0, "And now to decide which\nsystem to fly to. We can\nselect any discovered\nsystem.\n\nI have already targeted\nFabris, the newly\ndiscovered system. Just\ntap the orange box and\nwe will head out.")));

        gameManager.messageScreen.spriteGif.sortingOrder        = 104;
        gameManager.messageScreen.spriteMessageBox.sortingOrder = 102;
        gameManager.messageScreen.textMessage.GetComponent <MeshRenderer>().sortingOrder   = 103;
        gameManager.messageScreen.textMessage2.GetComponent <MeshRenderer>().sortingOrder  = 104;
        gameManager.messageScreen.tapToContinue.GetComponent <MeshRenderer>().sortingOrder = 104;
        fader.enabled = false;
        hanger.buttonLevelSelect[0].GetComponent <BoxCollider>().enabled = true;
        hanger.buttonLevelSelect[1].GetComponent <BoxCollider>().enabled = true;

        while (transformShip.localPosition.y < 1.55f)
        {
            if (levelOne.activeSelf)
            {
                boxColliderEnterLevel.enabled     = false;
                spriteBox.transform.localScale    = new Vector3(2.0f, 1.6f, 2.0f);
                spriteBox.transform.localPosition = new Vector3(-2.08f, 2.75f, 0.0f);
            }
            else
            {
                boxColliderEnterLevel.enabled     = true;
                spriteBox.transform.localPosition = new Vector2(-0.55f, -1.4f);
                spriteBox.transform.localScale    = new Vector2(7.0f, 4.0f);
            }
            yield return(null);
        }

        hanger.buttonLevelSelect[0].GetComponent <BoxCollider>().enabled = true;
        gameManager.optionsMenu.ToggleOptionMenuButton(true);

        Destroy(gameObject);
    }