示例#1
0
        private void CreateBullets(Vector3 beginPos, Vector3 dir)
        {
            SkillEventBullet skillEvtBullet = skillEvt as SkillEventBullet;
            float            speed          = skillEvtBullet.speed;

            CreateBullet(beginPos, dir, speed);
        }
示例#2
0
文件: Bullet.cs 项目: zhizhen/thewar
 public void Active(SkillEventBullet evt, Vector3 beginPos, Vector3 dir, float speed, float deltaTime = 0)
 {
     Debug.Log("bullet active");
     _state     = SKILL_OBJ_STATE.ACTIVE;
     _bulletEvt = evt;
     _beginPos  = beginPos;
     _beginDir  = dir;
     _speed     = speed;
     ActivePath(deltaTime);
 }
示例#3
0
        private void DoBullet()
        {
            SkillEventBullet skillEvtBullet = skillEvt as SkillEventBullet;
            EntityBase       caster         = EntityMgr.Instance.GetEntity(casterData.roleType, casterData.roleId);
            EntityBase       target         = null;
            Vector3          beginPos       = new Vector3();
            Vector3          beginDir       = new Vector3();
            Transform        firePoint      = null;

            //this.FindBulletBeginPos(caster, ref beginPos, ref beginDir, ref firePoint);
            //this.FindBulletBeginPos(caster, firePoint, ref beginPos, ref beginDir, ref target);
            //float range = SkillEventBullet.range;
            //this.FindBulletRange(caster, beginPos, ref range, ref target);
            //CreateBullets(beginPos, beginDir, range, target);
            beginPos = (Vector3)preData.preBeginPos;
            beginDir = (Vector3)this.preData.preBeginDir;
            CreateBullets(beginPos, beginDir);
        }
示例#4
0
        public static BaseSkillEvent InstanceEvent(SKILL_EVENT_TYPE eventType, SkillInfo info, BaseSkillEvent parent, int layer, int index)
        {
            BaseSkillEvent bse = null;

            switch (eventType)
            {
            case SKILL_EVENT_TYPE.动作:
                bse = new SkillEventAction();
                break;

            case SKILL_EVENT_TYPE.子弹:
                bse = new SkillEventBullet();
                break;
            }
            bse.skillInfo = info;
            bse.parent    = parent;
            bse.eventType = eventType;
            bse.layer     = layer;
            bse.GetParentChildrenEventList().Insert(index, bse);
#if UNITY_EDITOR
            bse.lastType = eventType;
#endif
            return(bse);
        }