示例#1
0
文件: Fly.cs 项目: 741645596/batgame
    /// <summary>
    /// 生成水花特效
    /// </summary>
    void SpawnWaterEffect(Vector3 pos, WalkDir Dir, bool IsRotate = true)
    {
        Vector3 start = Vector3.zero;
        Vector3 end   = Vector3.zero;

        if (BattleEnvironmentM.GetDolphineLine(Dir, ref start, ref end) == false)
        {
            return;
        }
        Transform FlyNode       = BattleEnvironmentM.GetLifeMBornNode(false);
        Vector3   LeftPos       = Camera.main.ViewportToWorldPoint(new Vector3(0, 0, -Camera.main.transform.position.z - 10));
        Vector3   LeftRotation  = new Vector3(0, 0, -15);
        Vector3   RightRotation = new Vector3(0, 0, 15);
        Vector3   RightPos      = Camera.main.ViewportToWorldPoint(new Vector3(1, 0, -Camera.main.transform.position.z - 10));
        Vector3   effectPos     = Vector3.zero;

        if (Dir == WalkDir.WALKLEFT)
        {
            effectPos = LeftPos;
        }
        else
        {
            effectPos = RightPos;
        }
        if (m_flyOutDir == FlyDir.Bottom)
        {
            effectPos = pos;
            IsRotate  = false;
        }
        GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000791", effectPos, null);

        if (gae != null)
        {
            if (IsRotate)
            {
                if (Dir == WalkDir.WALKLEFT)
                {
                    gae.transform.Rotate(LeftRotation);
                }
                else
                {
                    gae.transform.Rotate(RightRotation);
                }
            }
            GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.5f);
            gae.AddAction(ndEffect);
        }
    }
示例#2
0
    public GridActionDophineFly(Life Parent, WalkDir Dir, float duration, float delay, Vector3 v3SpawnWater)
    {
        m_fDelay       = delay;
        m_v3SpawnWater = v3SpawnWater;
        if (Parent.m_Attr.AttrType == 100003 || Parent.m_Attr.AttrType == 101002)
        {
            m_bRotate = false;
        }
        start = Vector3.zero;
        Vector3 end = Vector3.zero;

        if (BattleEnvironmentM.GetDolphineLine(Dir, ref start, ref end) == false)
        {
            return;
        }
        if (v3SpawnWater != Vector3.zero)
        {
            start = v3SpawnWater;
        }
        //海豚顶特效 这里的Dir是炮弹兵被顶飞的方向
        dolphineDir = (Dir == WalkDir.WALKLEFT ? WalkDir.WALKRIGHT : WalkDir.WALKLEFT);
        if (Dir == WalkDir.WALKRIGHT)
        {
            m_effectName = "2000201_01";
        }
        else
        {
            m_effectName = "2000201_02";
        }

        SetTarget(Parent);
        m = Parent.m_thisT.gameObject.AddComponent <Missile>();
        m.m_bParticleRotate     = false; //分支
        Parent.m_thisT.rotation = Quaternion.identity;
        //保证左侧顶飞头部着地
        if (Dir == WalkDir.WALKLEFT)
        {
            Dir = WalkDir.WALKRIGHT;
        }
        SoundPlay.Play("drop_sea", false, false);
        base.SetData(start, end, RoleState.HITFLY, duration, -1, dolphineDir, 0);
        bezier = new Bezier(start, new Vector3(0, 25, 0), new Vector3(0, 25, 0), end);

        (Parent.MoveAI as Fly).m_FlyInfo.Reset();
    }