コード例 #1
0
 // Token: 0x06002040 RID: 8256 RVA: 0x00099FCC File Offset: 0x000981CC
 public Projectile EmitProjectile(Ray ray, int projectileID, int cmid)
 {
     if (this._decorator && this._decorator.Missle)
     {
         Vector3    muzzlePosition = this._decorator.MuzzlePosition;
         Quaternion rotation       = Quaternion.LookRotation(ray.direction);
         Projectile projectile     = UnityEngine.Object.Instantiate(this._decorator.Missle, muzzlePosition, rotation) as Projectile;
         if (projectile)
         {
             if (projectile is GrenadeProjectile)
             {
                 GrenadeProjectile grenadeProjectile = projectile as GrenadeProjectile;
                 grenadeProjectile.Sticky = base.Config.Sticky;
             }
             projectile.transform.parent = ProjectileManager.Container.transform;
             projectile.gameObject.tag   = "Prop";
             projectile.ExplosionEffect  = this.ExplosionType;
             projectile.TimeOut          = this._decorator.MissileTimeOut;
             projectile.SetExplosionSound(this._decorator.ExplosionSound);
             projectile.transform.position = ray.origin + (float)this.MinProjectileDistance * ray.direction;
             if (base.Controller.IsLocal)
             {
                 projectile.gameObject.layer = 26;
             }
             else
             {
                 projectile.gameObject.layer = 24;
             }
             CharacterConfig characterConfig;
             if (GameState.Current != null && GameState.Current.TryGetPlayerAvatar(cmid, out characterConfig) && characterConfig.Avatar.Decorator && projectile.gameObject.activeSelf)
             {
                 foreach (CharacterHitArea characterHitArea in characterConfig.Avatar.Decorator.HitAreas)
                 {
                     if (characterHitArea.gameObject.activeInHierarchy)
                     {
                         Physics.IgnoreCollision(projectile.gameObject.collider, characterHitArea.collider);
                     }
                 }
             }
             projectile.MoveInDirection(ray.direction * WeaponConfigurationHelper.GetProjectileSpeed(this._view));
             return(projectile);
         }
     }
     return(null);
 }
コード例 #2
0
        public override void Launch(int posX, int posY, FInt velX, FInt velY)
        {
            var projectile = GrenadeProjectile.Create(this.character.room, this.projSubType, FVector.Create(posX, posY), FVector.Create(velX, velY));

            projectile.SetActorID(this.character);
        }