예제 #1
0
    void OnXiaoHuaPassGouTongBenToTeacher()
    {
        //2. 播放结束,提醒操作者点击教师的手,点击后触发接图卡的动作。播放结束,提醒操作者点击话筒,点击后话筒旁边显示“你要XXX呀”
        GameObject xiaohuaGo = PeopleManager.Instance.GetPeople("XH_BD");

        xiaohuaAnim = xiaohuaGo.GetAnimatorOper();
        xhctrl      = xiaohuaGo.GetComponent <XHCtrl>();
        gtbAnim     = gtNotebook.GetAnimatorOper();
        xhctrl.r_tuka.GetComponentInChildren <MeshRenderer>().materials[1].CopyPropertiesFromMaterial(qhwtks[2].GetComponentInChildren <MeshRenderer>().materials[1]);
        lsCtrl = teacherAnim.GetComponent <LSCtrl>();
        lsCtrl.ls_tuka2.GetComponentInChildren <MeshRenderer>().materials[1].CopyPropertiesFromMaterial(qhwtks[2].GetComponentInChildren <MeshRenderer>().materials[1]);

        int  start  = 25;
        int  end    = 27;
        int  st     = 169;
        int  et     = 171;
        int  start0 = 198;
        int  end0   = 200;
        bool passA  = false;
        bool passB  = false;
        bool passC  = false;
        bool passD  = false;

        xiaohuaAnim.timePointEvent = (t) =>
        {
            if (t > 15 && t < 18 && !passD)
            {
                passD = false;
                FanGTB();
            }
            if (t >= start && t <= end && !passA)
            {
                passA = true;
                qhwtks[2].transform.localScale = Vector3.one * 0.6f;
            }

            if (t >= st && t <= et && !passB)
            {
                passB = true;
                xhctrl.r_tuka.SetActive(true);
                qhwtks[2].SetActive(false);
                qhwtks[2].transform.localPosition = new Vector3(-0.0726f, 0.00891f, -0.0313f);
            }

            if (t >= start0 && t <= end0 && !passC)
            {
                passC = true;
                xiaohuaAnim.timePointEvent = null;
                ProcessClickTeacherHandFirst();
            }
        };

        xiaohuaAnim.PlayForward("XH_C_3RD_FBFY");
    }
예제 #2
0
    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");
    }
예제 #3
0
    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);
    }
예제 #4
0
    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");
    }
예제 #5
0
 void ResetGuaDian()
 {
     if (XH != null)
     {
         XHCtrl xhctrl = XH.GetComponent <XHCtrl>();
         xhctrl.DestroyGuadian();
     }
     if (LS != null)
     {
         LSCtrl lsctrl = LS.GetComponent <LSCtrl>();
         lsctrl.DestroyGuadian();
     }
 }
예제 #6
0
    void Finish()
    {
        ChooseDo.Instance.ResetAll();
        UIManager.Instance.GetUI <CommonUI>("CommonUI").HideFinalUI();
        HighLightCtrl.GetInstance().OffAllObjs();

        if (XH != null)
        {
            XHCtrl xhctrl = XH.GetComponent <XHCtrl>();
            xhctrl.DestroyGuadian();
        }
        if (LS != null)
        {
            LSCtrl lsctrl = LS.GetComponent <LSCtrl>();
            lsctrl.DestroyGuadian();
        }
        RemoveAllListeners();
    }
예제 #7
0
    /// <summary>
    /// 播放小华拿B卡递卡动画
    /// </summary>
    void OnXiaoHuaBring()
    {
        GameObject xiaohuaGo = PeopleManager.Instance.GetPeople("XH_BD");

        xiaohuaAnim = xiaohuaGo.GetAnimatorOper();
        xhctrl      = xiaohuaGo.GetComponent <XHCtrl>();

        xhctrl.r_tuka2.GetComponentInChildren <MeshRenderer>().materials[1].CopyPropertiesFromMaterial(tukaB.GetComponentInChildren <MeshRenderer>().materials[1]);
        lsCtrl = teacherAnim.GetComponent <LSCtrl>();
        lsCtrl.ls_tuka2.GetComponentInChildren <MeshRenderer>().materials[1].CopyPropertiesFromMaterial(tukaB.GetComponentInChildren <MeshRenderer>().materials[1]);
        int  start  = 24;
        int  end    = 26;
        int  start0 = 44;
        int  end0   = 46;
        bool passA  = false;
        bool passB  = false;

        xiaohuaAnim.timePointEvent = (t) =>
        {
            if (t >= start && t <= end && !passA)
            {
                passA = true;
                xhctrl.r_tuka2.SetActive(true);
                tukaB.SetActive(false);

                tukaA.transform.parent.localPosition = new Vector3(2.277f, 0.5466f, 0.3855f);
            }

            if (t >= start0 && t <= end0 && !passB)
            {
                passB = true;
                xiaohuaAnim.timePointEvent = null;
                xiaohuaAnim.OnPause();
                GameObject shou = PeopleManager.Instance.GetPeople("LS_BD").transform.Find("LSB_BD/shou").gameObject;
                Debug.Log("DistinguishPictureCtrlA.OnXiaoHuaBring(): 2. 播放结束,提醒操作者点击教师的手,点击后触发接图卡的动作");
                HighLightCtrl.GetInstance().FlashOn(shou);
                shou.GetBoxCollider().size = new Vector3(1, 0.2f, 0.5f);
                GlobalEntity.GetInstance().AddListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickTeacherHandFirst);
                ClickDispatcher.Inst.EnableClick = true;
                ChooseDo.Instance.DoWhat(5, RedoClickTeachersHandFirst, null);
            }
        };
        xiaohuaAnim.PlayForward("TY_XH_NKDK");
    }
예제 #8
0
    /// <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();
            }
        }
    }
예제 #9
0
    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");
        }
    }
예제 #10
0
    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
    }
예제 #11
0
    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);
    }
예제 #12
0
    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");
        }
    }
예제 #13
0
    private void OnClickTeacherHandFirst(ClickedObj cobj)
    {
        Debug.Log("SpeakUpCtrlC.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();

            LSCtrl lsCtrl = LS.GetComponent <LSCtrl>();

            int  st    = 22;
            int  et    = 24;
            bool passA = false;
            bool passB = false;
            LS.timePointEvent = (a) =>//老师借卡时间点
            {
                if (a >= st && a < et && !passA)
                {
                    passA = true;
                    UnityEngine.Debug.Log("SpeakUpCtrlA::OnClickTeacherHandFinal(): 隐藏沟通本句带");

                    xiaohuaAnim.OnContinue();
                    xhCtrl.r_judai2.SetActive(false); /*                    LS.OnPause();  */                                                                                                                                  //xiaohuaAnim.PlayForward("XH_D_1ST_BACK");//小华手收回

                    Transform jd1 = lsCtrl.ls_judai.transform.Find("ls_judai_1");
                    jd1.Find("ls_jd_tuka_1").gameObject.SetActive(false);
                    jd1.Find("ls_jd_tuka_2").gameObject.SetActive(true);
                    jd1.Find("ls_jd_tuka_3").gameObject.SetActive(true);

                    jd1.Find("ls_jd_tuka_2").gameObject.GetComponent <MeshRenderer>().materials[1].CopyPropertiesFromMaterial(judaiGobj.GetComponent <MeshRenderer>().materials[1]);
                    jd1.Find("ls_jd_tuka_3").gameObject.GetComponent <MeshRenderer>().materials[1].CopyPropertiesFromMaterial(tukaA.GetComponent <MeshRenderer>().materials[1]);
                    lsCtrl.ls_judai.gameObject.SetActive(true);
                }

                if (a >= 35 && a <= 37 && !passB)
                {
                    passB             = true;
                    LS.timePointEvent = null;
                    lsCtrl.ls_judai.gameObject.SetActive(false);
                    lsjudai.SetActive(true);

                    //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);
                }
            };

            LS.OnContinue();
            LS.PlayForward("TY_LS_JTKJD_JG");
        }
    }
예제 #14
0
    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");
        }
    }