void RemoveAllListeners() { CommonUI com = UIManager.Instance.GetUI <CommonUI>("CommonUI"); com.redoClickEvent -= NextDo; com.redoClickEvent -= ReDo; com = null; if (swapUI != null) { swapUI.chooseEvent -= ChooseBtnClickCallback; swapUI.speakEvent -= SpeakBtnClickCallback; } if (selectUI != null) { selectUI.okEvent -= SelectUIOkBtnCallback; } if (LS != null) { LS.Complete -= LsGiveObjCallback; LS.ClearCompleteEvent(); LS.timePointEvent = null; } if (XH != null) { XH.Complete -= XHJiewuCallback; XH.ClearCompleteEvent(); XH.timePointEvent = null; } GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, ClickLsCallBack); }
public void Dispose() { //comUI.redoClickEvent -= OnReDo; //comUI.nextClickEvent -= OnNextDo; if (comUI == null) { comUI = UIManager.Instance.GetUI <CommonUI>("CommonUI"); } comUI.redoClickEvent -= OnReDo; comUI.nextClickEvent -= OnNextDo; if (xiaohuaAnim != null) { xiaohuaAnim.timePointEvent = null; xiaohuaAnim.OnContinue(); xiaohuaAnim.ClearCompleteEvent(); } if (fdlsAnim != null) { fdlsAnim.OnContinue(); fdlsAnim.timePointEvent = null; fdlsAnim.ClearCompleteEvent(); } if (LS != null) { LS.timePointEvent = null; LS.OnContinue(); LS.ClearCompleteEvent(); LSCtrl lsctrl = LS.GetComponent <LSCtrl>(); if (lsctrl != null) { lsctrl.DestroyGuadian(); } } XHCtrl xhctrl = xiaohuaAnim.GetComponent <XHCtrl>(); if (xhctrl != null) { xhctrl.DestroyGuadian(); } comUI = null; evtFinished = null; evtRedo = null; if (emptyRoot != null) { Destroy(emptyRoot); emptyRoot = null; } Destroy(gameObject); }
public void Dispose() { if (comUI == null) { comUI = UIManager.Instance.GetUI <CommonUI>("CommonUI"); } comUI.redoClickEvent -= OnReDo; comUI.nextClickEvent -= OnNextDo; //comUI = null; if (xiaohuaAnim != null) { xiaohuaAnim.timePointEvent = null; xiaohuaAnim.OnContinue(); xiaohuaAnim.ClearCompleteEvent(); } if (teacherAnim != null) { teacherAnim.timePointEvent = null; teacherAnim.OnContinue(); teacherAnim.ClearCompleteEvent(); } if (xhctrl != null) { xhctrl.DestroyGuadian(); } if (lsCtrl != null) { lsCtrl.DestroyGuadian(); } ChooseDo.Instance.ResetAll(); HighLightCtrl.GetInstance().OffAllObjs(); GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickTeacherHandFirst); GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickTeacherHandFinal); if (goodA != null) { Destroy(goodA); } if (emptyRoot != null) { Destroy(emptyRoot); emptyRoot = null; } evtFinished = null; evtRedo = null; Destroy(gameObject); }
/// <summary> /// 将人物状态全部初始化 /// </summary> public void Reset() { for (int i = 0; i < transform.childCount; i++) { Transform temp = transform.GetChild(i); temp.localPosition = posArr[i]; //temp.gameObject.SetActive(false); //if (temp.name == "FDLS_BD") //{ // temp.Find("Group3/Main").localPosition = Vector3.zero; //} //else if (temp.name == "LS_BD") //{ // temp.Find("Group2/Main").localPosition = Vector3.zero; //} //else //{ // temp.Find("Group/Main").localPosition = Vector3.zero; //} temp.gameObject.SetActive(true); AnimationOper ao = temp.gameObject.GetAnimatorOper(); ao.OnContinue(); ao.ClearCompleteEvent(); ao.timePointEvent = null; temp.gameObject.GetAnimatorOper().PlayForward("idle"); XHCtrl xhctrl = temp.GetComponent <XHCtrl>(); if (xhctrl != null) { xhctrl.DestroyGuadian(); } LSCtrl lsctrl = temp.GetComponent <LSCtrl>(); if (lsctrl != null) { lsctrl.DestroyGuadian(); } } }
void RemoveAllListeners() { CommonUI com = UIManager.Instance.GetUI <CommonUI>("CommonUI"); com.redoClickEvent -= NextDo; com.redoClickEvent -= ReDo; com = null; if (LS != null) { LS.Complete -= KJLsGiveObjCallback; LS.timePointEvent = null; LS.ClearCompleteEvent(); } if (XH != null) { XH.Complete -= KJXHJiewuCallback; XH.timePointEvent = null; XH.ClearCompleteEvent(); } GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, ClickLsCallBack); }
public void Dispose() { if (comUI == null) { comUI = UIManager.Instance.GetUI <CommonUI>("CommonUI"); } comUI.redoClickEvent -= OnReDo; comUI.nextClickEvent -= OnNextDo; comUI = null; if (xiaohuaAnim != null) { xiaohuaAnim.timePointEvent = null; XHCtrl xhctrl = xiaohuaAnim.GetComponent <XHCtrl>(); if (xhctrl != null) { xhctrl.DestroyGuadian(); } xiaohuaAnim.gameObject.SetActive(false); xiaohuaAnim.transform.Find("Group/Main").localPosition = new Vector3(1.952808f, 0, 0.3788859f); xiaohuaAnim.gameObject.SetActive(true); xiaohuaAnim.OnContinue(); xiaohuaAnim.ClearCompleteEvent(); DestroyImmediate(xiaohuaAnim.gameObject); PeopleManager.Instance.GetNewXH(); //xiaohuaAnim.PlayForward("idle"); } Transform zhuozi2 = EnhanceCommunityModel.GetInstance().Jiaoshi().transform.Find("shinei/zhuozi2"); zhuozi2.transform.localPosition = zhuozi2Pos; if (LS != null) { LS.timePointEvent = null; LS.OnContinue(); LSCtrl lsctrl = LS.GetComponent <LSCtrl>(); if (lsctrl != null) { lsctrl.DestroyGuadian(); } } evtFinished = null; evtRedo = null; if (emptyRoot != null) { Destroy(emptyRoot); emptyRoot = null; } GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickTeacherHandFirst); GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickteacherHandSecond); //恢复老师位置和相机位置 PeopleManager.Instance.GetPeople("LS_BD").transform.localPosition = lsOldPos; GlobalDataManager.GetInstance().SetPcesCamera(); Destroy(gameObject); }
private void OnClickTeacherHandFinalSec(ClickedObj cobj) { if (cobj.objname == "shou") { GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickTeacherHandFinalSec); ChooseDo.Instance.Clicked(); CancelInvoke("ClickTeachersHandFinalSec"); GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickTeacherHandFinal); ClickDispatcher.Inst.EnableClick = false; GameObject shou = PeopleManager.Instance.GetPeople("LS_BD").transform.Find("LSB_BD/shou").gameObject; HighLightCtrl.GetInstance().FlashOff(shou); LS = PeopleManager.Instance.GetPeople(PeopleTag.LS_BD).GetAnimatorOper(); bool passA = false; bool passB = false; LegacyAnimationOper go = null; LS.timePointEvent = (a) => //老师递给物品 { if (a >= 25 && a <= 27 && !passA) //挂载到老师手上强化物时间点 { passA = true; LSCtrl lsctrl = LS.GetComponent <LSCtrl>();//将当前强化物挂在老师手上 lsctrl.SetJoint(qhwCtrl.gameObject); } if (a >= 45 && a < 47 && !passB)//小华接卡动画播放延迟一边挂载强化物 { passB = true; go = ResManager.GetPrefab("Prefabs/AnimationKa/TY_XH_JG_KA").GetLegacyAnimationOper(); go.transform.SetParent(transform); bool pass3 = false; xiaohuaAnim.timePointEvent = (b) =>//小华接过物品 挂载强化物 { if (b >= 42 && b <= 44 && !pass3) { pass3 = true; xiaohuaAnim.timePointEvent = null; qhwCtrl.gameObject.SetActive(false); goodA.transform.parent.gameObject.SetActive(false); XhQHW xhqhw = go.GetComponent <XhQHW>(); xhqhw.ShowObj(goodA.name); } }; xiaohuaAnim.ClearCompleteEvent(); xiaohuaAnim.Complete += () => { //8. 播放结束,出现下一关和重做的按钮。 Debug.Log("SpeakUpCtrlA.OnClickTeacherHandFinal(): 8. 播放结束,出现下一关和重做的按钮。"); comUI = UIManager.Instance.GetUI <CommonUI>("CommonUI"); comUI.redoClickEvent += OnReDo; comUI.nextClickEvent += OnNextDo; comUI.ShowFinalUI(); }; xiaohuaAnim.PlayForward("TY_XH_JG"); go.PlayForward("TY_XH_JG_KA"); } }; LS.PlayForward("TY_LS_DW"); } }