5.3 C
Seoul
Monday, February 24, 2020
Home Resources Code Unity Editor Script Snippets

Unity Editor Script Snippets

Collection of Unity Editor Script Snippets


Getting the path of the current source file

public class MyWindow : EditorWindow
{
    public string GetPath()
    {
        var scriptAsset = MonoScript.FromScriptableObject(this);
        var path = AssetDatabase.GetAssetPaths(scriptAsset);
        return path;
    }
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay connected

58FansLike
56FollowersFollow
156FollowersFollow
128FollowersFollow

Recipe of the day