public override void Load(IResourceCache cache, ResourcePath path) { if (!GameController.OnGodot) { return; } if (!cache.ContentFileExists(path)) { throw new FileNotFoundException("Content file does not exist for texture"); } if (!cache.TryGetDiskFilePath(path, out string diskPath)) { throw new InvalidOperationException("Textures can only be loaded from disk."); } var res = Godot.ResourceLoader.Load(diskPath); if (!(res is Godot.DynamicFontData fontData)) { throw new InvalidDataException("Path does not point to a font."); } FontData = fontData; }
public override void Dispose() { FontData.Dispose(); FontData = null; }