/// <summary> /// 小华贴字卡 /// </summary> void XhTzk() { XH.transform.localPosition = Vector3.zero; XH.transform.localEulerAngles = Vector3.zero; XH.Complete += XhTzkCallback; XH.OnContinue(); Debug.Log("continue"); LegacyAnimationOper ka = transform.Find("XH_E_3RD_FNN_KA").gameObject.GetLegacyAnimationOper(); Transform tk9 = ka.transform.Find("Group1/Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_L/Shoulder_L/ShoulderPart1_L/ShoulderPart2_L/Elbow_L/Wrist_L/judai1/tuka9"); Material mat = tk9.GetComponent <MeshRenderer>().materials[1]; Reinforcement rfc = AcceptQuestionModel.GetInstance().CurReinforcement; Material matTar = AcceptQuestionModel.GetInstance().GetTuKa("tuka_" + rfc.pData.name).GetComponent <MeshRenderer>().materials[1]; mat.CopyPropertiesFromMaterial(matTar); tk9.localEulerAngles = Vector3.zero; //Material matWy = AcceptQuestionModel.GetInstance().GetTuKa(PropsTag.judai_woyao.ToString()).GetComponent<MeshRenderer>().materials[1]; Material matSource = ka.transform.Find("Group1/Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_L/Shoulder_L/ShoulderPart1_L/ShoulderPart2_L/Elbow_L/Wrist_L/tuka8").GetComponent <MeshRenderer>().materials[1]; //我要图卡 matSource.CopyPropertiesFromMaterial(matTar); //更换我要图卡物体材质 //bool pass = true; ka.Complete = () => { ka.Complete = null; Vector3 tkeular = new Vector3(0, -90, 0); tk9.localEulerAngles = tkeular; Debug.LogError(tk9.localEulerAngles); }; ka.OnContinue(); }
private void OnClickFDTeacherHandFirst(ClickedObj cobj) { Debug.Log("SpeakUpCtrlA.OnClickTeacherHandFirst(): " + cobj.objname); if (cobj.objname == "fdls_shou") { ChooseDo.Instance.Clicked(); CancelInvoke("ClickFDTeachersPromptFirst"); GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickFDTeacherHandFirst); ClickDispatcher.Inst.EnableClick = false; HighLightCtrl.GetInstance().FlashOff(cobj.go); int start = 180; int end = 182; bool passB = false; xiaohuaAnim.timePointEvent = (t) => { if (t >= start && t <= end && !passB) { passB = true; xiaohuaAnim.timePointEvent = null; xiaohuaAnim.OnPause(); fdlsAnim.OnPause(); FBNKT_KA_AnimOper.OnPause(); GameObject shou = PeopleManager.Instance.GetPeople("LS_BD").transform.Find("LSB_BD/shou").gameObject; HighLightCtrl.GetInstance().FlashOn(shou); GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickTeacherHandFinal); GlobalEntity.GetInstance().AddListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickTeacherHandFinal); ClickDispatcher.Inst.EnableClick = true; ChooseDo.Instance.DoWhat(5, RedoClickTeachersHandFinal, null); } }; fdlsAnim.OnContinue(); bool passA = false; fdlsAnim.timePointEvent = (a) => { if (a >= 100 && a <= 102 && !passA) { passA = true; FBNKT_KA_AnimOper.OnContinue(); xiaohuaAnim.OnContinue(); } }; } }
private void OnClickteacherHandFirst(ClickedObj cobj) { Debug.Log("SpeakUpCtrlB.OnClickTeacherHandFirst(): " + cobj.objname); if (cobj.objname == "shou") { ChooseDo.Instance.Clicked(); CancelInvoke("ClickTeachersPromptFirst"); GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickteacherHandFirst); ClickDispatcher.Inst.EnableClick = false; HighLightCtrl.GetInstance().FlashOff(cobj.go); LS = PeopleManager.Instance.GetPeople(PeopleTag.LS_BD).GetAnimatorOper(); LS.OnContinue(); bool passB = false; LS.timePointEvent = (a) =>//老师借卡时间点 { if (a >= 22 && a < 24 && !passB) { passB = true; UnityEngine.Debug.Log("SpeakUpCtrlA::OnClickTeacherHandFinal(): 隐藏沟通本句带"); LS.timePointEvent = null; xiaohuaAnim.OnContinue(); /*FBNKT_KA_Anim.transform.Find("XH_judaiA").gameObject.SetActive(false);*/ //沟通本图卡隐藏 /* LS.OnPause(); */ //xiaohuaAnim.PlayForward("XH_D_1ST_BACK");//小华手收回 FBNKT_KA_AnimOper.OnContinue(); //5. 播放结束,提醒操作者点击话筒,点击后话筒旁边显示“你要吃XXX呀” SwapUI swapui = UIManager.Instance.GetUI <SwapUI>("SwapUI"); swapui.SetButtonVisiable(SwapUI.BtnName.microButton, true); swapui.SetButtonVisiable(SwapUI.BtnName.chooseButton, false); swapui.GetMicroBtn.gameObject.GetUIFlash().StartFlash(); swapui.speakEvent = () => { CancelInvoke("ClickPromptMicoUI"); ChooseDo.Instance.Clicked(); swapui.GetMicroBtn.gameObject.GetUIFlash().StopFlash(); swapui.speakEvent = null; swapui.SetButtonVisiable(SwapUI.BtnName.microButton, false); Dialog dialog = UIManager.Instance.GetUI <Dialog>("Dialog"); string gift = goodA.GetComponent <PropsObject>().pData.name_cn; dialog.SetDialogMessage("小华要" + gift + "呀"); //6. 显示2秒,结束后,提醒操作者点击教师的手,点击后触发教师给小华的动画。 Invoke("ClickTeachersHandSecond", 2f); }; ChooseDo.Instance.DoWhat(5, RedoClickMicoUI, null); } }; LegacyAnimationOper ka = ResManager.GetPrefab("Prefabs/AnimationKa/TY_LS_JTKJD_KA").GetLegacyAnimationOper();//跟随老师句带移动卡片 ka.name = "TY_LS_JTKJD_KA"; ka.transform.SetParent(transform); ka.transform.Find("LS_judai_1/ls_judai_1/ls_jd_tuka_1").gameObject.SetActive(false); //隐藏不需要图卡 Material matWy = ka.transform.Find("LS_judai_1/ls_judai_1/ls_jd_tuka_2").GetComponent <MeshRenderer>().materials[1]; //老师我要 Material matObj = ka.transform.Find("LS_judai_1/ls_judai_1/ls_jd_tuka_3").GetComponent <MeshRenderer>().materials[1]; //老师图卡物品 Material matSourceWy = emptyRoot.transform.Find("XH_D_2ND_FYFT_KA/XH_judaiA/XH_judaiA 1/tukaA/tukaA 1").GetComponent <MeshRenderer>().materials[1]; //小华我要图卡 Material matSourceObj = emptyRoot.transform.Find("XH_D_2ND_FYFT_KA/XH_judaiA/XH_judaiA 1/tukaB/tukaB 1").GetComponent <MeshRenderer>().materials[1]; //小华递卡物品。 matWy.CopyPropertiesFromMaterial(matSourceWy); matObj.CopyPropertiesFromMaterial(matSourceObj); //给物品 ka.transform.Find("tuka4").gameObject.SetActive(false); // ka.PlayForward("TY_LS_JTKJD_KA"); //播放老师图卡动画 图卡等待一帧隐藏 LS.PlayForward("TY_LS_JTKJD_JG"); } }