Exemplo n.º 1
0
    public void Init()
    {
        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, true);
        }
        if (selectUI == null)
        {
            selectUI             = UIManager.Instance.GetUI <SelectionUI>("selectionUI");
            selectUI.okEvent    += SelectUIOkBtnCallback;
            selectUI.closeEvent += CloseSelectUICallback;
        }
        UIManager.Instance.GetUI <Dialog>("Dialog").SetPos();

        UIManager.Instance.SetUIDepthTop("selectionUI");

        PeopleManager.Instance.Reset();

        LS = PeopleManager.Instance.GetPeople(PeopleTag.LS_BD).GetAnimatorOper();
        XH = PeopleManager.Instance.GetPeople(PeopleTag.XH_BD).GetAnimatorOper();
        PeopleManager.Instance.GetPeople(PeopleTag.FDLS_BD).GetAnimatorOper().gameObject.SetActive(false);
        LS.PlayForward("idle");
        XH.PlayForward("idle");
        HighLightCtrl.GetInstance().OffAllObjs();
        GetTukaObject();
    }
Exemplo n.º 2
0
    public void Init()
    {
        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));
        PeopleManager.Instance.Reset();

        LS   = PeopleManager.Instance.GetPeople(PeopleTag.LS_BD).GetAnimatorOper();
        XH   = PeopleManager.Instance.GetPeople(PeopleTag.XH_BD).GetAnimatorOper();
        FDLS = PeopleManager.Instance.GetPeople(PeopleTag.FDLS_BD).GetAnimatorOper();
        FDLS.transform.localPosition = new Vector3(0, 0, 10000);
        LS.PlayForward("idle");
        XH.PlayForward("idle");

        //FDLS.PlayForward("idle");
        //FDLS.gameObject.SetActive(false);
        //FDLS.PlayForward("FDLS_A_2ND_D");
        HighLightCtrl.GetInstance().OffAllObjs();
        //KJLsGiveObj();
        //InitKanjian();
        GetTukaObject();
    }
Exemplo n.º 3
0
    void Start()
    {
        GlobalEntity.GetInstance().Dispatch <string>(CommonUI.pEvent.LevelChange, "第二关");
        InitGoodsState();
        teacherAnim = PeopleManager.Instance.GetPeople("LS_BD").GetAnimatorOper();
        teacherAnim.PlayForward("idle");

        //1. 进入界面后1秒,触发小华拿A卡递卡的动画。
        Invoke("OnXiaoHuaBringA", 1f);
    }
Exemplo n.º 4
0
    public static AnimationOper GetAnimatorOper(this GameObject go)
    {
        AnimationOper oper = go.GetComponent <AnimationOper>();

        if (oper == null)
        {
            oper = go.AddComponent <AnimationOper>();
        }
        return(oper);
    }
Exemplo n.º 5
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");
    }
Exemplo n.º 6
0
    void Start()
    {
        GlobalEntity.GetInstance().Dispatch <string>(CommonUI.pEvent.LevelChange, "第三关");
        GameObject qhwm = ObjectsManager.instanse.GetQHW();

        qhwm.transform.SetParent(emptyRoot.transform);
        qhwCtrl = qhwm.GetComponent <QHWCtrl>();

        //初始化沟通本
        PropsObject gtbProp = ObjectsManager.instanse.GetProps((int)PropsTag.TY_GTB);

        gtNotebook = GameObject.Instantiate(gtbProp.gameObject);
        gtNotebook.GetComponent <PropsObject>().pData = gtbProp.pData;
        gtNotebook.transform.SetParent(emptyRoot.transform, false);
        gtNotebook.transform.localPosition = new Vector3(2.2851f, 0.56572f, 0.3776f);
        onepage = gtNotebook.transform.Find("goutongben_02").gameObject;
        twopage = gtNotebook.transform.Find("goutongben_03").gameObject;

        List <PropsObject> rndReinforcements = new List <PropsObject>();

        DistinguishPictureModel.GetInstance().GetRndReinforcements(3, rndReinforcements);
        int i = 0;

        //初始化摆放强化物
        rndReinforcements.ForEach((ob) =>
        {
            GameObject qhw = CreateObj(ob, i);
            qhw.transform.localPosition = qhwPos[i++];
        });


        List <PropsObject> rndNegReinforcements = new List <PropsObject>();

        DistinguishPictureModel.GetInstance().GetRndNegReinforcements(2, rndNegReinforcements);
        i = 0;
        //初始化摆放负强化物
        rndNegReinforcements.ForEach((ob) =>
        {
            GameObject nqhw = CreateNegObj(ob, i);
            if (ob.name == "apple")
            {
                nqhwPos[i].y = 0.604f;
            }
            nqhw.transform.localPosition = nqhwPos[i++];
        });

        teacherAnim = PeopleManager.Instance.GetPeople("LS_BD").GetAnimatorOper();

        //1. 进入界面后1秒,触发小华翻开沟通本并拿出图卡,递给老师的动画。
        Invoke("OnXiaoHuaPassGouTongBenToTeacher", 1f);
    }
Exemplo n.º 7
0
    /// <summary>
    /// 初始化桌子上的涂卡
    /// </summary>
    void GetTukaObject()
    {
        if (GTB == null)
        {
            GameObject gtb = ResManager.GetPrefab("Prefabs/Objects/TY_GTB");
            gtb.name = "TY_GTB";
            gtb.transform.SetParent(transform);
            gtb.transform.localPosition = new Vector3(-2.67f, 0.5672f, -0.406f);
            GTB = gtb.AddComponent <AnimationOper>();
        }
        //Reinforcement rfc = EnhanceCommunityModel.GetInstance().CurReinforcement;
        //rfc = new Reinforcement(new PropsData("chips", 2, PropsType.reinforcement, "薯片"));//测试代码
        Reinforcement rfc = GlobalDataManager.GetInstance().CurReinforcement;

        EnhanceCommunityModel.GetInstance().CurReinforcement = rfc;
        if (rfc != null)
        {
            Debug.Log("GetTukaObject");

            int objId = rfc.pData.id;
            qhw = ObjectsManager.instanse.GetQHW();
            qhw.transform.SetParent(transform);
            string qhwName = ((PropsTag)objId).ToString();
            qhw.name = qhwName;
            QHWCtrl qhwCtrl = qhw.GetComponent <QHWCtrl>();
            qhwCtrl.ShowObj(qhwName);

            string   _tuka     = "tuka_" + ((PropsTag)objId).ToString();
            Material matSource = EnhanceCommunityModel.GetInstance().GetTuKa(_tuka).GetComponent <MeshRenderer>().materials[1]; //图卡材质
            deskTuka = ObjectsManager.instanse.GetdeskTuka();                                                                   //桌面图卡
            deskTuka.transform.SetParent(transform);
            deskTuka.name = _tuka;

            TukaCtrl tukaCtrl = deskTuka.GetComponent <TukaCtrl>();
            xhTk = tukaCtrl.ShowObj("XH_GTB_TUKA");
            Material matTar = xhTk.GetComponent <MeshRenderer>().materials[1];
            matTar.CopyPropertiesFromMaterial(matSource);
            xhTk.gameObject.SetActive(false);

            lsTk   = tukaCtrl.GetObj("LS_JZS_TUKA");
            matTar = lsTk.GetComponent <MeshRenderer>().materials[1];
            matTar.CopyPropertiesFromMaterial(matSource);

            Invoke("XhTakeCard", 1);
        }
        else
        {
            Tip();
        }
    }
Exemplo n.º 8
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");
    }
Exemplo n.º 9
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);
     }
     LS   = PeopleManager.Instance.GetPeople(PeopleTag.LS_BD).GetAnimatorOper();
     XH   = PeopleManager.Instance.GetPeople(PeopleTag.XH_BD).GetAnimatorOper();
     FDLS = PeopleManager.Instance.GetPeople(PeopleTag.FDLS_BD).GetAnimatorOper();
     LS.PlayForward("idle");
     XH.PlayForward("idle");
     //FDLS.PlayForward("idle");
     FDLS.gameObject.SetActive(false);
     HighLightCtrl.GetInstance().OffAllObjs();
     GetTukaObject();
 }
Exemplo n.º 10
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);
            }
        };
    }
Exemplo n.º 11
0
    /// <summary>
    /// 播放动画控制
    /// </summary>
    void PlayAnimation()
    {
        //工具箱隐藏
        gameObject.SetActive(false);

        //动画模型显示
        Transform aniPar = transform.parent.GetChild(1);

        for (int i = 0; i < aniPar.childCount; i++)
        {
            aniPar.GetChild(i).gameObject.SetActive(true);
        }

        //提示隐藏//708动画帧数
        int       point = 708;
        Transform aniTr = aniPar.transform.parent.Find("01");

        if (transform.parent.name == "BMoudle")
        {
            point = 578;
            aniTr = aniPar.transform.parent.Find("02");
            aniTr.Find("sw_swjj_H").gameObject.SetActive(false);
        }

        ani = aniTr.GetComponent <AnimationOper>();
        ani.timePointEvent = (a) =>
        {
            //Debug.Log(a + "---");
            if (a >= point - 1 && a <= point + 1 && !isPlay)
            {
                isPlay = true;
                ani.OnPause();
                CancelInvoke("PlayAgain");
                Invoke("PlayAgain", 1);
            }
        };
        ani.OnContinue();
        ani.PlayForward("Take 001");
    }
Exemplo n.º 12
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();
            }
        }
    }
Exemplo n.º 13
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();
    }
Exemplo n.º 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();

        LS   = PeopleManager.Instance.GetPeople(PeopleTag.LS_BD).GetAnimatorOper();
        XH   = PeopleManager.Instance.GetPeople(PeopleTag.XH_BD).GetAnimatorOper();
        FDLS = PeopleManager.Instance.GetPeople(PeopleTag.FDLS_BD).GetAnimatorOper();
        LS.PlayForward("idle");
        XH.PlayForward("idle");
        //FDLS.PlayForward("idle");
        FDLS.transform.localPosition = new Vector3(0, 0, 10000);

        ResetGuaDian();
        HighLightCtrl.GetInstance().OffAllObjs();
        GetTukaObject();
    }
Exemplo n.º 15
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");
        }
    }
Exemplo n.º 16
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);
    }
Exemplo n.º 17
0
    private void OnClickTeacherHandFirst(ClickedObj cobj)
    {
        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);

            //播放接图卡动画
            teacherAnim = PeopleManager.Instance.GetPeople("LS_BD").GetAnimatorOper();
            int  st     = 42;
            int  et     = 43;
            bool passA  = false;
            bool passA2 = false;
            bool passA3 = false;
            bool passA1 = false;
            bool passA4 = false;
            teacherAnim.timePointEvent = (tt) =>
            {
                if (tt >= 35 && tt <= 36 && !passA4)
                {
                    passA4 = true;
                    xiaohuaAnim.OnContinue();
                }
                if (tt >= st && tt <= et && !passA)
                {
                    passA = true;
                    xhctrl.r_tuka.SetActive(false);
                    lsCtrl.ls_tuka2.SetActive(true);
                }

                if (tt >= 81 && tt <= 83 && !passA2)
                {
                    passA2 = true;
                    //老师放下图卡A
                    xhctrl.r_tuka2.GetComponentInChildren <MeshRenderer>().materials[1].CopyPropertiesFromMaterial(qhwtks[2].GetComponentInChildren <MeshRenderer>().materials[1]);
                }

                if (tt >= 85 && tt <= 87 && !passA1)
                {
                    passA1 = true;
                    qhwtks[2].SetActive(true);
                    qhwtks[2].transform.SetParent(emptyRoot.transform);
                    qhwtks[2].transform.localPosition = new Vector3(2.502f, 0.5464f, 0.472f);
                    qhwtks[2].transform.localRotation = Quaternion.Euler(Vector3.zero);
                    qhwtks[2].transform.localScale    = Vector3.one;
                    lsCtrl.ls_tuka2.SetActive(false);
                }

                if (tt >= 96 && tt <= 98 && !passA3)
                {
                    passA3 = true;
                    //老师接图卡A动画结束
                    teacherAnim.timePointEvent = null;
                    teacherAnim.OnPause();

                    OnClickHuaTong();
                }
            };

            teacherAnim.PlayForward("TY_LS_JKDW");
        }
    }
Exemplo n.º 18
0
    private void OnClickTeacherHandFinalSec(ClickedObj cobj)
    {
        if (cobj.objname == "shou")
        {
            GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickTeacherHandFinalSec);
            ChooseDo.Instance.Clicked();
            CancelInvoke("ClickTeachersHandFinalSec");
            GlobalEntity.GetInstance().RemoveListener <ClickedObj>(ClickDispatcher.mEvent.DoClick, OnClickTeacherHandFinal);
            ClickDispatcher.Inst.EnableClick = false;

            GameObject shou = PeopleManager.Instance.GetPeople("LS_BD").transform.Find("LSB_BD/shou").gameObject;
            HighLightCtrl.GetInstance().FlashOff(shou);

            LS = PeopleManager.Instance.GetPeople(PeopleTag.LS_BD).GetAnimatorOper();

            bool passA = false;
            bool passB = false;

            LegacyAnimationOper go = null;
            LS.timePointEvent = (a) =>            //老师递给物品
            {
                if (a >= 25 && a <= 27 && !passA) //挂载到老师手上强化物时间点
                {
                    passA = true;
                    LSCtrl lsctrl = LS.GetComponent <LSCtrl>();//将当前强化物挂在老师手上
                    lsctrl.SetJoint(qhwCtrl.gameObject);
                }

                if (a >= 45 && a < 47 && !passB)//小华接卡动画播放延迟一边挂载强化物
                {
                    passB = true;
                    go    = ResManager.GetPrefab("Prefabs/AnimationKa/TY_XH_JG_KA").GetLegacyAnimationOper();
                    go.transform.SetParent(transform);

                    bool pass3 = false;
                    xiaohuaAnim.timePointEvent = (b) =>//小华接过物品 挂载强化物
                    {
                        if (b >= 42 && b <= 44 && !pass3)
                        {
                            pass3 = true;
                            xiaohuaAnim.timePointEvent = null;
                            qhwCtrl.gameObject.SetActive(false);
                            goodA.transform.parent.gameObject.SetActive(false);
                            XhQHW xhqhw = go.GetComponent <XhQHW>();
                            xhqhw.ShowObj(goodA.name);
                        }
                    };

                    xiaohuaAnim.ClearCompleteEvent();
                    xiaohuaAnim.Complete += () =>
                    {
                        //8. 播放结束,出现下一关和重做的按钮。
                        Debug.Log("SpeakUpCtrlA.OnClickTeacherHandFinal(): 8. 播放结束,出现下一关和重做的按钮。");
                        comUI = UIManager.Instance.GetUI <CommonUI>("CommonUI");
                        comUI.redoClickEvent += OnReDo;
                        comUI.nextClickEvent += OnNextDo;
                        comUI.ShowFinalUI();
                    };
                    xiaohuaAnim.PlayForward("TY_XH_JG");
                    go.PlayForward("TY_XH_JG_KA");
                }
            };
            LS.PlayForward("TY_LS_DW");
        }
    }
Exemplo n.º 19
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");
        }
    }
Exemplo n.º 20
0
    void OnXiaoHuaBring()
    {
        GameObject xiaohuaGo = PeopleManager.Instance.GetPeople("XH_BD");

        xiaohuaAnim = xiaohuaGo.GetAnimatorOper();

        FBNKT_KA_AnimOper = FBNKT_KA_Anim.GetLegacyAnimationOper();
        //FBNKT_KA_AnimOper.PlayForward("XH_D_2ND_FYFT_KA");

        int  start  = 180;
        int  end    = 182;
        bool passA  = false;
        bool passA1 = false;

        xiaohuaAnim.timePointEvent = (t) =>
        {
            if (t >= start && t <= end && !passA)
            {
                passA = 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);

                //2.播放结束,提示操作者点击教师的手,播放教师接卡的动画。
            }
            if (t >= 315 && t <= 317 && !passA1)
            {
                passA1 = true;
                xiaohuaAnim.OnPause();

                GameObject shou = PeopleManager.Instance.GetPeople("LS_BD").transform.Find("LSB_BD/shou").gameObject;
                Debug.Log("SpeakUpCtrlB.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_2ND_FYFT");

        FBNKT_KA_AnimOper = FBNKT_KA_Anim.GetLegacyAnimationOper();
        bool passB  = false;
        bool passB1 = false;

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

        FBNKT_KA_AnimOper.PlayForward("XH_D_2ND_FYFT_KA");
    }
Exemplo n.º 21
0
    private GameObject lsjudai; //老师句带
    void Start()
    {
        GlobalEntity.GetInstance().Dispatch <string>(CommonUI.pEvent.LevelChange, "第三关");
        GameObject xiaohuaGo = PeopleManager.Instance.GetPeople("XH_BD");

        GlobalDataManager.GetInstance().SetPcesCamera(Vector3.zero);

        Transform zhuozi2 = EnhanceCommunityModel.GetInstance().Jiaoshi().transform.Find("shinei/zhuozi2");

        zhuozi2Pos            = zhuozi2.transform.localPosition;
        zhuozi2.localPosition = new Vector3(0.0608f, 0, 0.036536f);

        if (xiaohuaGo.GetComponent <XHCtrl>() == null)
        {
            xiaohuaGo.AddComponent <XHCtrl>().InitComplete = () =>
            {
                xiaohuaGo.GetComponent <XHCtrl>().r_tuka.SetActive(false);
                xiaohuaGo.GetComponent <XHCtrl>().r_tuka2.SetActive(false);
                xiaohuaGo.GetComponent <XHCtrl>().r_judai.SetActive(false);
                xiaohuaGo.GetComponent <XHCtrl>().r_judai2.SetActive(false);
            };
        }

        //初始化老师位置和相机位置
        LS       = PeopleManager.Instance.GetPeople("LS_BD").GetAnimatorOper();
        lsOldPos = LS.transform.localPosition;
        LS.transform.localPosition = new Vector3(1.516f, 0.02f, 0.022f);
        emptyRoot = new GameObject("Root");

        GameObject qhwm = ObjectsManager.instanse.GetQHW();

        qhwm.transform.SetParent(emptyRoot.transform, false);
        qhwCtrl = qhwm.GetComponent <QHWCtrl>();
        qhwCtrl.transform.localPosition = new Vector3(1.508f, 0, 0);

        //生成我要句带
        GameObject judaiParent = new GameObject("judaiParent");

        judaiParent.transform.SetParent(emptyRoot.transform, false);
        judaiParent.transform.localPosition = new Vector3(10000f, 0.549f, -0.334f);
        judaiGobj = GameObject.Instantiate(ObjectsManager.instanse.propList[(int)PropsTag.judai_woyao].gameObject);
        judaiGobj.GetComponent <PropsObject>().pData = ObjectsManager.instanse.propList[(int)PropsTag.judai_woyao].pData;
        judaiGobj.transform.SetParent(judaiParent.transform, false);

        //随机一个强化物A
        goodA = SpeakUpModel.GetInstance().GetRndReinforcement();

        RndReinforcementA = qhwCtrl.GetObj(goodA.name);

        //强化物图卡A
        string tukaNameA = "tuka_" + goodA.name;

        tukaA = Instantiate(DistinguishPictureModel.GetInstance().GetTuKa(tukaNameA));
        GameObject _tukaA = new GameObject("tukaA");

        _tukaA.transform.SetParent(emptyRoot.transform, false);
        _tukaA.transform.localPosition = new Vector3(999f, 999f, 999f);
        tukaA.transform.SetParent(_tukaA.transform, false);
        tukaA.transform.localPosition = Vector3.zero;

        FBNKT_KA_Anim      = ResManager.GetPrefab("Prefabs/AnimationKa/XH_D_2ND_FYFT_KA");
        FBNKT_KA_Anim.name = "XH_D_2ND_FYFT_KA";
        FBNKT_KA_Anim.transform.SetParent(emptyRoot.transform, false);

        //我要图卡
        FBNKT_KA_Anim.transform.Find("XH_judaiA/XH_judaiA 1/tukaA/tukaA 1").GetComponent <MeshRenderer>().materials[1].CopyPropertiesFromMaterial(judaiGobj.GetComponent <MeshRenderer>().materials[1]);
        //强化物图卡
        FBNKT_KA_Anim.transform.Find("XH_judaiA/XH_judaiA 1/tukaB/tukaB 1").GetComponent <MeshRenderer>().materials[1].CopyPropertiesFromMaterial(tukaA.GetComponent <MeshRenderer>().materials[1]);
        FBNKT_KA_Anim.transform.Find("XH_judaiA/XH_judaiA 1/tukaB").gameObject.SetActive(false);
        PeopleManager.Instance.GetPeople("FDLS_BD").SetActive(false);

        GameObject deskTuka = ObjectsManager.instanse.GetdeskTuka();//桌面图卡

        deskTuka.transform.SetParent(transform);
        deskTuka.name = "DeskTuka";
        deskTuka.transform.localPosition = new Vector3(1.485f, 0.0014f, 0.082f);
        TukaCtrl tukaCtrl = deskTuka.GetComponent <TukaCtrl>();

        lsjudai = tukaCtrl.ShowObj("LS_judai");
        lsjudai.transform.Find("LS_judai 1/jd_tuka").gameObject.SetActive(false);
        lsjudai.transform.Find("LS_judai 1/jd_tuka2").GetComponentInChildren <MeshRenderer>().materials[1].CopyPropertiesFromMaterial(tukaA.GetComponent <MeshRenderer>().materials[1]);
        lsjudai.transform.Find("LS_judai 1/LS_TUKA").GetComponentInChildren <MeshRenderer>().materials[1].CopyPropertiesFromMaterial(judaiGobj.GetComponent <MeshRenderer>().materials[1]);
        lsjudai.SetActive(false);

        xiaohuaAnim = xiaohuaGo.GetAnimatorOper();
        xhCtrl      = xiaohuaAnim.GetComponent <XHCtrl>();
        //进入界面1秒后,触动小华翻开沟通本,并把字卡和图卡都粘在句带,并走到老师的面前的动画。
        Invoke("OnXiaoHuaBring", 1f);
    }