Exemple #1
0
        protected override void OnEquip()
        {
            AttackFXManager manager = EntityEquipped.EntityProperties.GetAdditionalProperty <AttackFXManager>(Enumerations.AdditionalProperty.AttackFXSounds);

            //If the AttackFXManager is null, create it
            if (manager == null)
            {
                manager = new AttackFXManager();
                manager.Initialize(EntityEquipped);

                //Add it as a property to the BattleEntity
                EntityEquipped.EntityProperties.AddAdditionalProperty(Enumerations.AdditionalProperty.AttackFXSounds, manager);
            }

            //Add the sound
            manager.AddSound(SoundToPlay);
        }