public void EnableButton(PauseMenuButtons button, bool active) { if (mMenuButtons[(int)button] != null) { mMenuButtons[(int)button].gameObject.SetActive(active); } }
// Use this for initialization void Start() { coinsText = GameObject.Find("Coins").GetComponent <Text>(); pointsText = GameObject.Find("ActualScore").GetComponent <Text>(); GameObject thePlayer = GameObject.Find("model1"); controlScript = thePlayer.GetComponent <CharacterControlScript>(); GameObject buttonsPanel = GameObject.Find("pauseMenu"); pmbScript = buttonsPanel.GetComponent <PauseMenuButtons>(); }
// Use this for initialization void Awake() { globalDataScript = FindObjectOfType <GlobalDataScript>(); pauseMenuButtonsScript = FindObjectOfType <PauseMenuButtons>(); playerStatScript = FindObjectOfType <PlayerStats>(); Dictionary <string, List <string> > playerDataDict = GlobalDataScript.Load(); for (int i = 0; i < 20; i++) { listOfSlots.Add(new ItemSlot()); } itemSection = GameObject.Find("ItemSection"); if (playerDataDict["playerInventory"].Count > 0) { foreach (Transform inventoryRow in itemSection.transform) { foreach (Transform itemSlot in inventoryRow.transform) { itemSlot.GetChild(0).GetChild(1).GetComponent <Image>().sprite = GameObject.Find(PopulateItemSlot(playerDataDict["playerInventory"][counter], counter)).GetComponent <Image>().sprite; counter++; } } } else { foreach (Transform inventoryRow in itemSection.transform) { foreach (Transform itemSlot in inventoryRow.transform) { itemSlot.GetChild(0).GetChild(1).GetComponent <Image>().sprite = GameObject.Find("Image").GetComponent <Image>().sprite; } } } for (int i = 0; i < 8; i++) { equippedArmor.Add(new ItemSlot()); } equippedSection = GameObject.Find("EquippedSection"); counter = 0; foreach (Transform itemSlot in equippedSection.transform) { itemSlot.GetChild(0).GetChild(1).GetComponent <Image>().sprite = GameObject.Find(PopulateEquippedSlot(playerDataDict["equippedInventory"][counter], counter)).GetComponent <Image>().sprite; counter++; } }
void Start() { GetComponent <AudioSource>().playOnAwake = false; GetComponent <AudioSource>().clip = coinAudio; GameObject thePlayer = GameObject.Find("model1"); controlScript = thePlayer.GetComponent <CharacterControlScript>(); animator = thePlayer.GetComponent <Animation>(); GameObject buttonsPanel = GameObject.Find("pauseMenu"); pmbScript = buttonsPanel.GetComponent <PauseMenuButtons>(); }
// Use this for initialization void Start() { playerStats = FindObjectOfType <PlayerStats>(); pauseMenuButtonsScript = FindObjectOfType <PauseMenuButtons>(); playerHealthManagerScript = FindObjectOfType <PlayerHealthManager>(); pauseMenu = GameObject.Find("LvlUpMenu"); lvlUpPanel = GameObject.Find("LvlUpPanel"); inventoryPanel = GameObject.Find("InventoryPanel"); pauseMenu.SetActive(false); inventoryPanel.SetActive(false); pauseStatus = false; lvlUpPanelStatus = true; inventoryPanelStatus = false; }
void Start() { pausemenubuttonscs = GameObject.FindObjectOfType(typeof(PauseMenuButtons)) as PauseMenuButtons; muteunmutecs = GameObject.FindObjectOfType(typeof(MuteUnMute)) as MuteUnMute; }