//Function to check if this context option is disabled for string path public override bool IsDisabled(List <string> paths) { //Only allow one file to be selected if (paths.Count != 1) { return(true); } //If file is not asset, disable if (GitUtility.RepoPathToRelativeAssetPath(paths[0]) == null) { return(true); } return(false); }
//Function run when file context option is clicked public override void OnSelect(List <string> paths) { string assetPath = GitUtility.RepoPathToRelativeAssetPath(paths[0]); Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(assetPath); }