示例#1
0
 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);
 }
示例#2
0
        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);
        }
示例#3
0
 public static void RemoveSprite(Sprite2D sprite)
 {
     spriteList.Remove(sprite);
 }
示例#4
0
 public static void AddSprite(Sprite2D sprite)
 {
     spriteList.Add(sprite);
 }