Exemple #1
0
    public CellPosition SetPosition(int x, int y)
    {
        position.x = x;
        position.y = y;

        transform.position = position.ToVector3Int();

        return(position);
    }
Exemple #2
0
    public Entity Init(CellPosition pos, SpriteType spriteType = SpriteType.Nothing, Color?color = null, bool blocks = false, string name = "mysterious enemy")
    {
        this.position           = pos;
        this.transform.position = pos.ToVector3Int();
        this.sprite             = SpriteLoader.instance.LoadSprite(spriteType);
        this.color  = color ?? Color.magenta;
        this.blocks = blocks;
        this.name   = name;

        spriteRenderer.sprite = this.sprite;
        spriteRenderer.color  = this.color;

        return(this);
    }