newlon/scripts/resources/entities/EntityResource.cs
2025-07-29 04:08:05 +05:00

28 lines
875 B
C#

using Godot;
[Tool]
public partial class EntityResource : Resource
{
[Export] public string NameKey;
[Export] public string DescriptionKey;
[Export] public float Cost;
[Export] public PackedScene Scene;
[Export] public float ReloadTime;
[Export(PropertyHint.Range, "0,1,0.01")] public float ReloadProgress;
[Export] public Texture2D Preview;
[Export] public CustomSeedpacketFrame CustomFrame;
[Export] public int Order = 0;
public string parsedDescription;
public bool isDescriptionParsed;
private string internal_id = "";
public string GetInternalID()
{
if (internal_id == "")
{
string[] splitstr = ResourcePath.Split('/');
string file = splitstr[splitstr.Length - 1].ToLower();
internal_id = file.TrimSuffix(".tres");
}
return internal_id;
}
}