예제 #1
0
    protected IEnumerator VectoryPhase()
    {
        iVectoryPhase = 0;

        sdMainChar mc = sdGameLevel.instance.mainChar;

        float BossDieTime = 1.0f;

        if (boss)
        {
            AnimationState die = boss.AnimController["death01"];
            if (die != null)
            {
                BossDieTime = die.length * 0.8f;
                sdUICharacter.Instance.LoadJiesuanWnd();
            }
            yield return(new WaitForSeconds(BossDieTime));
        }
        Time.timeScale = 1.0f;
        iVectoryPhase  = 1;

        Vector3 vRelVec = sdGameLevel.instance.cameraRelativeDistance;

        vRelVec.y = 0.0f;
        GameObject winArea = GameObject.Find("@WinArea");

        if (winArea != null)
        {
            mc.transform.position = winArea.transform.position;
        }
        mc.spinToTargetDirection(vRelVec.normalized, true);

        //Stop Pet
        sdActorInterface pet = sdGameLevel.instance.mainChar.Retainer;

        if (pet != null)
        {
            if (pet.IsActive() && pet.GetCurrentHP() > 0)
            {
                sdGameMonster m = (sdGameMonster)pet;
                m.useAI = false;

                Vector3 vmc   = mc.transform.position;
                Vector3 dir   = mc.GetDirection();
                Vector3 right = Vector3.Cross(new Vector3(0, 1, 0), dir);
                Vector3 pos   = vmc + right * 1.25f - dir * 0.5f;
                m.transform.position = pos;
                m.spinToTargetDirection(dir, true);
                m.DeactiveHPUI();
                AnimationState ani = m.AnimController["cheer01"];
                if (ani != null)
                {
                    ani.layer = 11;
                    //ani.wrapMode = WrapMode.;
                    m.AnimController.Play("cheer01", PlayMode.StopAll);
                }
            }
        }

        // preload effect prefab
        ResLoadParams param = new ResLoadParams();

        if ((int)mc.GetJob() == 1)
        {
            sdResourceMgr.Instance.LoadResource("Effect/MainChar/$Warrior/Fx_Warrior_Begin_Show_001.prefab", OnLoadEffect, param);
        }
        else if ((int)mc.GetJob() == 4)
        {
            sdResourceMgr.Instance.LoadResource("Effect/MainChar/$Mage/Fx_Mage_Begin_Show_001.prefab", OnLoadEffect, param);
            sdResourceMgr.Instance.LoadResource("Effect/MainChar/$Mage/Fx_Mage_Begin_Show_002.prefab", OnLoadEffect, param);
        }
        else if ((int)mc.GetJob() == 7)
        {
            sdResourceMgr.Instance.LoadResource("Effect/MainChar/$Ranger/ranger_begin_show.prefab", OnLoadEffect, param);
        }
        else if ((int)mc.GetJob() == 10)
        {
            sdResourceMgr.Instance.LoadResource("Effect/MainChar/$Priest/Fx_Priest_Begin_Show_001.prefab", OnLoadEffect, param);
            sdResourceMgr.Instance.LoadResource("Effect/MainChar/$Priest/Fx_Priest_Begin_Show_002.prefab", OnLoadEffect, param);
        }

        yield return(new WaitForSeconds(0.5f));         // load waiting time

        Animation      anim  = mc.AnimController;
        AnimationState state = anim["begin_show"];

        state.layer    = 11;
        state.wrapMode = WrapMode.Once;
        anim.Play("begin_show");
        //anim.CrossFadeQueued("idle01");
        float FinishWaitTime = 0.15f;

        if ((int)mc.GetJob() == 1)
        {
            sdActorInterface.AddHitEffect("Effect/MainChar/$Warrior/Fx_Warrior_Begin_Show_001.prefab", mc.transform, 3.0f, Vector3.zero, true);
        }
        else if ((int)mc.GetJob() == 4)
        {
            sdActorInterface.AddHitEffect("Effect/MainChar/$Mage/Fx_Mage_Begin_Show_001.prefab", mc.transform, 3.0f, Vector3.zero, true);
            mc.attachEffect("Effect/MainChar/$Mage/Fx_Mage_Begin_Show_002.prefab", "dummy_right_weapon_at", Vector3.zero, Quaternion.identity, 1.0f, 3.0f);
            FinishWaitTime = 0.3f;
        }
        else if ((int)mc.GetJob() == 7)
        {
            sdActorInterface.AddHitEffect("Effect/MainChar/$Ranger/ranger_begin_show.prefab", mc.transform, 3.0f, Vector3.zero, true);
        }
        else if ((int)mc.GetJob() == 10)
        {
            sdActorInterface.AddHitEffect("Effect/MainChar/$Priest/Fx_Priest_Begin_Show_001.prefab", mc.transform, 3.0f, Vector3.zero, true);
            mc.attachEffect("Effect/MainChar/$Priest/Fx_Priest_Begin_Show_002.prefab", "dummy_right_weapon_at", Vector3.zero, Quaternion.identity, 1.0f, 3.0f);
        }

        yield return(new WaitForSeconds(state.length));

        yield return(new WaitForSeconds(FinishWaitTime));        // finish waiting time

        if (sdUICharacter.Instance.GetBattleType() == (byte)HeaderProto.LEVEL_BATTLE_TYPE.LEVEL_BATTLE_TYPE_WORLD_BOSS)
        {
        }
        else
        {
            Debug.Log("ShowJiesuanWnd!");
            sdUICharacter.Instance.ShowJiesuanWnd();                    //< 显示结算窗口aa
        }
    }