/// <summary> /// 设置按钮 /// </summary> /// <param name="j"></param> /// <param name="item"></param> private void SetBtnItem(int j, GameObject item) { item.transform.SetParent(_Content); Button ItemBtn = item.GetComponent <Button>(); Animation ItemAni = item.GetComponent <Animation>(); ItemAnimations.Add(ItemAni); ItemBtn.image.sprite = _OptionList[j].image; Text ItemText = item.GetComponentInChildren <Text>(); if (ItemText != null) { ItemText.text = _OptionList[j].text; } ItemBtn.onClick.AddListener(() => { OnOptionClick.Invoke(j); }); }
private void optionsItem_Click(object sender, EventArgs args) { OptionsClick?.Invoke(this, EventArgs.Empty); }
private void optionsToolStripMenuItem_Click(object sender, EventArgs e) { OptionsClick?.Invoke(sender, e); }