void KJLsGiveObj() { CancelInvoke("KJClickLsGiveObjTip"); Debug.Log("教师给物品"); HighLightCtrl.GetInstance().FlashOff(jshand); ClickDispatcher.Inst.EnableClick = false; swapUI.SetButtonVisiable(SwapUI.BtnName.microButton, false); Transform qhw = transform.Find("QHW"); bool passXh = true; LS.timePointEvent = (a) => //老师递给物品 { if (a >= 25 && a <= 27) //挂载到老师手上强化物时间点 { LSCtrl lsctrl = LS.GetComponent <LSCtrl>(); //将当前强化物挂在老师手上 lsctrl.SetJoint(qhw.gameObject); //Debug.LogError("ls"); } if (a > 40 && a < 43 && passXh)//小华接卡动画播放延迟 { passXh = false; LS.timePointEvent = null; XH.timePointEvent = null; LegacyAnimationOper go = ResManager.GetPrefab("Prefabs/AnimationKa/TY_XH_JG_KA").GetLegacyAnimationOper(); go.name = "TY_XH_JG_KA"; go.transform.SetParent(transform); XH.timePointEvent = (b) =>//小华接过物品 挂载强化物 { //Debug.Log(b); if (b > 40 && b < 43)//卡在一帧,多帧updae -多次进入该方法-多次执行覆盖,B参数用的上一次 { XH.timePointEvent = null; //XHCtrl xhCtrl = XH.GetComponent<XHCtrl>(); //xhCtrl.SetJoint(qhw.gameObject); XhQHW xhqhw = go.GetComponent <XhQHW>(); string name = SentenceExpressionModel.GetInstance().CurReinforcement.pData.name; xhqhw.ShowObj(name); qhw.gameObject.SetActive(false); } }; XH.Complete += KJXHJiewuCallback; XH.PlayForward("TY_XH_JG"); go.PlayForward("TY_XH_JG_KA"); } }; LS.Complete += KJLsGiveObjCallback; LS.PlayForward("TY_LS_DW"); }
void LsGiveObj() { CancelInvoke("ClickLsGiveObjTip"); Debug.Log("教师给物品"); HighLightCtrl.GetInstance().FlashOff(jshand); ClickDispatcher.Inst.EnableClick = false; swapUI.SetButtonVisiable(SwapUI.BtnName.microButton, false); bool pass = true; bool pass1 = true; LS.timePointEvent = (a) => //老师递给物品 { if (a >= 25 && a <= 27 && pass1) //挂载到老师手上强化物时间点 { pass1 = false; LSCtrl lsctrl = LS.GetComponent <LSCtrl>();//将当前强化物挂在老师手上 lsctrl.SetJoint(qhwCtrl.gameObject); //qhwCtrl.SetPos(); //Debug.LogError("ls"); } if (a >= 42 && a < 46 && pass)//小华接卡动画播放延迟一边挂载强化物 { LS.timePointEvent = null; pass = false; LegacyAnimationOper go = ResManager.GetPrefab("Prefabs/AnimationKa/TY_XH_JG_KA").GetLegacyAnimationOper(); go.transform.SetParent(transform); XH.Complete += XHJiewuCallback; XH.timePointEvent = (b) =>//小华接过物品 { if (b >= 40 && b < 43) { XH.timePointEvent = null; //XHCtrl xhCtrl = XH.GetComponent<XHCtrl>(); //xhCtrl.SetJoint(qhwCtrl.gameObject); XhQHW xhqhw = go.GetComponent <XhQHW>(); string name = AcceptQuestionModel.GetInstance().CurReinforcement.pData.name; xhqhw.ShowObj(name); qhwCtrl.gameObject.gameObject.SetActive(false); } }; XH.PlayForward("TY_XH_JG"); go.PlayForward("TY_XH_JG_KA"); } }; LS.Complete += LsGiveObjCallback; LS.PlayForward("TY_LS_DW"); }
private void OnClickTeacherHandFinal(ClickedObj cobj) { if (cobj.objname == "shou") { ChooseDo.Instance.Clicked(); CancelInvoke("ClickTeachersPromptFinal"); GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickTeacherHandFinal); ClickDispatcher.Inst.EnableClick = false; HighLightCtrl.GetInstance().FlashOff(cobj.go); xiaohuaAnim.Complete += () => { //11. 播放结束,出现下一关和重做的按钮。 Debug.Log("DistinguishPictureCtrlA.OnClickTeacherHandFinal(): 11. 播放结束,出现下一关和重做的按钮。"); comUI = UIManager.Instance.GetUI <CommonUI>("CommonUI"); comUI.redoClickEvent += OnReDo; comUI.nextClickEvent += OnNextDo; comUI.ShowFinalUI(); }; int st = 30; int et = 33; int stm = 45; int etm = 47; int xhjgs = 22; int xhjge = 24; bool passA = false; bool passB = false; bool passD = false; teacherAnim.timePointEvent = (a) => //老师递给物品 { if (a > st && a < et && !passA) //挂载到老师手上强化物时间点 { passA = true; //将当前强化物挂在老师手上 //lsCtrl.SetJoint(RndReinforcementA.transform.parent.gameObject); //RndReinforcementA.transform.parent.localPosition = Vector3.zero; //RndReinforcementA.transform.localPosition = Vector3.zero; //RndReinforcementA.transform.parent.localRotation = Quaternion.Euler(Vector3.zero); RndReinforcementA.transform.parent.gameObject.SetActive(false); GameObject qhwm = ObjectsManager.instanse.GetQHW(); qhwm.transform.SetParent(emptyRoot.transform); qhwCtrl = qhwm.GetComponent <QHWCtrl>(); LSCtrl lsctrl = teacherAnim.GetComponent <LSCtrl>();//将当前强化物挂在老师手上 qhwCtrl.ShowObj(goodA.name); lsctrl.SetJoint(qhwCtrl.gameObject); } if (a > stm && a < etm && !passB)//小华接卡动画播放延迟一边挂载强化物 { passB = true; LegacyAnimationOper go = ResManager.GetPrefab("Prefabs/AnimationKa/TY_XH_JG_KA").GetLegacyAnimationOper(); go.transform.SetParent(transform, false); xiaohuaAnim.timePointEvent = (b) => { if (b > xhjgs && b < xhjge && !passD) { passD = true; RndReinforcementA.transform.parent.gameObject.SetActive(false); XhQHW xhqhw = go.GetComponent <XhQHW>(); xhqhw.ShowObj(goodA.name); qhwCtrl.gameObject.SetActive(false); } }; xiaohuaAnim.OnContinue(); xiaohuaAnim.PlayForward("TY_XH_JG"); go.PlayForward("TY_XH_JG_KA"); } }; teacherAnim.OnContinue(); teacherAnim.PlayForward("TY_LS_DW"); } }
void LsJieka() { CancelInvoke("ClickLsHandTip"); HighLightCtrl.GetInstance().FlashOff(jshand); ClickDispatcher.Inst.EnableClick = false; LS.Complete += LsGiveObjCallback; bool pause = true; bool pass1 = true; bool pass2 = true; bool pass3 = true; bool pass4 = true; bool pass5 = true; LS.timePointEvent = (a) => { if (a >= 51 && a <= 53 && pass1)//老师接卡 { pass1 = false; LSCtrl ctrl = LS.GetComponent <LSCtrl>(); string name = SwapModel.GetInstance().CurReinforcement.pData.name; Material matSource = SwapModel.GetInstance().GetTuKa("tuka_" + name).GetComponent <MeshRenderer>().materials[1]; Material matTar = ctrl.ls_tuka2.transform.Find("LS_tuka2 1").GetComponent <MeshRenderer>().materials[1]; matTar.CopyPropertiesFromMaterial(matSource); ctrl.ls_tuka2.gameObject.SetActive(true); XHCtrl xctrl = XH.GetComponent <XHCtrl>(); xctrl.r_tuka2.gameObject.SetActive(false); XH.OnContinue(); } if (a >= 81 && a <= 83 && pass2)//老师桌子放卡片 { pass2 = false; LSCtrl ctrl = LS.GetComponent <LSCtrl>();//手上卡隐藏,桌子上的卡显示 ctrl.ls_tuka2.gameObject.SetActive(false); lsTk.gameObject.SetActive(true); } if (a >= 94 && a <= 96 && pause) { pause = false; LS.OnPause(); //在某一帧停止时,下一次还会从该帧执行 LsJiekaCallback(); //提示 } if (a >= 122 && a <= 124 && pass3)//强化物挂到老师手上 { pass3 = false; LSCtrl ctrl = LS.GetComponent <LSCtrl>(); ctrl.SetJoint(qhw); } if (a >= 145 && a <= 147 && pass4)//小华接受物体时间点 { // LS.timePointEvent = null; //Debug.LogError("xh"); pass4 = false; LegacyAnimationOper go = ResManager.GetPrefab("Prefabs/AnimationKa/TY_XH_JG_KA").GetLegacyAnimationOper(); go.transform.SetParent(transform); XH.timePointEvent = (b) =>//小华接过物品 挂载强化物 { if (b >= 42 && b <= 44 && pass5) { pass5 = false; //XHCtrl xhCtrl = XH.GetComponent<XHCtrl>(); //xhCtrl.SetJoint(qhw); XhQHW xhqhw = go.GetComponent <XhQHW>(); xhqhw.ShowObj(qhw.name); qhw.gameObject.SetActive(false); //Debug.LogError("xh"); } }; XH.PlayForward("TY_XH_JG"); go.PlayForward("TY_XH_JG_KA"); } }; LS.PlayForward("TY_LS_JKDW");//LS_tuka/LS_tuka 1 //tuka2 }
private void OnClickteacherHandSecond(ClickedObj cobj) { if (cobj.objname == "shou") { Dialog dialog = UIManager.Instance.GetUI <Dialog>("Dialog"); dialog.Show(false); ChooseDo.Instance.Clicked(); CancelInvoke("ClickTeachersPromptSecond"); GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickteacherHandSecond); ClickDispatcher.Inst.EnableClick = false; HighLightCtrl.GetInstance().FlashOff(cobj.go); int st = 25; int et = 28; int xhst = 40; int xhet = 43; bool passA = false; bool passB = false; bool passC = false; GameObject qhwm = null; LS.timePointEvent = (a) => //老师递给物品 { if (a > st && a < et && !passB) //挂载到老师手上强化物时间点 { passB = true; LSCtrl lsctrl = LS.GetComponent <LSCtrl>();//将当前强化物挂在老师手上 qhwm = ObjectsManager.instanse.GetQHW(); qhwm.GetComponent <QHWCtrl>().ShowObj(goodA.name); qhwm.transform.localPosition = new Vector3(1.508f, 0, 0); //qhwm.transform.localPosition = Vector3.zero; lsctrl.SetJoint(qhwm); RndReinforcementA.transform.parent.gameObject.SetActive(false); } if (a > 45 && a < 48 && !passA)//小华接卡动画播放延迟一边挂载强化物 { passA = true; LegacyAnimationOper go = ResManager.GetPrefab("Prefabs/AnimationKa/XH_B_2ND_JG_KA").GetLegacyAnimationOper(); go.name = "XH_B_2ND_JG_KA"; go.transform.SetParent(transform); LS.timePointEvent = null; //播放结束,触发小华接过XXX。 xiaohuaAnim.timePointEvent = (aa) =>//小华接过物品 { if (aa > xhst && aa < xhet && !passC) { passC = true; xiaohuaAnim.timePointEvent = null; //XHCtrl xhCtrl = xiaohuaAnim.GetComponent<XHCtrl>(); //xhCtrl.SetJoint(RndReinforcementA.transform.parent.gameObject); qhwm.SetActive(false); XhQHW xhqhw = go.GetComponent <XhQHW>(); xhqhw.ShowObj(goodA.name); //8. 播放结束,出现下一关和重做的按钮。 Debug.Log("SpeakUpCtrlA.OnClickTeacherHandFinal(): 8. 播放结束,出现下一关和重做的按钮。"); comUI = UIManager.Instance.GetUI <CommonUI>("CommonUI"); comUI.redoClickEvent += OnReDo; comUI.nextClickEvent += OnNextDo; comUI.ShowFinalUI(); } }; go.PlayForward("XH_B_2ND_JG_KA"); xiaohuaAnim.PlayForward("TY_XH_JG_B2-3"); } }; LS.PlayForward("TY_LS_DW"); } }
private void OnClickteacherHandSecond(ClickedObj cobj) { if (cobj.objname == "shou") { Dialog dialog = UIManager.Instance.GetUI <Dialog>("Dialog"); dialog.Show(false); ChooseDo.Instance.Clicked(); CancelInvoke("ClickTeachersPromptSecond"); GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickteacherHandSecond); ClickDispatcher.Inst.EnableClick = false; HighLightCtrl.GetInstance().FlashOff(cobj.go); xiaohuaAnim.Complete += () => { //8. 播放结束,出现下一关和重做的按钮。 Debug.Log("SpeakUpCtrlA.OnClickTeacherHandFinal(): 8. 播放结束,出现下一关和重做的按钮。"); comUI = UIManager.Instance.GetUI <CommonUI>("CommonUI"); comUI.redoClickEvent += OnReDo; comUI.nextClickEvent += OnNextDo; comUI.ShowFinalUI(); }; LegacyAnimationOper go = null; bool passA = false; bool passB = false; 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); XhQHW xhqhw = go.GetComponent <XhQHW>(); xhqhw.ShowObj(goodA.name); goodA.transform.parent.gameObject.SetActive(false); } }; xiaohuaAnim.PlayForward("TY_XH_JG"); go.PlayForward("TY_XH_JG_KA"); } }; LS.PlayForward("TY_LS_DW"); } }
void LsGiveObj() { CancelInvoke("ClickLsGiveObjTip"); Debug.Log("妈妈接卡"); transform.Find("MM_E_3RD_JG_KA").gameObject.SetActive(false); HighLightCtrl.GetInstance().FlashOff(mmhand); ClickDispatcher.Inst.EnableClick = false; swapUI.SetButtonVisiable(SwapUI.BtnName.microButton, false); MM.Complete += LsGiveObjCallback; MM.timePointEvent = (a) => { if (a >= 120 && a <= 123)// { //Debug.LogError("MM"); MM.timePointEvent = null; MMCtrl mctrl = MM.GetComponent <MMCtrl>(); if (mctrl == null) { mctrl = MM.gameObject.AddComponent <MMCtrl>(); } //qhw.SetActive(false); //Debug.LogError(qhw.name); transform.Find("chaoshi/chaoshi_sw/panzi").GetComponent <PanziCtrl>().ShowObj(qhw.name); //mctrl.SetJoint(qhw); //qhw.transform.localPosition = Vector3.zero; //mctrl.ls_Lf.transform.localPosition = Vector3.zero; } }; MM.PlayForward("MM_E_3RE_DY"); LegacyAnimationOper ka = ResManager.GetPrefab("Prefabs/AnimationKa/MM_E_3RE_DY_KA").GetLegacyAnimationOper();//mm手中卡显示 ka.transform.SetParent(transform); ka.name = "MM_E_3RE_DY_KA"; Transform par = ka.transform.Find("Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_R/Shoulder_R/ShoulderPart1_R/ShoulderPart2_R/Elbow_R/Wrist_R/XH_R2"); //for (int i = 0; i < par.childCount; i++) //{ // par.GetChild(i).gameObject.SetActive(false); //} Transform jd = par.Find("judai2"); jd.gameObject.SetActive(true); Material tkmat = jd.Find("tuka9 1").GetComponent <MeshRenderer>().materials[1]; //par.Find(AcceptQuestionModel.GetInstance().CurReinforcement.pData.name).gameObject.SetActive(true); Reinforcement rfc = AcceptQuestionModel.GetInstance().CurReinforcement; Material matSource = AcceptQuestionModel.GetInstance().GetTuKa("tuka_" + rfc.pData.name).GetComponent <MeshRenderer>().materials[1]; tkmat.CopyPropertiesFromMaterial(matSource); bool passA = true; bool passB = true; ka.framePointEvent = (a) => { if (a >= 90 && a <= 92 && passB) { //Debug.LogError("xh"); passB = false; jd.gameObject.SetActive(false); } if (a >= 118 && a <= 120 && passA) { passA = false; ka.framePointEvent = null; //par.Find(rfc.pData.name).gameObject.SetActive(true); //qhw.SetActive(false); jd.gameObject.SetActive(false); XhQHW xhqhw = ka.GetComponent <XhQHW>(); xhqhw.ShowObj(rfc.pData.name); } }; ka.PlayForward("MM_E_3RE_DY_KA"); }