示例#1
0
文件: CBuild_UGUI.cs 项目: scris/_GS
    public static void ExportCurrentUI()
    {
        var UIName = Path.GetFileNameWithoutExtension(EditorApplication.currentScene);

        var uiRoot = GameObject.Find("UI");

        CBuildTools.BuildAssetBundle(uiRoot, GetBuildRelPath(UIName));
    }
示例#2
0
 public void ExportCurrentUI()
 {
     CreateTempPrefab();
     if (!CBuildTools.HookFunc(typeof(CBuild_UI), "Custom_ExportCurrentUI", this, UIScenePath, UIName, TempPanelObject))
     {
         CBuildTools.BuildAssetBundle(TempPanelObject, GetBuildRelPath(UIName));
     }
     DestroyTempPrefab();
 }
示例#3
0
    public void ExportCurrentUI()
    {
        CreateTempPrefab();

        if (ExportCurrentUIEvent != null)
        {
            ExportCurrentUIEvent(this, UIScenePath, UIName, TempPanelObject);
        }
        else
        {
            CBuildTools.BuildAssetBundle(TempPanelObject, GetBuildRelPath(UIName));
        }
        DestroyTempPrefab();
    }
示例#4
0
    public static uint BuildScriptableObject <T>(T scriptObject, string path, BuildTarget buildTarget) where T : ScriptableObject
    {
        const string tempAssetPath = "Assets/~Temp.asset";

        AssetDatabase.CreateAsset(scriptObject, tempAssetPath);
        T tempObj = (T)AssetDatabase.LoadAssetAtPath(tempAssetPath, typeof(T));

        if (tempObj == null)
        {
            throw new System.Exception();
        }

        uint crc = CBuildTools.BuildAssetBundle(tempObj, path, buildTarget);

        AssetDatabase.DeleteAsset(tempAssetPath);

        return(crc);
    }
示例#5
0
    public bool BuildPkg(string file)
    {
        //if (!CBuildTools.CheckNeedBuild(file))
        //{
        //    return false;
        //}

        AudioClip audioClip = AssetDatabase.LoadAssetAtPath(file, typeof(AudioClip)) as AudioClip;

        if (audioClip != null)
        {
            string subDirName = Path.GetFileName(Path.GetDirectoryName(file));
            string exportFile = string.Format("Audio/{0}/{1}_Audio{2}", subDirName, Path.GetFileNameWithoutExtension(file), CCosmosEngine.GetConfig("AssetBundleExt"));

            CBuildTools.BuildAssetBundle(audioClip, exportFile);

            //CBuildTools.MarkBuildVersion(file);
        }

        return(true);
    }