Ejemplo n.º 1
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!");
            }
        }
    }
Ejemplo n.º 2
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);
        }
    }