Last active
November 13, 2021 14:58
-
-
Save TakaakiIchijo/f752ee021c6593ef84fa84e25670c369 to your computer and use it in GitHub Desktop.
Unity EditorでHideFlagsつけたアセットをアンロックする右クリックメニュー拡張
This file contains hidden or 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 SomeClass | |
{ | |
[MenuItem("Assets/UnlockHideFlags")] | |
public static void UnlockHideFlags() | |
{ | |
var selected = Selection.objects[0]; | |
string targetPath = AssetDatabase.GetAssetPath(selected); | |
var asset = AssetDatabase.LoadAssetAtPath<Object>(targetPath); | |
EditorUtility.SetDirty(asset); | |
asset.hideFlags = HideFlags.None; | |
AssetDatabase.SaveAssets(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment