Exemplo n.º 1
0
    static void ExportAllResources()
    {
        ExportCommands cmd = new ExportCommands("Export all resources");

        UnityEngine.Object[] os = Resources.LoadAll("");
        foreach (var item in os)
        {
            try
            {
                if (item is GameObject)
                {
                    cmd.ExportResource(item as GameObject);
                }
                if (item is TextAsset)
                {
                    cmd.ExportTextAsset(item as TextAsset);
                }
                if (item is Texture2D)
                {
                    cmd.ExportTexture(item as Texture2D);
                }
                if (item is AudioClip)
                {
                    cmd.ExportAudio(item as AudioClip);
                }
                if (item is Material)
                {
                    cmd.ExportMaterial(item as Material);
                }
            }
            catch (Exception ex)
            {
                Debug.Log("Could not export " + item.name + ". " + ex.Message);
            }
        }
        Resources.UnloadUnusedAssets();
        EditorUtility.ClearProgressBar();
    }
Exemplo n.º 2
0
 static void ExportAllResources()
 {
     ExportCommands cmd = new ExportCommands("Export all resources");
     UnityEngine.Object[] os = Resources.LoadAll("");
     foreach (var item in os)
     {
         try
         {
             if (item is GameObject)
             {
                 cmd.ExportResource(item as GameObject);
             }
             if (item is TextAsset)
             {
                 cmd.ExportTextAsset(item as TextAsset);
             }
             if (item is Texture2D)
             {
                 cmd.ExportTexture(item as Texture2D);
             }
             if (item is AudioClip)
             {
                 cmd.ExportAudio(item as AudioClip);
             }
             if (item is Material)
             {
                 cmd.ExportMaterial(item as Material);
             }
         }
         catch (Exception ex)
         {
             Debug.Log("Could not export " + item.name + ". " + ex.Message);
         }
     }
     Resources.UnloadUnusedAssets();
     EditorUtility.ClearProgressBar();
 }
Exemplo n.º 3
0
    static void ExportTransform(MenuCommand command)
    {
        ExportCommands cmd = new ExportCommands("Export transform");

        cmd.ExportResource(((Transform)command.context).gameObject);
    }
Exemplo n.º 4
0
 static void ExportTransform(MenuCommand command)
 {
     ExportCommands cmd = new ExportCommands("Export transform");
     cmd.ExportResource(((Transform)command.context).gameObject);
 }