Exemplo n.º 1
0
    /// <summary>
    /// 初始化桌子上的涂卡
    /// </summary>
    void GetTukaObject()
    {
        PropsObject   pObj = SentenceExpressionModel.GetInstance().GetObj(PropsType.reinforcement); //中性刺激物
        Reinforcement rfc  = new Reinforcement(pObj.pData);                                         //测试代码

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

        gtb = ResManager.GetPrefab("Prefabs/AnimationKa/XH_D_1ST_FBNKT_KA").GetLegacyAnimationOper();         //沟通本
        gtb.transform.SetParent(transform);
        gtb.name = "XH_D_1ST_FBNKT_KA";                                                                       //沟通本更新

        gtbKJ      = ResManager.GetPrefab("Prefabs/AnimationKa/XH_D_3RD_FBNKTK_KA").GetLegacyAnimationOper(); //沟通本
        gtbKJ.name = PropsTag.TY_GTB.ToString();
        gtbKJ.transform.SetParent(transform);
        gtbKJ.name = "XH_D_3RD_FBNKTK_KA";//沟通本更新在日志
        gtbKJ.transform.Find("goutongben").gameObject.SetActive(false);
        //沟通本我要图卡
        Material matSource = SentenceExpressionModel.GetInstance().GetTuKa(PropsTag.judai_wokanjian.ToString()).GetComponent <MeshRenderer>().materials[1];
        Material matTar    = gtbKJ.transform.Find("XH_judaiA/XH_judaiA 1/tukaB/tukaB1").GetComponent <MeshRenderer>().materials[1];

        matTar.CopyPropertiesFromMaterial(matSource);
        //沟通本之中性刺激物图卡
        string _tuka = "tuka_" + rfc.pData.name;//沟通本里面图卡

        matSource = SentenceExpressionModel.GetInstance().GetTuKa(_tuka).GetComponent <MeshRenderer>().materials[1];
        matTar    = gtbKJ.transform.Find("XH_judaiA/XH_judaiA 1/tukaB/tukaB 1").GetComponent <MeshRenderer>().materials[1];
        matTar.CopyPropertiesFromMaterial(matSource);


        //沟通本我要图卡
        matSource = SentenceExpressionModel.GetInstance().GetTuKa(PropsTag.judai_woyao.ToString()).GetComponent <MeshRenderer>().materials[1];
        matTar    = gtb.transform.Find("XH_judaiA/XH_judaiA 1/tukaB/tukaB1").GetComponent <MeshRenderer>().materials[1];
        matTar.CopyPropertiesFromMaterial(matSource);

        //沟通本之中性刺激物图卡
        _tuka     = "tuka_" + rfc.pData.name;//沟通本里面图卡
        matSource = SentenceExpressionModel.GetInstance().GetTuKa(_tuka).GetComponent <MeshRenderer>().materials[1];
        matTar    = gtb.transform.Find("XH_judaiA/XH_judaiA 1/tukaB/tukaB 1").GetComponent <MeshRenderer>().materials[1];
        matTar.CopyPropertiesFromMaterial(matSource);

        //设置老师旁边的中性刺激物模型
        string     objName = rfc.pData.name;//
        GameObject obj     = ObjectsManager.instanse.GetQHW();

        obj.name = "QHW";
        obj.transform.SetParent(transform);
        qhwCtrl = obj.GetComponent <QHWCtrl>();
        qhwCtrl.ShowObj(objName);
        //qhwCtrl = obj.GetComponent<QHWCtrl>();
        //qhwCtrl.ShowObj(objName);

        //LS.Complete += ClickmicroPhoneTip;
        //LS.PlayForward("LS_E_1ST_ZB");

        XhTJudai();
    }
Exemplo n.º 2
0
    /// <summary>
    /// 初始化桌子上的涂卡
    /// </summary>
    void GetTukaObject()
    {
        //随机得到一个强化物
        PropsObject   pObj = AcceptQuestionModel.GetInstance().GetObj(PropsType.reinforcement); //强化物
        Reinforcement rfc  = new Reinforcement(pObj.pData);                                     //测试代码

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

        Transform objectsTr = new GameObject("objectsParent").transform;

        objectsTr.localPosition = Vector3.zero;
        objectsTr.localScale    = Vector3.one;
        objectsTr.rotation      = Quaternion.identity;
        objectsTr.SetParent(transform);

        //设置老师旁边的强化物模型
        string     objName = rfc.pData.name;//强化物
        GameObject obj     = ObjectsManager.instanse.GetQHW();

        obj.name = "QHW";
        obj.transform.SetParent(objectsTr, false);
        qhwCtrl = obj.GetComponent <QHWCtrl>();
        qhwCtrl.ShowObj(objName);

        //PropsObject curObj = obj.GetComponent<PropsObject>();
        //curObj.pData = pObj.pData;
        //curObj.setPos(new Vector3(2.5328F, 0.5698F, -0.118F));//TODO:每个物体的位置缩放,角度,有待调整
        //curObj.transform.localScale = Vector3.one;
        //Debug.Log(curObj.pData.name_cn + "    " + curObj.pData.name);

        gtb      = ResManager.GetPrefab("Prefabs/AnimationKa/XH_D_1ST_FBNKT_KA").GetLegacyAnimationOper(); //沟通本
        gtb.name = "XH_D_1ST_FBNKT_KA";
        gtb.transform.SetParent(transform);
        //gtb.transform.localPosition = new Vector3(-0.048f, 0, -0.373f);

        Transform tkPar = gtb.transform.Find("XH_judaiA/XH_judaiA 1/tukaB");

        string     _tuka    = "tuka_" + rfc.pData.name;//沟通本里面图卡
        GameObject tkSource = AcceptQuestionModel.GetInstance().GetTuKa(_tuka);

        //Debug.Log(tkSource);
        Material[] matsSour = tkSource.GetComponent <MeshRenderer>().materials;
        Transform  tkGtb    = tkPar.Find("tukaB 1");

        Material[] matsTar = tkGtb.GetComponent <MeshRenderer>().materials;
        matsTar[1].CopyPropertiesFromMaterial(matsSour[1]);
        //Debug.Log(_tuka);

        tkGtb    = tkPar.Find("tukaB1");
        matsTar  = tkGtb.GetComponent <MeshRenderer>().materials;
        matsSour = AcceptQuestionModel.GetInstance().GetObj((int)PropsTag.judai_woyao).GetComponent <MeshRenderer>().materials;
        matsTar[1].CopyPropertiesFromMaterial(matsSour[1]);

        ClickmicroPhoneTip();
    }
Exemplo n.º 3
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.º 4
0
    /// <summary>
    /// 初始化桌子上的涂卡
    /// </summary>
    void GetTukaObject()
    {
        PropsObject   pObj = AcceptQuestionModel.GetInstance().GetObj(PropsType.reinforcement); //随机强化物
        Reinforcement rfc  = new Reinforcement(pObj.pData);                                     //测试代码

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

        //Transform objectsTr = new GameObject("objectsParent").transform;
        //objectsTr.localPosition = Vector3.zero;
        //objectsTr.localScale = Vector3.one;
        //objectsTr.rotation = Quaternion.identity;
        //objectsTr.SetParent(transform);

        gtb      = ResManager.GetPrefab("Prefabs/AnimationKa/XH_D_2ND_FYFT_KA").GetLegacyAnimationOper(); //通用沟通本
        gtb.name = PropsTag.TY_GTB.ToString();
        gtb.transform.SetParent(transform);
        gtb.name = "XH_D_2ND_FYFT_KA";

        //沟通本我要图卡
        Material matSource = AcceptQuestionModel.GetInstance().GetTuKa(PropsTag.judai_woyao.ToString()).GetComponent <MeshRenderer>().materials[1];
        Material matTar    = gtb.transform.Find("XH_judaiA/XH_judaiA 1/tukaA/tukaA 1").GetComponent <MeshRenderer>().materials[1];

        matTar.CopyPropertiesFromMaterial(matSource);

        //沟通本强化物图卡
        string _tuka = "tuka_" + rfc.pData.name;//沟通本里面图卡

        matSource = AcceptQuestionModel.GetInstance().GetTuKa(_tuka).GetComponent <MeshRenderer>().materials[1];
        matTar    = gtb.transform.Find("XH_judaiA/XH_judaiA 1/tukaB/tukaB 1").GetComponent <MeshRenderer>().materials[1];
        matTar.CopyPropertiesFromMaterial(matSource);

        //设置老师旁边的强化物模型
        string     objName = rfc.pData.name;//强化物
        GameObject obj     = ObjectsManager.instanse.GetQHW();

        obj.name = "QHW";
        obj.transform.SetParent(transform, false);
        qhwCtrl = obj.GetComponent <QHWCtrl>();
        qhwCtrl.ShowObj(objName);

        ClickmicroPhoneTip();
    }
Exemplo n.º 5
0
    /// <summary>
    /// 看见模块初始化
    /// </summary>
    void InitKanjian()
    {
        PropsObject   pObj = SentenceExpressionModel.GetInstance().GetObj(PropsType.neutralStimulator); //中性刺激物
        Reinforcement rfc  = new Reinforcement(pObj.pData);                                             //测试代码

        SentenceExpressionModel.GetInstance().CurneutralStimulator = rfc;                               //设置强化物
        Debug.Log("中性刺激物  " + rfc.pData.name);

        string     objName = rfc.pData.name;//桌子上中兴刺激物
        GameObject obj     = Instantiate(SentenceExpressionModel.GetInstance().GetTuKa(objName));

        obj.name = "neutralStimulator";
        obj.transform.SetParent(transform, false);
        obj.transform.localPosition = new Vector3(2.453f, 0.578f, 0.798f);
        obj.transform.localScale    = Vector3.one * 0.6F;

        string   _tuka     = "tuka_" + rfc.pData.name;//沟通本里面图卡
        Material matSource = SentenceExpressionModel.GetInstance().GetTuKa(_tuka).GetComponent <MeshRenderer>().materials[1];
        Material matTar    = gtbKJ.transform.Find("XH_judaiA/XH_judaiA 1/tukaB/tukaB 1").GetComponent <MeshRenderer>().materials[1];

        matTar.CopyPropertiesFromMaterial(matSource);

        gtbKJ.transform.Find("goutongben").gameObject.SetActive(true);



        //设置老师旁边的中性刺激物模型
        pObj = SentenceExpressionModel.GetInstance().GetObj(PropsType.reinforcement); //强化物
        rfc  = new Reinforcement(pObj.pData);                                         //测试代码
        SentenceExpressionModel.GetInstance().CurReinforcement = rfc;                 //设置强化物
        objName = rfc.pData.name;                                                     //

        obj      = ObjectsManager.instanse.GetQHW();
        obj.name = "QHW";
        obj.transform.SetParent(transform);
        qhwCtrl = obj.GetComponent <QHWCtrl>();
        qhwCtrl.ShowObj(objName);

        ClickmicroPhoneTip();
    }
Exemplo n.º 6
0
    /// <summary>
    /// 初始化桌子上的涂卡
    /// </summary>
    void GetTukaObject()
    {
        Reinforcement rfc = SwapModel.GetInstance().CurReinforcement;

        //rfc = new Reinforcement(new PropsData("chips", 2, PropsType.reinforcement, "薯片"));//测试代码
        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 = SwapModel.GetInstance().GetTuKa(_tuka).GetComponent <MeshRenderer>().materials[1]; //图卡材质
            GameObject deskTuka  = ObjectsManager.instanse.GetdeskTuka();                                             //桌面图卡
            deskTuka.transform.SetParent(transform);
            deskTuka.name = _tuka;

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

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

            Invoke("XhTakeCard", 1);
        }
        else
        {
            Tip();
        }
    }
Exemplo n.º 7
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");
        }
    }
Exemplo n.º 8
0
    /// <summary>
    /// 初始化桌子上的涂卡
    /// </summary>
    void GetTukaObject()
    {
        PropsObject   pObj = SentenceExpressionModel.GetInstance().GetObj(PropsType.neutralStimulator); //中性刺激物
        Reinforcement rfc  = new Reinforcement(pObj.pData);                                             //测试代码

        SentenceExpressionModel.GetInstance().CurneutralStimulator = rfc;                               //设置强化物
        Debug.Log("中性刺激物  " + rfc.pData.name);

        string     objName = rfc.pData.name;//桌子上中兴刺激物
        GameObject obj     = Instantiate(SentenceExpressionModel.GetInstance().GetTuKa(objName));

        obj.name = "neutralStimulator";
        obj.transform.SetParent(transform, false);
        obj.transform.localPosition = new Vector3(2.453f, 0.578f, 0.867f);
        obj.transform.localScale    = Vector3.one * 0.6F;

        gtb      = ResManager.GetPrefab("Prefabs/AnimationKa/XH_D_1ST_FBNKT_KA").GetLegacyAnimationOper();
        gtb.name = PropsTag.TY_GTB.ToString();
        gtb.transform.SetParent(transform);
        gtb.name = "XH_D_1ST_FBNKT_KA";
        gtb.transform.SetParent(transform);

        //沟通本我看见图卡
        Material matSource = SentenceExpressionModel.GetInstance().GetTuKa(PropsTag.judai_wokanjian.ToString()).GetComponent <MeshRenderer>().materials[1];
        Material matTar    = gtb.transform.Find("XH_judaiA/XH_judaiA 1/tukaB/tukaB1").GetComponent <MeshRenderer>().materials[1];

        matTar.CopyPropertiesFromMaterial(matSource);

        //沟通本之中性刺激物图卡
        string _tuka = "tuka_" + rfc.pData.name;//沟通本里面图卡

        matSource = SentenceExpressionModel.GetInstance().GetTuKa(_tuka).GetComponent <MeshRenderer>().materials[1];
        matTar    = gtb.transform.Find("XH_judaiA/XH_judaiA 1/tukaB/tukaB 1").GetComponent <MeshRenderer>().materials[1];
        matTar.CopyPropertiesFromMaterial(matSource);

        //设置老师旁边的强化物模型

        pObj = SentenceExpressionModel.GetInstance().GetObj(PropsType.reinforcement); //强化物
        rfc  = new Reinforcement(pObj.pData);                                         //测试代码
        SentenceExpressionModel.GetInstance().CurReinforcement = rfc;                 //设置强化物
        objName = rfc.pData.name;                                                     //

        obj      = ObjectsManager.instanse.GetQHW();
        obj.name = "QHW";
        obj.transform.SetParent(transform);
        qhwCtrl = obj.GetComponent <QHWCtrl>();
        qhwCtrl.ShowObj(objName);
        //qhwCtrl = obj.GetComponent<QHWCtrl>();
        //qhwCtrl.ShowObj(objName);

        //LS.Complete += ClickmicroPhoneTip;
        //LS.PlayForward("LS_E_1ST_ZB");
        //
        bool passPoint = true;

        LS.timePointEvent = (a) =>
        {
            if (a >= 40 && a <= 45 && passPoint)//
            {
                passPoint = false;
                LS.OnPause();
                ClickmicroPhoneTip();
            }
        };
        LS.PlayForward("LS_F_1ST_ZCJW");
        //Debug.Log("ls");
    }