using
UnityEngine;
using
System.Collections;
using
UnityEditor;
public
class
MyPng :Editor {
[MenuItem(
"Assets/Auto Open"
)]
static
void
Run()
{
var obj = Selection.activeObject;
if
(obj !=
null
) {
if
(!
string
.IsNullOrEmpty (AssetDatabase.GetAssetPath (obj.GetInstanceID ()))) {
AssetDatabase.OpenAsset (obj);
}
}
}
[MenuItem(
"Assets/Auto Open2"
)]
static
void
Run1()
{
var obj = Selection.activeObject;
if
(obj !=
null
) {
if
(!
string
.IsNullOrEmpty (AssetDatabase.GetAssetPath (obj.GetInstanceID ()))) {
EditorApplication.ExecuteMenuItem (
"Assets/Open"
);
}
}
}
}