コード例 #1
0
ファイル: ExportSceneWizard.cs プロジェクト: mikecrews/FFWD
    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();
    }
コード例 #2
0
ファイル: ExportSceneWizard.cs プロジェクト: Joelone/FFWD
 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();
 }
コード例 #3
0
    static void ExportTransform(MenuCommand command)
    {
        ExportCommands cmd = new ExportCommands("Export transform");

        cmd.ExportResource(((Transform)command.context).gameObject);
    }
コード例 #4
0
ファイル: ExportSceneWizard.cs プロジェクト: Joelone/FFWD
 static void ExportTransform(MenuCommand command)
 {
     ExportCommands cmd = new ExportCommands("Export transform");
     cmd.ExportResource(((Transform)command.context).gameObject);
 }