public override void Launch(EntityTargetable target, AttackerData attackerData, ProjectileData projectileData, Vector3 origin, Transform firingPoint)
        {
            GameEntry.Event.Fire(this, ShowEntityInLevelEventArgs.Create(
                                     attackerData.ProjectileEntityId,
                                     TypeUtility.GetEntityType(attackerData.ProjectileType),
                                     null,
                                     EntityDataProjectile.Create(target, projectileData, origin, firingPoint, firingPoint.position, firingPoint.rotation)));

            PlayParticles(fireParticleSystem, firingPoint.position, target.transform.position);
        }
        public static EntityDataProjectile Create(EntityTargetable entityTargetable, ProjectileData projectileData, Vector3 origin, Transform firingPoint, object userData = null)
        {
            EntityDataProjectile entityData = ReferencePool.Acquire <EntityDataProjectile>();

            entityData.EntityTargetable = entityTargetable;
            entityData.ProjectileData   = projectileData;
            entityData.Origin           = origin;
            entityData.FiringPoint      = firingPoint;
            entityData.UserData         = userData;
            return(entityData);
        }
示例#3
0
        protected override void OnShow(object userData)
        {
            base.OnShow(userData);

            entityDataProjectile = userData as EntityDataProjectile;

            if (entityDataProjectile == null)
            {
                Log.Error("Entity EntityProjectile '{0}' entity data invaild.", Id);
                return;
            }
        }
示例#4
0
        protected override void OnHide(bool isShutdown, object userData)
        {
            base.OnHide(isShutdown, userData);

            entityDataProjectile = null;
        }