public void Init() { for (int index1 = 0; index1 < this.mStarArray.Length; ++index1) { int index = index1; ClickEventListener.Get(((Component)this.mStarArray[index1]).get_gameObject()).SetClickEventHandler((Action <GameObject>)(obj => this.OnStarClicked(index))); } }
public void Init() { for (int i = 0; i < mStarArray.Length; ++i) { int index = i; ClickEventListener listener = ClickEventListener.Get(mStarArray[i].gameObject); listener.SetClickEventHandler(delegate(GameObject obj) { OnStarClicked(index); }); } }
public static ClickEventListener Get(GameObject obj) { ClickEventListener clickEventListener = (ClickEventListener)obj.GetComponent <ClickEventListener>(); if (Object.op_Equality((Object)clickEventListener, (Object)null)) { clickEventListener = (ClickEventListener)obj.AddComponent <ClickEventListener>(); } return(clickEventListener); }
public static ClickEventListener Get(GameObject obj) { ClickEventListener listener = obj.GetComponent <ClickEventListener>(); if (listener == null) { listener = obj.AddComponent <ClickEventListener>(); } return(listener); }
public void Init() { for (int index1 = 0; index1 < this.mStarArray.Length; ++index1) { int index = index1; ClickEventListener.Get(((Component)this.mStarArray[index1]).get_gameObject()).SetClickEventHandler((Action <GameObject>)(obj => this.OnStarClicked(index))); } // ISSUE: method pointer ((UnityEvent)this.mExpandBtn.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(OnExpandBtnClicked))); }
bool mIsExpand; //是否扩大 public void Init() { for (int i = 0; i < mStarArray.Length; ++i) { int index = i; ClickEventListener listener = ClickEventListener.Get(mStarArray[i].gameObject); //得到每一个星的点击事件 listener.SetClickEventHandler(delegate(GameObject obj) { OnStarClicked(index); }); //添加星级点击 } mExpandBtn.onClick.AddListener(OnExpandBtnClicked); //展开按钮点击事件 }
public void Init() { for (int i = 0; i < mStarArray.Length; ++i) { int index = i; ClickEventListener listener = ClickEventListener.Get(mStarArray[i].gameObject); listener.SetClickEventHandler(delegate(GameObject obj) { OnStarClicked(index); }); Debug.Log(i); } mExpandBtn.onClick.AddListener(OnExpandBtnClicked); }
private void InitDots() { int childCount = this.mDotsRootObj.get_childCount(); for (int index1 = 0; index1 < childCount; ++index1) { Transform child = this.mDotsRootObj.GetChild(index1); DotElem dotElem = new DotElem(); dotElem.mDotElemRoot = ((Component)child).get_gameObject(); dotElem.mDotSmall = ((Component)child.Find("dotSmall")).get_gameObject(); dotElem.mDotBig = ((Component)child.Find("dotBig")).get_gameObject(); ClickEventListener clickEventListener = ClickEventListener.Get(dotElem.mDotElemRoot); int index = index1; clickEventListener.SetClickEventHandler((Action <GameObject>)(obj => this.OnDotClicked(index))); this.mDotElemList.Add(dotElem); } }
void InitDots() { int childCount = mDotsRootObj.childCount; for (int i = 0; i < childCount; ++i) { Transform tf = mDotsRootObj.GetChild(i); DotElem elem = new DotElem(); elem.mDotElemRoot = tf.gameObject; elem.mDotSmall = tf.Find("dotSmall").gameObject; elem.mDotBig = tf.Find("dotBig").gameObject; ClickEventListener listener = ClickEventListener.Get(elem.mDotElemRoot); int index = i; listener.SetClickEventHandler(delegate(GameObject obj) { OnDotClicked(index); }); mDotElemList.Add(elem); } }
public void Init() { ClickEventListener listener = ClickEventListener.Get(mStarIcon.gameObject); listener.SetClickEventHandler(OnStarClicked); }
public void Init() { ClickEventListener.Get(((Component)this.mStarIcon).get_gameObject()).SetClickEventHandler(new Action <GameObject>(this.OnStarClicked)); }
public void Init() { ClickEventListener.Get(((Component)this.mStarIcon).get_gameObject()).SetClickEventHandler(new Action <GameObject>(this.OnStarClicked)); // ISSUE: method pointer ((UnityEvent <bool>) this.mToggle.onValueChanged).AddListener(new UnityAction <bool>((object)this, __methodptr(OnToggleValueChanged))); }