void Update() { if (eventManager == null) { TileMap tileMap = GameObject.FindGameObjectWithTag("GameController").GetComponent <TileMap>(); eventManager = tileMap.eventManager; positionPanel = transform.FindChild("PositionPanel").GetComponent <positionPanelScript>(); effectPanel = transform.FindChild("EffectPanel").GetComponent <EffectPanelScript>(); eventDropDown = transform.FindChild("EventList").GetComponent <Dropdown>(); eventDropDown.ClearOptions(); foreach (GameEvent e in eventManager.getEvents()) { List <string> options = new List <string>(); options.Add(e.getIndex().ToString()); eventDropDown.AddOptions(options); } eventDropDown.value = eventDropDown.options.Count - 1; eventDropDown.RefreshShownValue(); setValues(eventDropDown.options.Count - 1); } }
void GatherScripts() { gameManagerScript = GameManagerObject.GetComponent<GameManager>(); effectPanelScript = EffectBoxPanel.GetComponent<EffectPanelScript>(); }