Last active
April 7, 2023 23:02
-
-
Save Rovsau/9caf7201b301e10fbeb576ac2e50fa07 to your computer and use it in GitHub Desktop.
Make scripts delete themselves.
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
public class Voltorb | |
{ | |
// Uncomment at your own risk. | |
//[UnityEditor.InitializeOnLoadMethod] | |
private static void SelfDestruct([System.Runtime.CompilerServices.CallerFilePath] string path = "") | |
{ | |
path = System.IO.Path.GetRelativePath(System.IO.Directory.GetCurrentDirectory(), path); | |
//UnityEditor.AssetDatabase.DeleteAsset(path); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment