Godot C#生成3D模型图标
【代码】Godot C#生成3D模型图标。
·
using Godot;
using System;
[Tool]
public partial class ImageSave : TextureRect
{
[ExportToolButton("导出图片")]
public Callable clickMeBtn => Callable.From(ComputeStat);
[Export] public string imageName { get; set; } = "icon";
[Export] int index = 1;
void ComputeStat()
{
var path = $"res://Assets/Icon/{imageName + index}.png";
GD.Print($"保存图片{path}");
var image = Texture.GetImage();
image.SavePng(path);
index++;
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
}
更多推荐
所有评论(0)