예제 #1
0
    public void switchMusic(string sceneName, GenericDictionary message)
    {
        if (MasterManager.isMenu(sceneName))
        {
            switchAudio(menuAudio);
            return;
        }

        if (message == null)
        {
            Debug.LogError("Message is null and we are supposed to play biome music");
            return;
        }

        object levelId = message.GetValue <object>("levelId");
        object biome   = message.GetValue <object>("biome");

        if (levelId != null && biome != null)
        {
            LevelData levelData = LevelLoader.instance.LoadLevelData((int)levelId, (DataTypes.BiomeType)biome);

            if (levelData != null)
            {
                if (levelData.isBossLevel)
                {
                    switchAudio(biomeAudioList.bossAudio);
                }
                else
                {
                    switchAudio(biomeAudioList.GetAudioForBiome((DataTypes.BiomeType)biome));
                }
            }
        }
    }
예제 #2
0
    void Start()
    {
        // foreach (Transform t in DescriptionPanel.transform)
        // {
        //  if(t.name == "Name") {
        //      skillName = t.GetComponent<Text>();
        //      skillName.text = "";
        //  } else if(t.name == "Description") {
        //      description = t.GetComponent<Text>();
        //      description.text = "";
        //  } else if(t.name == "Image") {
        //      skillIcon = t.GetComponent<Image>();
        //      skillIcon.enabled = false;
        //  } else if(t.name == "Button") {
        //      purchaseButton = t.GetComponent<Button>();
        //      // purchaseButton.onClick.AddListener(() => purchasePowerUp());
        //      purchaseButton.gameObject.SetActive(false);
        //  } else if(t.name == "isActive") {
        //      isActive = t.GetComponent<Text>();
        //      isActive.text = "";
        //  }
        // }

        // if(MasterPlayerData.instance.branchesAvailableOnActivePaddle() <= 0) {
        //  disableOthers();
        // }

        //BiomePopUp.SetActive(false);
        ActivePopUp.SetActive(false);
        PurchaseActivePopUp.SetActive(false);
        BiomeInfoPopUp.SetActive(false);


        GenericDictionary message = MasterManager.instance.getMessage();

        if (continueButton != null && message != null && message.GetValue <object>("continueGame") != null && (bool)message.GetValue <object>("continueGame"))
        {
            continueButton.gameObject.SetActive(true);
        }
        else
        {
            continueButton.gameObject.SetActive(false);
        }
    }