public void SetLocation(WorldMapGUI parent, WorldMapLocation location) { Text.text = location.Name; GetComponent <RectTransform>().anchoredPosition = location.ChunkPosition.AsVector2() * 4; Parent = parent; WorldMapLocation = location; }
void Awake() { mFadeImage = transform.Find("FadeLayer").GetComponent<Image>(); //assign all menu buttons mMenuButtons = transform.Find("MenuButtons").GetComponent<WorldMapGUI>(); mPopupBuyMenu = transform.Find("PopupBuyMenu").GetComponent<PopupBuyGUI>(); mPopupCraftingMenu = transform.Find("PopupCraftingMenu").GetComponent<PopupCraftingGUI>(); mPopupAchievementsMenu = transform.Find("PopupAchievementsMenu").GetComponent<PopupAchievementsGUI>(); mItemButtons = transform.Find("Items").GetComponent<ItemsGUI>(); mPerkButtons = transform.Find("Perks").GetComponent<PerksGUI>(); mIconButtons = transform.Find("Icons").GetComponent<IconsGUI>(); mOptionsGUICanvas = transform.Find("Options GUICanvas").GetComponent<OptionsGUICanvas>(); mMenuButtons.gameObject.SetActive(true); mPopupBuyMenu.gameObject.SetActive(true); mPopupCraftingMenu.gameObject.SetActive(true); mPopupAchievementsMenu.gameObject.SetActive(true); mItemButtons.gameObject.SetActive(true); mPerkButtons.gameObject.SetActive(true); mIconButtons.gameObject.SetActive(true); mOptionsGUICanvas.gameObject.SetActive(true); mButtons = GetComponentsInChildren<Button>(true); mDebugGUI = GetComponent<DebugGUI>(); }