Exemple #1
0
    public static void CreateAsset()
    {
        ScaleformKey asset = CreateInstance <ScaleformKey>();

        string path = AssetDatabase.GetAssetPath(Selection.activeObject);

        if (path == "")
        {
            path = "Assets";
        }
        else if (Path.GetExtension(path) != "")
        {
            path = path.Replace(Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)), "");
        }

        string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/New Scaleform Key.asset");

        AssetDatabase.CreateAsset(asset, assetPathAndName);

        AssetDatabase.SaveAssets();
        EditorUtility.FocusProjectWindow();
        Selection.activeObject = asset;
    }
 private void OnEnable()
 {
     instance = target as ScaleformKey;
     key = serializedObject.FindProperty("Key");
 }
 private void OnEnable()
 {
     instance = target as ScaleformKey;
     key      = serializedObject.FindProperty("Key");
 }