Esempio n. 1
0
        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));
        }
Esempio n. 2
0
 public static void HideEntity(this EntityComponent entityComponent, EntityViewLogic entity)
 {
     entityComponent.HideEntity(entity.Entity);
 }
Esempio n. 3
0
 public static void AttachEntity(this EntityComponent entityComponent, EntityViewLogic entity, int ownerId, string parentTransformPath = null, object userData = null)
 {
     entityComponent.AttachEntity(entity.Entity, ownerId, parentTransformPath, userData);
 }
Esempio n. 4
0
 protected virtual void OnDead(EntityViewLogic attacker)
 {
     GameEntry.Entity.HideEntity(this);
 }