Skip to content

Commit

Permalink
Merge pull request #152 from Tryibion/icon-json
Browse files Browse the repository at this point in the history
Add docs about custom icons for spawnable json proxy.
  • Loading branch information
mafiesto4 authored Aug 12, 2024
2 parents 6f0d03b + e97ec17 commit 410aa53
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions manual/scripting/tutorials/custom-asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,19 @@ public class MyEditorPlugin : EditorPlugin
}
}
```

Another simple way to add a custom icon to a **JsonAsset** without creating a new proxy is as follows.

```cs
public class MyEditorPlugin : EditorPlugin
{
public override void InitializeEditor()
{
base.InitializeEditor();
var atlas = Content.Load<SpriteAtlas>("Content/ExampleSpriteAtlas.flax");
var spriteHandle = new SpriteHandle(atlas, 0);
Editor.ContentDatabase.AddProxy(new SpawnableJsonAssetProxy<MySettings>(spriteHandle));
Editor.ContentDatabase.Rebuild(true);
}
}
```

0 comments on commit 410aa53

Please sign in to comment.