public static int?PlaySound(this SoundComponent soundComponent, int soundId, EntityViewLogic bindingEntity = null, object userData = null) { IDataTable <DRSound> dtSound = GameEntry.DataTable.GetDataTable <DRSound>(); DRSound drSound = dtSound.GetDataRow(soundId); if (drSound == null) { Log.Warning("Can not load sound '{0}' from data table.", soundId.ToString()); return(null); } PlaySoundParams playSoundParams = new PlaySoundParams { Priority = drSound.Priority, Loop = drSound.Loop, VolumeInSoundGroup = drSound.Volume, SpatialBlend = drSound.SpatialBlend, }; return(soundComponent.PlaySound(AssetUtility.GetSoundAsset(drSound.AssetName), "Sound", Constant.AssetPriority.SoundAsset, playSoundParams, bindingEntity != null ? bindingEntity.Entity : null, userData)); }
public static void HideEntity(this EntityComponent entityComponent, EntityViewLogic entity) { entityComponent.HideEntity(entity.Entity); }
public static void AttachEntity(this EntityComponent entityComponent, EntityViewLogic entity, int ownerId, string parentTransformPath = null, object userData = null) { entityComponent.AttachEntity(entity.Entity, ownerId, parentTransformPath, userData); }
protected virtual void OnDead(EntityViewLogic attacker) { GameEntry.Entity.HideEntity(this); }