//缓动完成 TweenPosition tweenPos=GetComponent<TweenPosition>(); tweenPos.AddOnFinished(complete); //按钮按下 UIButton btn=GetComponent<UIButton>(); btn.onClick.Add(new EventDelegate(click)); void click(){ Debug.Log("click"); } void complete(){ Debug.Log("tweenPosition complete"); }
2.手动给uiButton中的OnClik Notify添加,如图
这种方式接收的是一个GameObject,GameObject里绑定有公开方法的脚本,可选择任意一个公开方法做为回调。
3.直接绑定脚本,脚本里带OnClick函数