示例#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;
        }
    }
示例#2
0
 protected override object getSystemTexture(string filepath)
 {
     return((object)GDKnyttAssetManager.loadInternalTileset($"res://knytt/data/Compiled/{filepath}.res") ??
            GDKnyttAssetManager.loadInternalTexture("res://knytt/data/" + filepath));
 }
示例#3
0
 protected override object getSystemTexture(string filepath)
 {
     return(GDKnyttAssetManager.loadInternalTexture("res://knytt/data/" + filepath));
 }