예제 #1
0
    void InitZNCM()
    {
        AudioAction.ExecuteScript("RemoveAudio,JieShuo.wav");
        AudioAction.ExecuteScript("PlayAudio,caimeiji.wav,0.3,0");
        AudioAction.ExecuteScript("PlayAudio,posuiji.wav,0.3,0");
        AudioAction.ExecuteScript("PlayAudio,biandianzhan.wav,0.3,0");

        m_Time = 0;
        IniMineWall();
        IniCutterBra();
        float[] sketor = new float[54];
        for (int i = 0; i < sketor.Length; i++)
        {
            sketor[i] = 0.5f;
        }
        ZhengScripts.InitilizeSketator(new Vector2(0, 53), sketor);
        ZhengScripts.InitilizeSketator(new Vector2(0, 17), new float[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.5f, 0.5f, 0.5f });
        ZhuAnimation.PlayAnimation(new Vector2(0, 17), 0.1f,
                                   new float[] { 0, 0, 0, 0, 0, 0, 0, 0, 0.05f, 0.1f, 0.15f, 0.2f, 0.25f, 0.3f, 0.35f, 0.4f, 0.45f, 0.5f }, ZhuAnimation.ZhuAnimationMode.Mode3);

        curStep = typeofStep.None;
        CMJGo.transform.position = CMJGoPos;//BanChildList[2].transform.position
        curIndex = 2;

        KeyFrameAnimation.SSLLJ = true;

        //斜切入刀
        CastTransfrom.singleton.InitilizeAnimation();
        if (Cutter2DAnimation.singleton.playing)
        {
            CastTransfrom.singleton.CutKnife();
            CastTransfrom.singleton.ToLeft();
        }
    }
예제 #2
0
    void CMJMove()
    {
        m_Time += Time.deltaTime;
        if (isFirst && m_Time >= 3f)
        {
            leftArmAni.CrossFade("LeftArm_DH", 0f);
            rightArmAim.CrossFade("RightArm_DH", 0f);
            isFirst = false;
            m_Time  = 0f;
            curStep = typeofStep.step1;

            Training.TrainingManager.ExecuteScript("SkipVRCamera,ZNCM_TZ");

            MovieAction.ExecuteScript("PLayMovie,ZJ_JK,JX_ZJCZ.ogg,0");
            MovieAction.ExecuteScript("PLayMovie,CMJ_JK,JX_CMJCZ.ogg,0");
            MovieAction.ExecuteScript("PLayMovie,JKZX_JK,JX_JKCZ.ogg,0");
            MovieAction.ExecuteScript("PLayMovie,ZJ_JK2,JX_ZJJK.ogg,0");
            MovieAction.ExecuteScript("PLayMovie,CMJ_JK2,JX_CMJJK.ogg,0");
            MovieAction.ExecuteScript("PLayMovie,JKZX_JK2,JX_JKJK.ogg,0");

            AudioAction.ExecuteScript("SetAudioState,caimeiji.wav,3.2:0:-53.3,90,0.3,0");
            AudioAction.ExecuteScript("SetAudioState,posuiji.wav,-46.77:0:-27.49,40,0.3,0");
            AudioAction.ExecuteScript("SetAudioState,caimeiji.wav,56.5:-0.88:9.11,50,0.3,0");

            if (Cutter2DAnimation.singleton != null)
            {
                Cutter2DAnimation.singleton.InitilizeAll(CMJGo.transform.Find("CMJ1/CMJ").gameObject);
            }
        }

        if (curStep == typeofStep.step1 && m_Time >= 4.2f) //第一次割煤
        {
            //yield return new WaitForSeconds(4.2f);
            if (curIndex <= 18)
            {
                distance = (CMJGo.transform.position - BanChildList[curIndex].transform.position).magnitude;
                CMJGo.transform.forward = BanChildList[curIndex].transform.position - BanChildList[curIndex - 1].transform.position;
                //Vector3 Dir = BanChildList[curIndex].transform.position - BanChildList[curIndex - 1].transform.position;
                //CMJGo.transform.forward = Vector3.Lerp(CMJGo.transform.forward, Dir, Time.deltaTime);
                CMJGo.transform.Translate(CMJGo.transform.forward * CMJSpeed * Time.deltaTime, Space.World);

                if (distance <= 0.4f)
                {
                    Cutter2D(curIndex);
                    curIndex++;
                    MyEventSystem.DispatchEvent("BeginMove", curIndex);
                }
            }
            else
            {
                CastTransfrom.singleton.LeftArmDown();
                CastTransfrom.singleton.RightArmUp();
                curStep = typeofStep.step2;
                m_Time  = 0f;
                //割三角煤
                ZhuAnimation.PlayAnimation(new Vector2(16, 0), 0.5f, new float[] { 0.5f }, ZhuAnimation.ZhuAnimationMode.Mode2);
                if (Cutter2DAnimation.singleton.playing)
                {
                    CastTransfrom.singleton.MiddleVisible(false);
                    CastTransfrom.singleton.HintVisible(false);
                    Cutter2DAnimation.singleton.StopCutter1SecondStageAnimation();
                    Cutter2DAnimation.singleton.StopCutter2SecondStageAnimation();
                }
                leftArmAni.CrossFade("LeftArm_DHR", 0f);
                rightArmAim.CrossFade("RightArm_DHR", 0f);

                if (Cutter2DAnimation.singleton.playing)
                {
                    CastTransfrom.singleton.CutTri();
                    CastTransfrom.singleton.ToRight();
                }
            }
        }
        else if (curStep == typeofStep.step2 && m_Time >= 4.2f) //第二次割煤--割三角煤
        {
            //yield return new WaitForSeconds(4.2f);

            if (curIndex >= 3)
            {
                distance = (CMJGo.transform.position - BanChildList[curIndex - 1].transform.position).magnitude;
                CMJGo.transform.Translate(-CMJGo.transform.forward * CMJSpeed * Time.deltaTime, Space.World);

                if (curIndex == 15)
                {
                    if (Cutter2DAnimation.singleton.playing)
                    {
                        Cutter2DAnimation.singleton.StartCutter2ThirdStageAnimation();
                    }
                }

                //Debug.Log(distance);
                if (distance <= 0.4f)
                {
                    SetGroup1Particle(curIndex + 5);
                    SetGroup2Particle(curIndex - 4);
                    curIndex--;
                    MyEventSystem.DispatchEvent("Step2", curIndex);
                }
            }
            else
            {
                CastTransfrom.singleton.LeftArmUp();
                CastTransfrom.singleton.RightArmDown();
                if (Cutter2DAnimation.singleton.playing)
                {
                    CastTransfrom.singleton.MiddleVisible(false);
                    CastTransfrom.singleton.HintVisible(false);
                    Cutter2DAnimation.singleton.StopCutter2ThirdStageAnimation();
                }
                //割底煤
                leftArmAni.CrossFade("LeftArm_DH", 0f);
                rightArmAim.CrossFade("RightArm_DH", 0f);

                if (Cutter2DAnimation.singleton.playing)
                {
                    CastTransfrom.singleton.ToLeft();
                    CastTransfrom.singleton.CutDown();
                }
                curStep = typeofStep.step3;
                m_Time  = 0f;
            }
        }
        else if (curStep == typeofStep.step3 && m_Time >= 4.2f)//第三次割煤--割底煤--中部跟机
        {
            //yield return new WaitForSeconds(4.2f);

            if (curIndex < BanChildList.Count - 1)
            {
                distance = (CMJGo.transform.position - BanChildList[curIndex].transform.position).magnitude;
                CMJGo.transform.Translate(CMJGo.transform.forward * CMJSpeed * Time.deltaTime, Space.World);

                //Debug.Log(distance);
                if (distance <= 0.4f)
                {
                    SetGroup1Particle(curIndex - 3);
                    SetGroup2Particle(curIndex - 3 + 9);

                    curIndex++;

                    //中部跟机
                    if (curIndex == 19)
                    {
                        //SetDT_YJQDTextContent("中部跟机");
                        if (Cutter2DAnimation.singleton.playing)
                        {
                            CastTransfrom.singleton.FollowMiddle();
                            Cutter2DAnimation.singleton.StartCutter1ThirdStageAnimation();
                        }
                    }
                    if (curIndex == 20)
                    {
                        ZhuAnimation.PlayAnimation(new Vector2(curIndex - 20, curIndex - 11), 0.1f,
                                                   new float[] { 1.0f, 0.95f, 0.9f, 0.85f, 0.8f, 0.75f, 0.7f, 0.65f, 0.6f, 0.55f }, ZhuAnimation.ZhuAnimationMode.Mode3);
                    }

                    if (curIndex > 20 && curIndex % 10 == 0)
                    {
                        ZhuAnimation.PlayAnimation(new Vector2(curIndex - 29, curIndex - 11), 0.1f,
                                                   new float[] { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.95f, 0.9f, 0.85f, 0.8f, 0.75f, 0.7f, 0.65f, 0.6f, 0.55f }, ZhuAnimation.ZhuAnimationMode.Mode3); //, 1.0f, 0.95f, 0.9f, 0.85f, 0.8f, 0.75f, 0.7f, 0.65f, 0.6f, 0.55f
                        //ZhuAnimation.PlayAnimation(new Vector2(curIndex - 20, curIndex - 11), 0.1f,
                        //    new float[] { 1.0f, 0.95f, 0.9f, 0.85f, 0.8f, 0.75f, 0.7f, 0.65f, 0.6f, 0.55f }, ZhuAnimation.ZhuAnimationMode.Mode3);
                    }

                    MyEventSystem.DispatchEvent("Step3", curIndex);
                }
            }
            else
            {
                CastTransfrom.singleton.LeftArmDown();
                leftArmAni.CrossFade("LeftArm_DHR", 0f);

                if (Cutter2DAnimation.singleton.playing)
                {
                    CastTransfrom.singleton.MiddleVisible(false);
                    CastTransfrom.singleton.HintVisible(false);
                    Cutter2DAnimation.singleton.StopCutter1ThirdStageAnimation();
                }
                if (Cutter2DAnimation.singleton.playing)
                {
                    CastTransfrom.singleton.CutDown();
                    CastTransfrom.singleton.ToRight();
                }
                curStep = typeofStep.step4;
                m_Time  = 0f;
            }
        }
        else if (curStep == typeofStep.step4 && m_Time >= 4.2f) //第四次割煤--割底煤
        {
            if (curIndex > 42)
            {
                distance = (CMJGo.transform.position - BanChildList[curIndex - 1].transform.position).magnitude;
                CMJGo.transform.Translate(-CMJGo.transform.forward * CMJSpeed * Time.deltaTime, Space.World);

                if (distance <= 0.4f)
                {
                    SetGroup1Particle(curIndex + 5);
                    SetGroup2Particle(curIndex - 4);

                    curIndex--;
                    MyEventSystem.DispatchEvent("Step4");
                }
            }
            else
            {
                if (Cutter2DAnimation.singleton.playing)
                {
                    CastTransfrom.singleton.MiddleVisible(false);
                    CastTransfrom.singleton.HintVisible(false);
                }
                curStep = typeofStep.step5;
                m_Time  = 0f;
            }
        }
        else if (curStep == typeofStep.step5 && m_Time >= 0.5f) //第五次割煤--回到待机位
        {
            //yield return new WaitForSeconds(0.5f);

            if (curIndex < BanChildList.Count - 1)
            {
                distance = (CMJGo.transform.position - BanChildList[curIndex].transform.position).magnitude;
                CMJGo.transform.Translate(CMJGo.transform.forward * CMJSpeed * Time.deltaTime, Space.World);


                //Debug.Log(distance);
                if (distance <= 0.4f)
                {
                    if (curIndex == 47)
                    {
                        ZhuAnimation.PlayAnimation(new Vector2(31, 45), 0.1f,
                                                   new float[] { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.95f, 0.9f, 0.85f, 0.8f, 0.75f, 0.7f, 0.65f, 0.6f, 0.55f }, ZhuAnimation.ZhuAnimationMode.Mode3);
                    }
                    SetGroup1Particle(curIndex - 3);
                    SetGroup2Particle(curIndex - 3 + 9);

                    curIndex++;
                    MyEventSystem.DispatchEvent("Step5", curIndex);
                }
            }
            else
            {
                m_Time = 0f;
                MyEventSystem.DispatchEvent("ZNCMrestart");
            }
        }
    }