public void Init( TrailManager manager, int index, Vector2 position, Monocle.Image sprite, PlayerHair hair, Vector2 scale, Color color, float duration, int depth, bool frozenUpdate, bool useRawDeltaTime) { this.Tag = (int)Tags.Global; if (frozenUpdate) { this.Tag |= (int)Tags.FrozenUpdate; } this.Manager = manager; this.Index = index; this.Position = position; this.Sprite = sprite; this.SpriteScale = scale; this.Hair = hair; this.Color = color; this.Percent = 0.0f; this.Duration = duration; this.Depth = depth; this.Drawn = false; this.UseRawDeltaTime = useRawDeltaTime; }
public static void Add(Player player, Color color, float duration = 1f, bool frozenUpdate = false, bool useRawDeltaTime = false) { PlayerSprite playerSprite = player.Sprite; Monocle.Image sprite = (Monocle.Image)entity.Get <PlayerSprite>() ?? (Monocle.Image)entity.Get <Sprite>(); PlayerHair hair = entity.Get <PlayerHair>(); TrailManager.Add(entity.Position, sprite, hair, sprite.Scale, color, entity.Depth + 1, duration, frozenUpdate, useRawDeltaTime); }
public static TrailManager.Snapshot Add(Vector2 position, Monocle.Image sprite, PlayerHair hair, Vector2 scale, Color color, int depth, float duration = 1f, bool frozenUpdate = false, bool useRawDeltaTime = false) { TrailManager manager = Engine.Scene.Tracker.GetEntity <TrailManager>(); if (manager == null) { manager = new TrailManager(); Engine.Scene.Add((Entity)manager); } for (int index = 0; index < manager.snapshots.Length; ++index) { if (manager.snapshots[index] == null) { TrailManager.Snapshot snapshot = Engine.Pooler.Create <TrailManager.Snapshot>(); snapshot.Init(manager, index, position, sprite, hair, scale, color, duration, depth, frozenUpdate, useRawDeltaTime); manager.snapshots[index] = snapshot; manager.dirty = true; Engine.Scene.Add((Entity)snapshot); return(snapshot); } } return((TrailManager.Snapshot)null); }