Пример #1
0
    void XhTJudai()
    {
        ClickDispatcher.Inst.EnableClick = false;

        XH.timePointEvent = (b) =>
        {
            if (b > 184 && b < 189)
            {
                XH.timePointEvent = null;
                XH.OnPause();
                XhTakeCardCallback();
            }
        };
        //XH.Complete += XhTakeCardCallback;
        XH.PlayForward("XH_D_1ST_FBNKT");
        //
        gtb.framePointEvent = (b) =>
        {
            if (b > 175 && b < 180)
            {
                gtb.framePointEvent = null;
                gtb.OnPause();
            }
        };
        gtb.PlayForward("XH_D_1ST_FBNKT_KA");
    }
Пример #2
0
    void LsJieka()
    {
        CancelInvoke("ClickLsHandJiekaTip");
        HighLightCtrl.GetInstance().FlashOff(jshand);
        ClickDispatcher.Inst.EnableClick = false;
        LS.Complete += LsJiekaCallback;
        LS.PlayForward("TY_LS_JTKJD_JG");

        LS.timePointEvent = (a) =>//老师借卡时间点
        {
            if (a >= 19 && a <= 21)
            {
                //Debug.LogError("event");
                LS.timePointEvent = null;
                XH.OnContinue();                                                           //小华手收回
                transform.Find("XH_D_1ST_FBNKT_KA/XH_judaiA").gameObject.SetActive(false); //沟通本图卡隐藏
            }
        };

        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  = transform.Find("XH_D_1ST_FBNKT_KA/XH_judaiA/XH_judaiA 1/tukaB/tukaB1").GetComponent <MeshRenderer>().materials[1];  //小华我要图卡
        Material matSourceObj = transform.Find("XH_D_1ST_FBNKT_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");                       //播放老师图卡动画        图卡等待一帧隐藏
    }
Пример #3
0
    //点中辅导老师手后的回调
    /// <summary>
    ///辅导教师抓住小华的手翻开沟通本
    /// </summary>
    void XhTJudai()
    {
        ClickDispatcher.Inst.EnableClick = false;

        bool passxh = true;

        XH.timePointEvent = (b) =>
        {
            if (b > 184 && b < 189 && passxh)
            {
                passxh = false;
                XH.OnPause();
                XhTakeCardCallback();
            }
        };
        //XH.Complete += XhTakeCardCallback;
        XH.PlayForward("XH_D_1ST_FBNKT");
        //
        bool passgtb = true;

        gtb.framePointEvent = (b) =>
        {
            if (b > 175 && b < 180 && passgtb)
            {
                passgtb = false;
                gtb.OnPause();
            }
        };
        gtb.PlayForward("XH_D_1ST_FBNKT_KA");
    }
Пример #4
0
 //点中辅导老师手后的回调
 /// <summary>
 ///辅导教师抓住小华的手翻开沟通本
 /// </summary>
 void XhTJudai()
 {
     ClickDispatcher.Inst.EnableClick = false;
     XH.PlayForward("XH_D_1ST_FBNKGK");
     gtb.PlayForward("XH_D_1ST_FBNKT_GKA");
     //GTB.PlayForward("onePaper");
     XH.Complete += XhTakeCardCallback;
 }
Пример #5
0
    void OnXiaoHuaBring()
    {
        int  start  = 287;
        int  end    = 288;
        int  start1 = 465;
        int  end1   = 467;
        bool pass1  = false;
        bool pass2  = false;

        xiaohuaAnim.timePointEvent = (t) =>
        {
            if (t >= start && t <= end && !pass1)
            {
                pass1 = true;
                XHCtrl xhctrl = xiaohuaAnim.GetComponent <XHCtrl>();
                xhctrl.r_judai2.SetActive(true);
                xhctrl.r_judai2.transform.Find("XH_judai_2 1/jd_tuka_1").GetComponent <MeshRenderer>().enabled = false;
                xhctrl.r_judai2.transform.Find("XH_judai_2 1/jd_tuka_2").GetComponent <MeshRenderer>().materials[1].CopyPropertiesFromMaterial(judaiGobj.GetComponent <MeshRenderer>().materials[1]);
                xhctrl.r_judai2.transform.Find("XH_judai_2 1/jd_tuka_3").GetComponent <MeshRenderer>().materials[1].CopyPropertiesFromMaterial(tukaA.GetComponent <MeshRenderer>().materials[1]);

                FBNKT_KA_Anim.transform.Find("XH_judaiA").gameObject.SetActive(false);
            }

            if (t >= start1 && t <= end1 && !pass2)
            {
                pass2 = true;
                xiaohuaAnim.timePointEvent = null;
                xiaohuaAnim.OnPause();

                //2. 播放结束,提示操作者点击教师的手,播放教师接卡的动画。
                GameObject shou = PeopleManager.Instance.GetPeople("LS_BD").transform.Find("LSB_BD/shou").gameObject;
                Debug.Log("SpeakUpCtrlC.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("XH_D_3RD_ZGJD");
        FBNKT_KA_AnimOper = FBNKT_KA_Anim.GetLegacyAnimationOper();
        bool passA = false;

        FBNKT_KA_AnimOper.framePointEvent = (t) =>
        {
            if (t >= 165 && t <= 168 && !passA)
            {
                //显示沟通本第2页图卡
                passA = true;
                FBNKT_KA_AnimOper.framePointEvent = null;
                FBNKT_KA_Anim.transform.Find("XH_judaiA/XH_judaiA 1/tukaB").gameObject.SetActive(true);
            }
        };

        FBNKT_KA_AnimOper.PlayForward("XH_D_2ND_FYFT_KA");
    }
Пример #6
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");
    }
Пример #7
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");
    }
Пример #8
0
    void MMJieObj()
    {
        CancelInvoke("ClickMMhandTip");
        HighLightCtrl.GetInstance().FlashOff(mmHand);
        ClickDispatcher.Inst.EnableClick = false;

        GameObject ka = ResManager.GetPrefab("Prefabs/AnimationKa/MM_F_4TH_DBY_KA");

        ka.name = "MM_F_4TH_DBY_KA";
        ka.transform.SetParent(transform);

        Material matTar    = ka.transform.Find("judai/tuka1").GetComponent <MeshRenderer>().materials[1];
        Material matSource = SentenceExpressionModel.GetInstance().GetTuKa(PropsTag.judai_wokanjian.ToString()).GetComponent <MeshRenderer>().materials[1];

        matTar.CopyPropertiesFromMaterial(matSource);

        matTar    = ka.transform.Find("judai/tuka").GetComponent <MeshRenderer>().materials[1];
        matSource = SentenceExpressionModel.GetInstance().GetObj(index).GetComponent <MeshRenderer>().materials[1];
        matTar.CopyPropertiesFromMaterial(matSource);

        ka.transform.Find("Group/Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_L/Shoulder_L/ShoulderPart1_L/ShoulderPart2_L/Elbow_L/Wrist_L/judai3").gameObject.SetActive(false);
        ka.transform.Find("judai/tuka").localEulerAngles  = new Vector3(0, -90, 0);
        ka.transform.Find("judai/tuka1").localEulerAngles = new Vector3(0, -90, 0);

        LegacyAnimationOper lao = ka.GetLegacyAnimationOper();

        lao.PlayForward("MM_F_4TH_DBY_KA");

        bool pass  = true;
        bool pasxh = true;

        MM.timePointEvent = (a) =>
        {
            if (a >= 38 && a <= 40 && pasxh)
            {
                pasxh = false;
                XH.OnContinue();
                transform.Find("XH_F_4TH_FNN_KA").GetComponent <LegacyAnimationOper>().OnContinue();
                //transform.Find("XH_F_4TH_FNN_KA").gameObject.SetActive(false);
            }
            if (a >= 72 && a <= 75 && pass)
            {
                pass = false;
                MM.timePointEvent = null;
                MM.OnPause();
                lao.OnPause();
                DBYCallback();
            }
        };
        MM.PlayForward("MM_F_4TH_DBY");
        //Invoke("ClickmicroPhoneTip", 1);
    }
Пример #9
0
    void MMGiveObjCallback()
    {
        CancelInvoke("WyGiveClickMMHandTip");
        HighLightCtrl.GetInstance().FlashOff(mmHand);
        ClickDispatcher.Inst.EnableClick = false;

        transform.Find("MM_F_4TH_DBY_KA").gameObject.SetActive(false);
        UIManager.Instance.GetUI <Dialog>("Dialog").Show(false);

        GameObject ka = transform.Find("MM_F_4TH_DBY_KA").gameObject;

        if (ka != null)
        {
            Destroy(ka);
        }
        //MM.Complete += WYXHJiewu;
        GameObject KA = ResManager.GetPrefab("Prefabs/AnimationKa/MM_F_4TH_DY_KA");

        KA.name = "MM_F_4TH_DY_KA";
        KA.transform.SetParent(transform);
        LegacyAnimationOper lao = KA.GetLegacyAnimationOper();

        bool pass = true;

        MM.timePointEvent = (a) =>
        {
            if (a >= 58 && a <= 60 && pass)
            {
                pass = false;
                MM.timePointEvent = null;
                //MMCtrl ctrl = MM.GetComponent<MMCtrl>();
                int    index = Random.Range(101, 1001) % 4;
                string _name = SentenceExpressionModel.GetInstance().CurReinforcement.pData.name;
                //Debug.LogError(name);
                //GameObject go = Instantiate(SentenceExpressionModel.GetInstance().GetTuKa(name));
                //go.name = "QHW";
                //go.transform.SetParent(transform);
                //go.transform.localEulerAngles = Vector3.zero;
                //ctrl.SetJoint(go);
                XhQHW xhqhw = KA.GetComponent <XhQHW>();
                xhqhw.ShowObj(_name);

                WYXHJiewu();
            }
        };
        MM.transitionTime = 0;
        MM.PlayForward("MM_F_4TH_DY", 0.15f);
        MM.OnContinue();
        //MM.OnContinue();
        lao.PlayForward("MM_F_4TH_DY_KA", 0.15f);
    }
Пример #10
0
    void LsJieka()
    {
        CancelInvoke("ClickLsHandJiekaTip");
        HighLightCtrl.GetInstance().FlashOff(mmhand);
        ClickDispatcher.Inst.EnableClick = false;
        MM.OnContinue();
        MM.timePointEvent = (a) =>  //mama借卡时间点
        {
            if (a >= 41 && a <= 43) //给定一个帧区间范围
            {
                MM.timePointEvent = null;

                Transform fnnka = transform.Find("XH_E_3RD_FNN_KA");
                fnnka.transform.Find("Group1/Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_L/Shoulder_L/ShoulderPart1_L/ShoulderPart2_L/Elbow_L/Wrist_L/judai1").gameObject.SetActive(false);
                //沟通本图卡隐藏
                XHCtrl    xhctrl = XH.GetComponent <XHCtrl>();
                Transform xh_r1  = xhctrl.XH_R2.transform.parent.Find("XH_R1");
                fnnka.transform.SetParent(xh_r1);

                XH.PlayForward("XH_E_3RD_JG");
                XH.OnPause();
                //int stateHash = XH.anim.GetCurrentAnimatorStateInfo(0).tagHash;
                //float length = XH.anim.GetCurrentAnimatorStateInfo(0).length;
                //XH.anim.Play("XH_E_3RD_JG", 0, -length);
                //XH.PlayForward("idle");
                //XH.anim.speed = -1;
                //XH.PlayForward("XH_E_3RD_JG");//小华手收回
            }
        };
        MM.Complete += LsJiekaCallback;
        MM.PlayForward("MM_E_3RD_JG");

        LegacyAnimationOper ka = ResManager.GetPrefab("Prefabs/AnimationKa/MM_E_3RD_JG_KA").GetLegacyAnimationOper();

        ka.transform.SetParent(transform);
        ka.name = "MM_E_3RD_JG_KA";
        Transform tk9      = ka.transform.Find("Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_R/Shoulder_R/ShoulderPart1_R/ShoulderPart2_R/Elbow_R/Wrist_R/judai2/tuka9");
        Vector3   tk9Angle = tk9.localEulerAngles;

        tk9Angle.y           = -90.3f;
        tk9.localEulerAngles = tk9Angle;

        Material      matSource = ka.transform.Find("Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_R/Shoulder_R/ShoulderPart1_R/ShoulderPart2_R/Elbow_R/Wrist_R/judai2/tuka9").GetComponent <MeshRenderer>().materials[1];
        Reinforcement rfc       = AcceptQuestionModel.GetInstance().CurReinforcement;
        Material      matTar    = AcceptQuestionModel.GetInstance().GetTuKa("tuka_" + rfc.pData.name).GetComponent <MeshRenderer>().materials[1];

        matSource.CopyPropertiesFromMaterial(matTar);//更换图卡物体材质
        ka.PlayForward("MM_E_3RD_JG_KA");
    }
Пример #11
0
    //点中辅导老师手后的回调
    /// <summary>
    ///辅导教师抓住小华的手翻开沟通本
    /// </summary>
    void FdlsClickXhHand()
    {
        CancelInvoke("ClickFdlsHandTip");
        HighLightCtrl.GetInstance().FlashOff(fdlshand);
        ClickDispatcher.Inst.EnableClick = false;
        //FDLS.Complete += FdlsClickXhHandCalllback;
        //FDLS.PlayForward("FDLS_A_2ND_D");//TODO:教师动画播放时有位移
        FDLS.PlayForward("FDLS_B_1ST_FGTB");

        //Debug.LogError("FDLS_B_1ST_FGTB");

        bool pass = true;

        FDLS.timePointEvent = (a) =>
        {
            if (a > 35 && a <= 37 && pass)
            {
                pass = false;
                //
                bool passxh = true;
                XH.timePointEvent = (b) =>
                {
                    if (b > 184 && b < 189 && passxh)
                    {
                        passxh = false;
                        XH.OnPause();

                        XhTakeCardCallback();
                    }
                };
                //XH.Complete += XhTakeCardCallback;
                XH.PlayForward("XH_D_1ST_FBNKT");
                //
                bool passgtb = true;
                gtb.framePointEvent = (b) =>
                {
                    if (b > 175 && b < 180 && passgtb)
                    {
                        passgtb = false;
                        gtb.OnPause();
                    }
                };
                gtb.PlayForward("XH_D_1ST_FBNKT_KA");
            }
        };
    }
Пример #12
0
    void OnXiaoHuaBring()
    {
        GameObject xiaohuaGo = PeopleManager.Instance.GetPeople("XH_BD");

        xiaohuaAnim = xiaohuaGo.GetAnimatorOper();


        xiaohuaAnim.PlayForward("XH_D_1ST_FBNKT");

        GameObject fdlsObj2 = PeopleManager.Instance.GetPeople("FDLS_BD");

        fdlsAnim = fdlsObj2.GetAnimatorOper();
        fdlsAnim.PlayForward("FDLS_D_1ST_TJD", 0.343f);
        fdlsAnim.OnPause();

        FBNKT_KA_AnimOper = FBNKT_KA_Anim.GetLegacyAnimationOper();
        FBNKT_KA_AnimOper.PlayForward("XH_D_1ST_FBNKT_GKA");

        int  start = 100;
        int  end   = 102;
        bool passA = false;

        xiaohuaAnim.timePointEvent = (t) =>
        {
            if (t >= start && t <= end && !passA)
            {
                passA = true;
                xiaohuaAnim.timePointEvent = null;
                xiaohuaAnim.OnPause();
                FBNKT_KA_AnimOper.OnPause();

                //2. 播放结束,提醒操作者点击辅助教师的手,点击后触发辅助教师抓着小华的手把图卡粘在句带上的动画。
                GameObject fdlsObj = PeopleManager.Instance.GetPeople("FDLS_BD");
                GameObject shou    = fdlsObj.transform.Find("FDLS/fdls_shou").gameObject;
                HighLightCtrl.GetInstance().FlashOn(shou);
                shou.GetBoxCollider().size = new Vector3(1, 0.2f, 0.5f);
                GlobalEntity.GetInstance().AddListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickFDTeacherHandFirst);
                ClickDispatcher.Inst.EnableClick = true;
                ChooseDo.Instance.DoWhat(5, RedoClickFDTeachersHandFirst, null);
            }
        };
    }
Пример #13
0
    //点中辅导老师手后的回调
    /// <summary>
    ///辅导教师抓住小华的手翻开沟通本
    /// </summary>
    void XhTJudai()
    {
        ClickDispatcher.Inst.EnableClick = false;
        XH.PlayForward("XH_D_2ND_FYFT_DW");

        GameObject tkb = gtb.transform.Find("XH_judaiA/XH_judaiA 1/tukaB").gameObject;

        tkb.SetActive(false);

        gtb.framePointEvent = (a) =>
        {
            if (a >= 165 && a <= 167)
            {
                gtb.timePointEvent = null;
                tkb.SetActive(true);
            }
        };
        gtb.PlayForward("XH_D_2ND_FYFT_KA_DK");
        //GTB.PlayForward("onePaper");
        XH.Complete += XhTakeCardCallback;
    }
Пример #14
0
    public void Init()
    {
        if (swapUI == null)
        {
            swapUI             = UIManager.Instance.GetUI <SwapUI>("SwapUI");
            swapUI.speakEvent += SpeakBtnClickCallback;
            swapUI.SetButtonVisiable(SwapUI.BtnName.microButton, true);
            swapUI.SetButtonVisiable(SwapUI.BtnName.chooseButton, false);
        }

        PeopleManager.Instance.Reset();

        PeopleManager.Instance.GetPeople(PeopleTag.FDLS_BD).transform.localPosition = new Vector3(0, 0, 10000);
        PeopleManager.Instance.GetPeople(PeopleTag.LS_BD).transform.localPosition   = new Vector3(0, 0, 10000);

        XH = PeopleManager.Instance.GetPeople(PeopleTag.XH_BD).GetAnimatorOper();
        XH.PlayForward("XH_E_3RD_FNN");
        XH.OnPause();

        LegacyAnimationOper ka = ResManager.GetPrefab("Prefabs/AnimationKa/XH_E_3RD_FNN_KA").GetLegacyAnimationOper();

        ka.transform.SetParent(transform);
        ka.name = "XH_E_3RD_FNN_KA";
        ka.PlayForward("XH_E_3RD_FNN_KA");
        ka.OnPause();
        //XH.transform.localPosition = Vector3.zero;
        //XH.transform.localScale = Vector3.zero;

        MM      = ResManager.GetPrefab("Scenes/supermarket/MM").GetAnimatorOper();
        MM.name = "MM";
        MM.transform.SetParent(transform);
        MM.PlayForward("idle");

        HighLightCtrl.GetInstance().OffAllObjs();
        GetTukaObject();
    }
Пример #15
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");
        }
    }
Пример #16
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
    }
Пример #17
0
    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");
    }
Пример #18
0
    //public bool Finished;
    private void Start()
    {
        GlobalEntity.GetInstance().Dispatch <string>(CommonUI.pEvent.LevelChange, "第四关");

        Transform park = ResManager.GetPrefab("Scenes/park/park").transform;

        park.SetParent(transform);
        GameObject         cam = transform.Find("park(Clone)/Camera").gameObject;
        HighlightingEffect hf  = cam.GetComponent <HighlightingEffect>();

        if (hf == null)
        {
            hf = cam.gameObject.AddComponent <HighlightingEffect>();
            //hf.stencilZBufferDepth = 0;
            //hf.downsampleFactor = 1;
            //hf.iterations = 2;
        }

        if (swapUI == null)
        {
            swapUI = UIManager.Instance.GetUI <SwapUI>("SwapUI");
            //swapUI.chooseEvent += ChooseBtnClickCallback;
            swapUI.speakEvent += SpeakBtnClickCallback;
            swapUI.SetButtonVisiable(SwapUI.BtnName.microButton, false);
            swapUI.SetButtonVisiable(SwapUI.BtnName.chooseButton, false);
        }
        UIManager.Instance.GetUI <Dialog>("Dialog").SetPos(new Vector3(-55, -490, 0));
        MM = ResManager.GetPrefab("Scenes/park/MM").GetAnimatorOper();
        MM.transform.SetParent(park);

        PeopleManager.Instance.Reset();
        PeopleManager.Instance.GetPeople(PeopleTag.FDLS_BD).transform.localPosition = new Vector3(0, 0, 10000);
        PeopleManager.Instance.GetPeople(PeopleTag.LS_BD).transform.localPosition   = new Vector3(0, 0, 10000);
        XH = PeopleManager.Instance.GetPeople(PeopleTag.XH_BD).GetAnimatorOper();
        bool pass = true;

        XH.timePointEvent = (a) =>
        {
            if (a >= 1 && a <= 3 && pass)
            {
                pass = false;
                XH.timePointEvent = null;
                XH.OnPause();
            }
        };
        XH.PlayForward("XH_F_4TH_FNN");

        LegacyAnimationOper dog = ResManager.GetPrefab("Scenes/park/dog").GetLegacyAnimationOper();

        dog.transform.SetParent(park);
        dog.transform.localScale    = Vector3.one * 2;
        dog.transform.localPosition = new Vector3(-1.205f, 0, 0);
        dog.PlayForward("idle");
        dog.SetWrapMode = WrapMode.Loop;

        MM.PlayForward("idle");
        //XH.PlayForward("idle");
        //XH.PlayForward("XH_F_4TH_FNN");
        PropsObject   pObj = SentenceExpressionModel.GetInstance().GetObj(PropsType.neutralStimulator); //中性刺激物
        Reinforcement rfc  = new Reinforcement(pObj.pData);                                             //测试代码

        SentenceExpressionModel.GetInstance().CurReinforcement = rfc;                                   //设置强化物
        Debug.Log("GetTukaObject");

        XHTZka();
        //Invoke("XHTZka", 1);
    }
Пример #19
0
    /// <summary>
    /// 小华拿出我要字卡
    /// </summary>
    void WyXhZka()
    {
        GameObject k = transform.Find("MM_F_4TH_DBY_KA").gameObject;

        if (k != null)
        {
            Destroy(k);
        }

        MM.PlayForward("idle");
        UIManager.Instance.GetUI <Dialog>("Dialog").Show(false);

        List <int> indexList = new List <int> {
            0, 2, 3
        };
        int           index = SentenceExpressionModel.GetInstance().GetIndex(indexList);
        PropsObject   pObj  = SentenceExpressionModel.GetInstance().GetObj(index).GetComponent <PropsObject>(); //强化物
        Reinforcement rfc   = new Reinforcement(pObj.pData);                                                    //测试代码

        SentenceExpressionModel.GetInstance().CurReinforcement = rfc;                                           //设置强化物
        Debug.Log("GetTukaObject  " + rfc.pData.name);


        XH.transitionTime = 0;
        //XH.Complete += XHTZkaCallback;
        XH.PlayForward("XH_F_4TH_FNN");
        bool pass = true;

        XH.timePointEvent = (a) =>//
        {
            if (a > 613 && a < 617 && pass)
            {
                pass = false;
                XH.timePointEvent = null;
                XH.OnPause();

                WyXhZkaCallback();//mm高亮
            }
        };

        GameObject kaa = transform.Find("XH_F_4TH_FNN_KA").gameObject;

        if (kaa != null)
        {
            DestroyImmediate(kaa);
        }
        GameObject ka = ResManager.GetPrefab("Prefabs/AnimationKa/XH_F_4TH_FNN_KA");

        ka.name = "XH_F_4TH_FNN_KA";
        ka.transform.SetParent(transform);
        //ka.name = "XH_F_4TH_FNN_KA";
        //ka.transform.SetParent(transform);

        //我要
        Material matTar    = ka.transform.Find("Group1/Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_R/Shoulder_R/ShoulderPart1_R/ShoulderPart2_R/Elbow_R/Wrist_R/goutongben/goutongben_02/tuka5").GetComponent <MeshRenderer>().materials[1];
        Material matSource = SentenceExpressionModel.GetInstance().GetTuKa(PropsTag.judai_woyao.ToString()).GetComponent <MeshRenderer>().materials[1];

        matTar.CopyPropertiesFromMaterial(matSource);
        Transform tk10 = ka.transform.Find("Group1/Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_L/Shoulder_L/ShoulderPart1_L/ShoulderPart2_L/Elbow_L/Wrist_L/judai4/tuka10");

        tk10.localEulerAngles = new Vector3(0, -90, 0);
        matTar = tk10.GetComponent <MeshRenderer>().materials[1];
        matTar.CopyPropertiesFromMaterial(matSource);

        matTar    = ka.transform.Find("Group1/Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_R/Shoulder_R/ShoulderPart1_R/ShoulderPart2_R/Elbow_R/Wrist_R/goutongben/goutongben_03/tuka7").GetComponent <MeshRenderer>().materials[1];
        matSource = SentenceExpressionModel.GetInstance().GetTuKa("tuka_" + rfc.pData.name).GetComponent <MeshRenderer>().materials[1];
        matTar.CopyPropertiesFromMaterial(matSource);
        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/judai4/tuka9");

        tk9.localEulerAngles = new Vector3(0, -90, 0);
        matTar = tk9.GetComponent <MeshRenderer>().materials[1];
        matTar.CopyPropertiesFromMaterial(matSource);

        Transform tk8  = 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");
        Material  mat8 = tk8.GetComponent <MeshRenderer>().materials[1];

        mat8.CopyPropertiesFromMaterial(matSource);

        LegacyAnimationOper lao = ka.GetLegacyAnimationOper();
        bool kpass = true;

        lao.framePointEvent = (a) =>
        {
            if (a >= 613 && a <= 617 && kpass)
            {
                kpass = false;
                lao.framePointEvent = null;
                lao.OnPause();
            }
        };
        //Debug.LogError("ka");
        lao.PlayForward("XH_F_4TH_FNN_KA");
    }
Пример #20
0
    void MMGiveObj()//接卡给物
    {
        GameObject ka = ResManager.GetPrefab("Prefabs/AnimationKa/MM_F_4TH_DBY_KA");

        ka.name = "MM_F_4TH_DBY_KA";
        ka.transform.SetParent(transform);

        string name = SentenceExpressionModel.GetInstance().CurReinforcement.pData.name;

        //Debug.LogError(name);
        ka.transform.Find("judai/tuka1").localEulerAngles = new Vector3(0, -90, 0);
        Material matTar    = ka.transform.Find("judai/tuka1").GetComponent <MeshRenderer>().materials[1];
        Material matSource = SentenceExpressionModel.GetInstance().GetTuKa(PropsTag.judai_woyao.ToString()).GetComponent <MeshRenderer>().materials[1];

        matTar.CopyPropertiesFromMaterial(matSource);

        ka.transform.Find("judai/tuka").localEulerAngles = new Vector3(0, -90, 0);
        matTar    = ka.transform.Find("judai/tuka").GetComponent <MeshRenderer>().materials[1];
        matSource = SentenceExpressionModel.GetInstance().GetTuKa("tuka_" + name).GetComponent <MeshRenderer>().materials[1];
        matTar.CopyPropertiesFromMaterial(matSource);
        ka.transform.Find("Group/Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_L/Shoulder_L/ShoulderPart1_L/ShoulderPart2_L/Elbow_L/Wrist_L/judai3").gameObject.SetActive(false);

        ka.gameObject.SetActive(true);
        LegacyAnimationOper lao = ka.GetLegacyAnimationOper();

        bool passxh = true;
        bool passmm = true;
        bool pass   = true;

        MM.timePointEvent = (a) =>
        {
            if (a >= 38 && a <= 40 && passxh)
            {
                passxh = false;
                XH.OnContinue();
                Transform fnnka = transform.Find("XH_F_4TH_FNN_KA");
                fnnka.GetComponent <LegacyAnimationOper>().OnContinue();
                fnnka.gameObject.SetActive(false);
                fnnka.gameObject.SetActive(true);
                Transform xhr1 = XH.GetComponent <XHCtrl>().XH_R2.transform.parent.Find("XH_R1");
                fnnka.SetParent(xhr1);
                fnnka.transform.Find("Group1/Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_L/Shoulder_L/ShoulderPart1_L/ShoulderPart2_L/Elbow_L/Wrist_L").gameObject.SetActive(false);
                //transform.Find("XH_F_4TH_FNN_KA").gameObject.SetActive(false);
            }
            if (a >= 72 && a <= 75 && pass)
            {
                pass = false;
                MM.OnPause();
                lao.OnPause();
                //Debug.LogError("WYXhBYTip");
                WYXhBYTip();
            }
            if (a >= 160 && a <= 162 && passmm)
            {
                passmm            = false;
                MM.timePointEvent = null;
                MM.OnPause();
                //MMGiveObjCallback();
                WyGiveClickMMHandTip();
            }
        };
        MM.PlayForward("MM_F_4TH_DBY");
        lao.PlayForward("MM_F_4TH_DBY_KA");
    }
Пример #21
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");
        }
    }
Пример #22
0
    /// <summary>
    /// 小华贴字体动画
    /// </summary>
    void XHTZka()
    {
        GameObject ka = ResManager.GetPrefab("Prefabs/AnimationKa/XH_F_4TH_FNN_KA");

        ka.name = "XH_F_4TH_FNN_KA";
        ka.transform.SetParent(transform);
        //我看见
        Material matTar    = ka.transform.Find("Group1/Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_R/Shoulder_R/ShoulderPart1_R/ShoulderPart2_R/Elbow_R/Wrist_R/goutongben/goutongben_02/tuka5").GetComponent <MeshRenderer>().materials[1];
        Material matSource = SentenceExpressionModel.GetInstance().GetTuKa(PropsTag.judai_wokanjian.ToString()).GetComponent <MeshRenderer>().materials[1];

        matTar.CopyPropertiesFromMaterial(matSource);
        Transform tk10 = ka.transform.Find("Group1/Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_L/Shoulder_L/ShoulderPart1_L/ShoulderPart2_L/Elbow_L/Wrist_L/judai4/tuka10");

        Transform Wrist_L = ka.transform.Find("Group1/Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_L/Shoulder_L/ShoulderPart1_L/ShoulderPart2_L/Elbow_L/Wrist_L");//拿卡
        Material  matk6   = Wrist_L.Find("tuka6").GetComponent <MeshRenderer>().materials[1];

        matk6.CopyPropertiesFromMaterial(matSource);

        Material mattk4 = ka.transform.Find("Group1/Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_R/Shoulder_R/ShoulderPart1_R/ShoulderPart2_R/Elbow_R/Wrist_R/goutongben/goutongben_01/tuka4").GetComponent <MeshRenderer>().materials[1];

        mattk4.CopyPropertiesFromMaterial(matSource);


        tk10.localEulerAngles = new Vector3(0, -90, 0);
        matTar = tk10.GetComponent <MeshRenderer>().materials[1];
        matTar.CopyPropertiesFromMaterial(matSource);
        //实物
        index = Random.Range(101, 1001) % 3 + 25;
        Debug.Log(index);
        matTar    = ka.transform.Find("Group1/Main/DeformationSystem/Root_M/Spine1_M/Chest_M/Scapula_R/Shoulder_R/ShoulderPart1_R/ShoulderPart2_R/Elbow_R/Wrist_R/goutongben/goutongben_03/tuka7").GetComponent <MeshRenderer>().materials[1];
        matSource = SentenceExpressionModel.GetInstance().GetObj(index).GetComponent <MeshRenderer>().materials[1];
        matTar.CopyPropertiesFromMaterial(matSource);
        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/judai4/tuka9");

        tk9.localEulerAngles = new Vector3(0, -90, 0);
        matTar = tk9.GetComponent <MeshRenderer>().materials[1];
        matTar.CopyPropertiesFromMaterial(matSource);

        Transform tk8  = 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");
        Material  mat8 = tk8.GetComponent <MeshRenderer>().materials[1];

        mat8.CopyPropertiesFromMaterial(matSource);

        PropsObject   pObj = SentenceExpressionModel.GetInstance().GetObj(index).GetComponent <PropsObject>();
        Reinforcement rfc  = new Reinforcement(pObj.pData);           //测试代码

        SentenceExpressionModel.GetInstance().CurReinforcement = rfc; //设置强化物
        Debug.Log(rfc.pData.name_cn);

        XH.transitionTime = 0;
        //XH.Complete += XHTZkaCallback;
        XH.OnContinue();
        XH.timePointEvent = (a) =>//
        {
            if (a >= 615 && a <= 617)
            {
                XH.timePointEvent = null;
                XH.OnPause();
                //Debug.LogError("pause");
                XHTZkaCallback();//mm高亮
            }
        };

        LegacyAnimationOper lao = ka.GetLegacyAnimationOper();
        bool pass = true;

        lao.framePointEvent = (a) =>
        {
            if (a >= 615 && a <= 617 && pass)
            {
                lao.framePointEvent = null;
                pass = false;
                lao.OnPause();
            }
        };
        lao.PlayForward("XH_F_4TH_FNN_KA");
    }
Пример #23
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");
        }
    }
Пример #24
0
    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");
        }
    }