private void MSetButton(IMCButton buttonObject, string buttonTitle, Sprite buttonSprite, UnityAction buttonAction) { if (buttonObject.Text && buttonTitle != "") { buttonObject.Text.text = buttonTitle; } if (buttonAction != null) { buttonObject.AddListener(buttonAction); } if (buttonSprite != null) { buttonObject.image.sprite = buttonSprite; } }
private void SetCloseObject()//设置close按钮所关闭的对象,如果closeObject对象在运行前为null的话,默认关闭的对象为IMCMessageBox自身 { if (closeButton) { closeButton.AddListener(() => { UnInit(); if (closeObject && closeObject != this.gameObject) { if (closeObject.GetComponent <IMCUIBehaviour>()) //2018年1月4日16:47:19 判断如果是ui类就执行基类中的UnInit函数 { closeObject.GetComponent <IMCUIBehaviour>().UnInit(); } else { Destroy(closeObject.gameObject); } } }); } }
protected override void Start() { base.Start(); leftBtn.AddListener(LeftBtnClick); rightBtn.AddListener(RightBtnClick); }