private void MaybePopulateTags() { if (populatedTags) { return; } List <string> tags = engine.GetAllTagsInUse(); foreach (string tag in tags) { GameObject newButton = GameObject.Instantiate(tagButtonTemplate.gameObject); newButton.SetActive(true); newButton.transform.SetParent(tagButtonTemplate.transform.parent, false); newButton.GetComponent <Button>().onClick.AddListener(() => CloseAndReturn(true, ActorGroupSpec.NewByTag(tag))); newButton.GetComponentInChildren <TMPro.TMP_Text>().text = tag; } populatedTags = true; }
private void OnPlayerButtonClicked() { CloseAndReturn(true, ActorGroupSpec.NewByTag("player")); }