public bool IsColliding(Sprite2D a, Sprite2D b) { if (a.position.x < b.position.x + b.scale.x && a.position.x + a.scale.x > b.position.x && a.position.y < b.position.y + b.scale.y && a.position.y + a.scale.y > b.position.y) { return(true); } return(false); }
public Sprite2D(Vector2 position, Vector2 scale, string tag, Sprite2D reference) { this.tag = tag; this.position = position; this.scale = scale; Sprite = reference.Sprite; Debug.LogTechniq($"[SPRITE2D] {this.tag} - Has been loaded!"); Core.AddSprite(this); }
public static void RemoveSprite(Sprite2D sprite) { spriteList.Remove(sprite); }
public static void AddSprite(Sprite2D sprite) { spriteList.Add(sprite); }