Exemplo n.º 1
0
    public SceneObject_MissleInfo Clone()
    {
        SceneObject_MissleInfo newData = new SceneObject_MissleInfo();

        newData.Id                            = Id;
        newData.Attacker                      = Attacker;
        newData.SceneObjInfo                  = SceneObjInfo.Clone();
        newData.MissleHitEffectInfo           = MissleHitEffectInfo.Clone();
        newData.MissleEndEffectInfo           = MissleEndEffectInfo.Clone();
        newData.MoveStartPos                  = MoveStartPos;
        newData.MoveTargetPos                 = MoveTargetPos;
        newData.MoveVelocity                  = MoveVelocity;
        newData.MoveAccerelate                = MoveAccerelate;
        newData.MoveRotateVelocity            = MoveRotateVelocity;
        newData.MoveRotateDistance            = MoveRotateDistance;
        newData.MissleStartPositionOff        = MissleStartPositionOff;
        newData.MissleStartPositionRandomOff  = MissleStartPositionRandomOff;
        newData.MissleTargetPositionRandomOff = MissleTargetPositionRandomOff;

        newData.ImpactDuration = ImpactDuration;
        newData.ImpactInterval = ImpactInterval;

        newData.ImpactAttractDuration          = ImpactAttractDuration;
        newData.ImpactAttractRange             = ImpactAttractRange;
        newData.ImpactAttractOffPerSecond      = ImpactAttractOffPerSecond;
        newData.ImpactAttractOffMin            = ImpactAttractOffMin;
        newData.ImpactAttractingImpactInterval = ImpactAttractingImpactInterval;

        newData.ImpactInfos            = ImpactInfos.Clone();
        newData.ImpactEndInfos         = ImpactEndInfos.Clone();
        newData.ImpactEndFromRoleInfos = ImpactEndFromRoleInfos.Clone();
        newData.Target = Target;
        return(newData);
    }
Exemplo n.º 2
0
    /// param:Id[对应到SkillSceneObjManager中的Missle Id]
    /// example:1
    public void Trigger_SummonMissle(string param)
    {
#if SHOOTER_LOG
        Debug.Log("Trigger_SummonMissle param:" + param);
#endif
        if (m_SceneObjMgr != null)
        {
            SkillSceneObjInfo      sobjInfo   = new SkillSceneObjInfo(param);
            SceneObject_MissleInfo bulletInfo = m_SceneObjMgr.TryGetMissleInfo(sobjInfo.Id);
            IShooterSkill          curSkill   = TriggerImpl.GetCurSkill(this.gameObject);
            if (bulletInfo != null && bulletInfo.SceneObjInfo != null && curSkill != null)
            {
                bulletInfo          = bulletInfo.Clone();
                bulletInfo.Attacker = this.gameObject;
                bulletInfo.SceneObjInfo.EffectPos += this.gameObject.transform.position;
                bulletInfo.MoveStartPos           += this.gameObject.transform.position;
                bulletInfo.MoveTargetPos          += curSkill.GetTargetPos();
                bulletInfo.MoveVelocity            = this.gameObject.transform.rotation * bulletInfo.MoveVelocity;

                GameObject tBulletObj = TriggerImpl.PlayEffect(bulletInfo.SceneObjInfo);
                tBulletObj.SendMessage("Active", bulletInfo);
            }
            else
            {
                Debug.Log("Trigger_SummonMissle null!");
            }
        }
    }
Exemplo n.º 3
0
    public void Active(SceneObject_BaseInfo info)
    {
        m_BulletInfo = (SceneObject_MissleInfo)info;
        Quaternion missleRot = Quaternion.LookRotation(m_BulletInfo.MoveVelocity);

        m_BulletInfo.MoveStartPos += missleRot * (m_BulletInfo.MissleStartPositionOff
                                                  + GetRandomPosOff(m_BulletInfo.MissleStartPositionRandomOff));
        m_BulletInfo.MoveTargetPos += missleRot * GetRandomPosOff(m_BulletInfo.MissleTargetPositionRandomOff);

        gameObject.transform.position = m_BulletInfo.MoveStartPos;
        gameObject.transform.rotation = missleRot;
        StartMove();
    }
Exemplo n.º 4
0
    private void CreateMissleInternal(Vector3 targetPos)
    {
        if (m_SceneObjMgr == null)
        {
            Debug.Log("ShooterSkillLogic_ExShoot CreateMissle m_SceneObjMgr miss!");
            return;
        }

        SceneObject_MissleInfo bulletInfo = m_SceneObjMgr.TryGetMissleInfo(MissleId);

        if (bulletInfo != null && bulletInfo.SceneObjInfo != null)
        {
            bulletInfo          = bulletInfo.Clone();
            bulletInfo.Attacker = this.gameObject;
            bulletInfo.SceneObjInfo.EffectPos += targetPos;
            bulletInfo.MoveStartPos           += targetPos;
            bulletInfo.MoveTargetPos          += targetPos;

            GameObject tBulletObj = TriggerImpl.PlayEffect(bulletInfo.SceneObjInfo);
            tBulletObj.SendMessage("Active", bulletInfo);
        }
    }