Last active
July 12, 2022 03:52
-
-
Save instance-id/53dddaba6bf80f9db0f5b8f85da708ef to your computer and use it in GitHub Desktop.
Unity GenerateAuthoringComponent error for Entities 0.51 helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using UnityEditor; | |
using UnityEngine; | |
namespace instance.id.Editors | |
{ | |
// --| Place this in an Editor folder and press Ctrl+Alt+R | |
// --| Will remove "GeneratedCode" folder and recompile | |
public static class RefreshGeneratedSource | |
{ | |
[MenuItem("Tools/RefreshGeneratedSource %&r")] | |
public static void resetGeneratedCode() | |
{ | |
var generatedCodePath = Path.Combine(Application.dataPath, "../", "Temp/GeneratedCode"); | |
var resolvedPath = Path.GetFullPath(generatedCodePath); | |
Debug.Log($"Removing: {resolvedPath}"); | |
if (Directory.Exists(resolvedPath)) | |
Directory.Delete(resolvedPath, true); | |
EditorUtility.RequestScriptReload(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment