Skip to content

Commit

Permalink
Update Cache on certain functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Melioli committed Aug 21, 2024
1 parent a3139fb commit 30a6250
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Editor/Manager/HoyoToonManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class HoyoToonManager
[MenuItem("Assets/HoyoToon/Full Setup", priority = 0)]
private static void FullSetup()
{
HoyoToonDataManager.GetHoyoToonData();
HoyoToonMaterialManager.GenerateMaterialsFromJson();
SetupFBX();
GameObject selectedObject = HoyoToonSceneManager.AddSelectedObjectToScene();
Expand All @@ -29,6 +30,7 @@ private static void SetupFBX()
[MenuItem("GameObject/HoyoToon/Mesh/Generate Tangents", priority = 21)]
private static void GenerateTangents()
{
HoyoToonDataManager.GetHoyoToonData();
GameObject selectedObject = Selection.activeGameObject;
if (selectedObject == null)
{
Expand Down
3 changes: 2 additions & 1 deletion Editor/Manager/Utilities/HoyoToonDataManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ private static void Initialize()

public static HoyoToonData Data => hoyoToonData;

private static HoyoToonData GetHoyoToonData()
public static HoyoToonData GetHoyoToonData()
{
try
{
using (HttpClient client = new HttpClient())
{
string json = client.GetStringAsync(url).Result;
CacheJson(json);
HoyoToonLogs.LogDebug("Successfully retrieved HoyoToon data from the server.");
return JsonConvert.DeserializeObject<HoyoToonData>(json);
}
}
Expand Down

0 comments on commit 30a6250

Please sign in to comment.