public static void RLCreateEffect(this EcsWorld world, Vector2 position, EffectPreset effectPreset) { var go = VExt.LayoutSpriteObject(ObjData.r_PrefabSprite, position, ObjData.t_GameObjectsOther, SortingLayer.Effect.ToString(), effectPreset.spriteSingle); var e = world.NewEntityWithGameObject(go); e.Set <EffectComponent>().Duration = effectPreset.duration; }
public NPCWeapon(WeaponItemObject weaponItem, WeaponBehaviour weaponBehaviour) { this.Behaviour = weaponBehaviour; this.Behaviour.Weapon = this; HitEffect = weaponItem.HitEffect; Damage = weaponItem.Damage; ProjectileSprite = weaponItem.ProjectileSprite; SpellPreset = weaponItem.SpellPreset; }