Ejemplo n.º 1
0
    public void enableAttachment(string attachment)
    {
        var torch_sprite = GetNode <Sprite>("AttachmentSprite");

        switch (attachment?.ToLower())
        {
        case "true":
        case "":
            torch_sprite.Texture = GDKnyttAssetManager.loadInternalTexture("res://knytt/juni/Attach.png");
            torch_sprite.Visible = true;
            Powers.Attachment    = "true";
            break;

        case "false":
        case null:
            torch_sprite.Visible = false;
            Powers.Attachment    = "false";
            break;

        default:
            torch_sprite.Texture = Game.GDWorld.KWorld.getWorldTexture($"Custom Objects/{attachment}") as Texture;
            torch_sprite.Visible = torch_sprite.Texture != null;
            Powers.Attachment    = attachment;
            break;
        }
    }
Ejemplo n.º 2
0
 protected override object getSystemTexture(string filepath)
 {
     return((object)GDKnyttAssetManager.loadInternalTileset($"res://knytt/data/Compiled/{filepath}.res") ??
            GDKnyttAssetManager.loadInternalTexture("res://knytt/data/" + filepath));
 }
Ejemplo n.º 3
0
 protected override object getSystemTexture(string filepath)
 {
     return(GDKnyttAssetManager.loadInternalTexture("res://knytt/data/" + filepath));
 }