Пример #1
0
 public void setTemplate(int whichTemplate)
 {
     if (menuSlideAnimation.IsAnimating == false)
     {
         ShipWeaponTemplate template = templates[whichTemplate];
         if (whichWeaponToEquip == whichWeapon && MiscData.dungeonLevelUnlocked >= template.whichLevelUnlock)
         {
             if (whichWeapon == 1)
             {
                 frontWeapon.GetComponent <ShipWeaponScript>().swapTemplate(template);
                 PlayerUpgrades.whichFrontWeaponEquipped = whichTemplate;
             }
             else if (whichWeapon == 2)
             {
                 leftWeapon.GetComponent <ShipWeaponScript>().swapTemplate(template);
                 PlayerUpgrades.whichLeftWeaponEquipped = whichTemplate;
             }
             else if (whichWeapon == 3)
             {
                 rightWeapon.GetComponent <ShipWeaponScript>().swapTemplate(template);
                 PlayerUpgrades.whichRightWeaponEquipped = whichTemplate;
             }
             setPicture();
             FindObjectOfType <AudioManager>().PlaySound("Change Weapon");
             SaveSystem.SaveGame();
             menuSlideAnimation.PlayEndingAnimation(weaponMenu, () => { weaponMenu.SetActive(false); });
         }
     }
 }
Пример #2
0
 public void turnOnMenu(int whatMenu)
 {
     if (menuSlideAnimation.IsAnimating == false)
     {
         menuSlideAnimation.PlayEndingAnimation(weaponSelectorMenu, () => { weaponSelectorMenu.SetActive(false); });
         menusList[whatMenu].SetActive(true);
         menuSlideAnimation.PlayOpeningAnimation(menusList[whatMenu]);
         returnButton.SetActive(true);
         currMenu = whatMenu;
         FindObjectOfType <AudioManager>().PlaySound("Generic Button Click");
     }
 }
Пример #3
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.E) && menuAnimation.IsAnimating == false && PlayerProperties.playerScript.playerDead == false)
     {
         if (encyclopediaActive == false && PlayerProperties.playerScript.windowAlreadyOpen == false)
         {
             PlayerProperties.playerScript.windowAlreadyOpen = true;
             encyclopediaActive = true;
             Time.timeScale     = 0;
             CloseDungeonPage();
             raycastBlocker.SetActive(true);
             menuAnimation.PlayOpeningAnimation(gameObject);
         }
         else if (encyclopediaActive == true)
         {
             PlayerProperties.playerScript.windowAlreadyOpen = false;
             encyclopediaActive = false;
             Time.timeScale     = 1;
             menuAnimation.PlayEndingAnimation(gameObject, () => {
                 openMenu.gameObject.SetActive(false);
                 closedMenu.gameObject.SetActive(false);
                 raycastBlocker.SetActive(false);
             });
         }
     }
 }
Пример #4
0
 private void LateUpdate()
 {
     if (mapMenu.activeSelf == false)
     {
         if (
             playerScript.windowAlreadyOpen == false && playerScript.playerDead == false
             )
         {
             if (Input.GetKeyDown(KeyCode.M) && menuSlideAnimation.IsAnimating == false)
             {
                 playerScript.windowAlreadyOpen = true;
                 mapMenu.SetActive(true);
                 menuSlideAnimation.PlayOpeningAnimation(mapMenu);
                 UpdateUI();
                 Time.timeScale = 0;
             }
         }
     }
     else
     {
         if ((Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.M)) && menuSlideAnimation.IsAnimating == false)
         {
             playerScript.windowAlreadyOpen = false;
             menuSlideAnimation.PlayEndingAnimation(mapMenu, () => { mapMenu.SetActive(false); });
             Time.timeScale = 1;
         }
     }
 }
Пример #5
0
 void LateUpdate()
 {
     if (PlayerProperties.playerScript.playerDead == false && menuSlideAnimation.IsAnimating == false)
     {
         if (mapUI.transform.localScale == new Vector3(0, 0, 0))
         {
             if (Input.GetKeyDown(KeyCode.M) && GetComponent <PlayerScript>().windowAlreadyOpen == false)
             {
                 GetComponent <PlayerScript>().windowAlreadyOpen = true;
                 mapUI.transform.localScale = new Vector3(1, 1, 1);
                 menuSlideAnimation.PlayOpeningAnimation(mapUI);
                 Time.timeScale = 0;
             }
         }
         else
         {
             if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.M))
             {
                 GetComponent <PlayerScript>().windowAlreadyOpen = false;
                 Time.timeScale = 1;
                 menuSlideAnimation.PlayEndingAnimation(mapUI, () => { mapUI.transform.localScale = Vector3.zero; });
             }
         }
     }
     loadMap();
 }
Пример #6
0
    void LateUpdate()
    {
        if (menuSlideAnimation.IsAnimating == false)
        {
            if (shipStatsDisplay.activeSelf == false)
            {
                if (Input.GetKeyDown(KeyCode.U) && playerScript.windowAlreadyOpen == false)
                {
                    playerScript.windowAlreadyOpen = true;
                    UpdateUI();
                    shipStatsDisplay.SetActive(true);
                    PlayOpeningAnimation();
                    Time.timeScale = 0;
                }
            }
            else
            {
                if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.U))
                {
                    playerScript.windowAlreadyOpen = false;
                    menuSlideAnimation.PlayEndingAnimation(shipStatsDisplay, () => { shipStatsDisplay.SetActive(false); });
                    Time.timeScale = 1;

                    if (toolTip.activeSelf == true)
                    {
                        toolTip.SetActive(false);
                    }
                }
            }
        }
    }
Пример #7
0
    private void LateUpdate()
    {
        if (Vector2.Distance(playerShip.transform.position, transform.position) < 2.5f && playerShip.GetComponent <PlayerScript>().enemiesDefeated == true)
        {
            if (spawnedIndicator == null)
            {
                spawnedIndicator = Instantiate(indicator, transform.position + new Vector3(0, 0.8f, 0), Quaternion.identity);
                spawnedIndicator.GetComponent <ChestIndicator>().parentChest = this.gameObject;
            }

            if (menuSlideAnimation.IsAnimating == false)
            {
                if (displayOn == false)
                {
                    if (Input.GetKeyDown(KeyCode.F) && playerShip.GetComponent <PlayerScript>().windowAlreadyOpen == false)
                    {
                        playerShip.GetComponent <PlayerScript>().windowAlreadyOpen = true;
                        beenOpened = true;
                        selectAnim(typeChest);
                        displayOn = true;
                        UpdateUI();
                        Time.timeScale = 0;
                        chestDisplay.SetActive(true);
                        menuSlideAnimation.PlayOpeningAnimation(chestDisplay);
                        inventoryDisplay.SetActive(true);
                        PlayerProperties.playerInventory.PlayInventoryEnterAnimation();
                        playerShip.GetComponent <Inventory>().UpdateUI();
                    }
                }
                else
                {
                    if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.F))
                    {
                        if (toolTip.activeSelf == true)
                        {
                            toolTip.SetActive(false);
                        }
                        Time.timeScale = 1;
                        displayOn      = false;
                        menuSlideAnimation.PlayEndingAnimation(chestDisplay, () => { chestDisplay.SetActive(false); playerShip.GetComponent <PlayerScript>().windowAlreadyOpen = false; });
                        PlayerProperties.playerInventory.PlayInventoryExitAnimation();
                    }
                }
            }
        }
        else
        {
            if (spawnedIndicator != null)
            {
                Destroy(spawnedIndicator);
            }
        }
    }
Пример #8
0
    IEnumerator endingAnimation()
    {
        inventoryPanelSlideAnimation.PlayEndingAnimation(inventoryDisplay, () => { });
        missionPanelSlideAnimation.PlayEndingAnimation(missionDisplay, () => { });
        labelSlideAnimation.PlayEndingAnimation(pressEsc, () => { });
        foreach (Image image in sideRunes)
        {
            StartCoroutine(tweenAlphaToZero(image, 0.5f, 1));
        }
        StartCoroutine(tweenAlphaToZero(playerDead, 0.5f, 1));
        StartCoroutine(tweenAlphaToZero(playerSurvived, 0.5f, 1));

        yield return(new WaitForSeconds(0.5f));

        StartCoroutine(tweenAlphaToZero(GetComponent <Image>(), 1f, 0.7f));
        playerScript.windowAlreadyOpen = false;
        playerScript.playerDead        = false;
        StartCoroutine(dialogueLoop());
    }
Пример #9
0
    void LateUpdate()
    {
        if (Vector2.Distance(playerShip.transform.position, transform.position) < 5f && playerShip.GetComponent <PlayerScript>().enemiesDefeated == true)
        {
            if (shopDisplay.activeSelf == false)
            {
                if (spawnedIndicator == null)
                {
                    spawnedIndicator = Instantiate(examineIndicator, transform.position + new Vector3(0, 1f, 0), Quaternion.identity);
                    spawnedIndicator.GetComponent <ExamineIndicator>().parentObject = this.gameObject;
                }
            }
            else
            {
                if (spawnedIndicator != null)
                {
                    Destroy(spawnedIndicator);
                }
            }

            if (menuSlideAnimation.IsAnimating == false)
            {
                if (shopDisplay.activeSelf == true)
                {
                    if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.I))
                    {
                        menuSlideAnimation.PlayEndingAnimation(shopDisplay, () => { shopDisplay.SetActive(false); playerShip.GetComponent <PlayerScript>().windowAlreadyOpen = false; });
                        PlayerProperties.playerInventory.PlayInventoryExitAnimation();
                        playerShip.GetComponent <PlayerScript>().removeRootingObject();
                        Time.timeScale = 1;
                    }
                }
                else
                {
                    if (playerShip.GetComponent <PlayerScript>().windowAlreadyOpen == false)
                    {
                        if (Input.GetKeyDown(KeyCode.E))
                        {
                            shopDisplay.SetActive(true);
                            menuSlideAnimation.PlayOpeningAnimation(shopDisplay);
                            PlayerProperties.playerInventory.PlayInventoryEnterAnimation();
                            inventoryDisplay.SetActive(true);
                            playerShip.GetComponent <Inventory>().UpdateUI();
                            playerShip.GetComponent <PlayerScript>().addRootingObject();
                            setShopDisplay();
                            playerShip.GetComponent <PlayerScript>().windowAlreadyOpen = true;
                        }
                    }
                    else
                    {
                        if (spawnedIndicator != null)
                        {
                            Destroy(spawnedIndicator);
                        }
                    }
                }
            }
        }
        else
        {
            if (spawnedIndicator != null)
            {
                Destroy(spawnedIndicator);
            }
        }
    }
Пример #10
0
    void LateUpdate()
    {
        if (Vector2.Distance(playerShip.transform.position, transform.position) < 5f && MiscData.unlockedBuildings.Contains(buildingID))
        {
            if (shopDisplay.activeSelf == false)
            {
                if (spawnedIndicator == null)
                {
                    spawnedIndicator = Instantiate(examineIndicator, transform.position + new Vector3(0, 1f, 0), Quaternion.identity);
                    spawnedIndicator.GetComponent <ExamineIndicator>().parentObject = this.gameObject;
                }
            }
            else
            {
                if (spawnedIndicator != null)
                {
                    Destroy(spawnedIndicator);
                }
            }

            if (menuSlideAnimation.IsAnimating == false)
            {
                if (shopDisplay.activeSelf == true)
                {
                    if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.I))
                    {
                        inventory.PlayInventoryExitAnimation();
                        menuSlideAnimation.PlayEndingAnimation(shopDisplay, () => { shopDisplay.SetActive(false); PlayerProperties.playerScript.windowAlreadyOpen = false; });
                        PlayerProperties.playerScript.removeRootingObject();
                        PlayerProperties.tutorialWidgetMenu.CloseTutorial();
                        Time.timeScale = 1;
                    }
                }
                else if (playerShip.GetComponent <PlayerScript>().windowAlreadyOpen == false)
                {
                    if (Input.GetKeyDown(KeyCode.E))
                    {
                        shopDisplay.SetActive(true);
                        if (MiscData.firstTimeTutorialsPlayed.Contains(buildingID))
                        {
                            menuSlideAnimation.PlayOpeningAnimation(shopDisplay);
                        }
                        else
                        {
                            menuSlideAnimation.PlayOpeningAnimation(shopDisplay, () => { shopDisplay.GetComponentInChildren <TutorialInfoButton>().ShowTutorial(); });
                            MiscData.firstTimeTutorialsPlayed.Add(buildingID);
                        }
                        inventoryDisplay.SetActive(true);
                        playerShip.GetComponent <Inventory>().UpdateUI();
                        PlayerProperties.playerScript.addRootingObject();
                        setShopDisplay();
                        playerShip.GetComponent <PlayerScript>().windowAlreadyOpen = true;
                    }
                }
            }
        }
        else
        {
            if (spawnedIndicator != null)
            {
                Destroy(spawnedIndicator);
            }
        }

        if (!MiscData.unlockedBuildings.Contains(buildingID))
        {
            icon.SetActive(false);
        }
        else
        {
            icon.SetActive(true);
        }
    }
Пример #11
0
 public void PlayToolTipCloseAnimation()
 {
     menuSlideAnimation.PlayEndingAnimation(obstacleToolTip, () => { obstacleToolTip.SetActive(false); toolTipActive = false; });
 }
Пример #12
0
    void LateUpdate()
    {
        if (Vector2.Distance(playerShip.transform.position, transform.position) < 5f && (MiscData.unlockedBuildings.Contains(buildingID) || ignoreUnlockLevel) && playerShip.GetComponent <PlayerScript>().enemiesDefeated == true)
        {
            if (shipSmithDisplay.activeSelf == false)
            {
                if (spawnedIndicator == null)
                {
                    spawnedIndicator = Instantiate(examineIndicator, transform.position + new Vector3(0, 1f, 0), Quaternion.identity);
                    spawnedIndicator.GetComponent <ExamineIndicator>().parentObject = this.gameObject;
                }
            }
            else
            {
                if (spawnedIndicator != null)
                {
                    Destroy(spawnedIndicator);
                }
            }

            if (menuSlideAnimation.IsAnimating == false)
            {
                if (shipSmithDisplay.activeSelf == true)
                {
                    if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.E))
                    {
                        menuSlideAnimation.PlayEndingAnimation(shipSmithDisplay, () => { shipSmithDisplay.SetActive(false); });
                        PlayerProperties.tutorialWidgetMenu.CloseTutorial();
                        PlayerProperties.playerScript.removeRootingObject();
                        playerShip.GetComponent <PlayerScript>().windowAlreadyOpen = false;
                    }
                }
                else if (playerShip.GetComponent <PlayerScript>().windowAlreadyOpen == false)
                {
                    if (Input.GetKeyDown(KeyCode.E))
                    {
                        shipSmithDisplay.SetActive(true);
                        if (MiscData.firstTimeTutorialsPlayed.Contains(buildingID))
                        {
                            menuSlideAnimation.PlayOpeningAnimation(shipSmithDisplay);
                        }
                        else
                        {
                            if (buildingID == "weapon_outfitter")
                            {
                                menuSlideAnimation.PlayOpeningAnimation(shipSmithDisplay, () => { shipSmithDisplay.GetComponent <PickWeaponMenu>().ShowTutorial(); });
                            }
                            else if (buildingID == "shipsmith")
                            {
                                menuSlideAnimation.PlayOpeningAnimation(shipSmithDisplay, () => { shipSmithDisplay.GetComponent <ShipSmithMenus>().ShowTutorial(); });
                            }
                            MiscData.firstTimeTutorialsPlayed.Add(buildingID);
                        }
                        PlayerProperties.playerScript.addRootingObject();
                        playerShip.GetComponent <PlayerScript>().windowAlreadyOpen = true;
                    }
                }
            }
        }
        else
        {
            if (spawnedIndicator != null)
            {
                Destroy(spawnedIndicator);
            }
        }

        if ((MiscData.unlockedBuildings.Contains(buildingID) || ignoreUnlockLevel) && playerShip.GetComponent <PlayerScript>().enemiesDefeated == true)
        {
            icon.SetActive(true);
        }
        else
        {
            icon.SetActive(false);
        }
    }
Пример #13
0
 void CloseWindow()
 {
     isOpen = false;
     menuSlideAnimation.PlayEndingAnimation(disenchantingMenu, () => { disenchantingMenu.SetActive(false); ReturnItemIfPresent(); });
     PlayerProperties.tutorialWidgetMenu.CloseTutorial();
 }
Пример #14
0
 public void PlayEndingAnimation()
 {
     menuSlideAnimation.PlayEndingAnimation(altarDisplay, () => { altarDisplay.SetActive(false); });
 }
Пример #15
0
 void CloseWindow()
 {
     isOpen = false;
     menuSlideAnimation.PlayEndingAnimation(craftingMenu, () => { craftingMenu.SetActive(false); });
 }
Пример #16
0
 public void PlayEndingAnimation()
 {
     menuSlideAnimation.PlayEndingAnimation(gambleDisplay, () => { gambleDisplay.SetActive(false); });
 }
Пример #17
0
 public void CloseArtifacts()
 {
     playerScript.windowAlreadyOpen = false;
     menuSlideAnimation.PlayEndingAnimation(artifactsUI, () => artifactsUI.SetActive(false));
     Time.timeScale = 1;
 }
Пример #18
0
 public void PlayEndingAnimation()
 {
     menuSlideAnimation.PlayEndingAnimation(treasureDisplay, () => { treasureDisplay.SetActive(false); });
 }
Пример #19
0
 public void PlayInventoryExitAnimation()
 {
     menuSlideAnimation.PlayEndingAnimation(inventory, () => { inventory.SetActive(false); consumableConfirmationWindow.gameObject.SetActive(false); });
 }