Exemple #1
0
    public static string GetExportPath(BuildTarget platfrom)
    {
        string basePath = Path.GetFullPath(Application.dataPath + "/" + CCosmosEngine.GetConfig("AssetBundleRelPath") + "/");

        if (!Directory.Exists(basePath))
        {
            CBuildTools.ShowDialog("路径配置错误: " + basePath);
            throw new System.Exception("路径配置错误");
        }

        string path = null;

        switch (platfrom)
        {
        case BuildTarget.Android:
        case BuildTarget.iPhone:
        case BuildTarget.StandaloneWindows:
            path = basePath + CResourceManager.GetBuildPlatformName() + "/";
            break;

        default:
            CBuildTools.ShowDialog("构建平台配置错误");
            throw new System.Exception("构建平台配置错误");
        }
        return(path);
    }
Exemple #2
0
    /// <summary>
    /// Extra Flag ->   ex:  Android/  AndroidSD/  AndroidHD/
    /// </summary>
    /// <param name="platfrom"></param>
    /// <param name="quality"></param>
    /// <returns></returns>
    public static string GetExportPath(BuildTarget platfrom, CResourceQuality quality = CResourceQuality.Sd)
    {
        string basePath = Path.GetFullPath(Application.dataPath + "/" + CCosmosEngine.GetConfig(CCosmosEngineDefaultConfig.AssetBundleBuildRelPath) + "/");

        if (!Directory.Exists(basePath))
        {
            CBuildTools.ShowDialog("路径配置错误: " + basePath);
            throw new System.Exception("路径配置错误");
        }

        string path = null;

        switch (platfrom)
        {
        case BuildTarget.Android:
        case BuildTarget.iPhone:
        case BuildTarget.StandaloneWindows:
            var platformName = CResourceModule.BuildPlatformName;
            if (quality != CResourceQuality.Sd)      // SD no need add
            {
                platformName += quality.ToString().ToUpper();
            }

            path = basePath + platformName + "/";
            break;

        default:
            CBuildTools.ShowDialog("构建平台配置错误");
            throw new System.Exception("构建平台配置错误");
        }
        return(path);
    }
Exemple #3
0
 public static void ClearPlayerPrefs()
 {
     PlayerPrefs.DeleteAll();
     PlayerPrefs.Save();
     CBuildTools.ShowDialog("Prefs Cleared!");
 }
Exemple #4
0
    public bool CheckUI(bool showMsg)
    {
        PanelRoot    = GameObject.Find("UIRoot/PanelRoot").GetComponent <UIPanel>();
        AnchorObject = (GameObject)GameObject.Find("UIRoot/PanelRoot/Anchor");

        if (AnchorObject == null)
        {
            if (showMsg)
            {
                CBuildTools.ShowDialog("找不到UIRoot/PanelRoot/Anchor");
            }
            else
            {
                Debug.Log("找不到UIRoot/PanelRoot/Anchor");
            }
            return(false);
        }

        if (AnchorObject.transform.childCount != 1)
        {
            if (showMsg)
            {
                CBuildTools.ShowDialog("UI结构错误,Ahchor下应该只有一个节点");
            }
            else
            {
                Debug.Log("UI结构错误,Ahchor下应该只有一个节点");
            }
            return(false);
        }

        WindowObject = AnchorObject.transform.GetChild(0).gameObject;
        UIName       = EditorApplication.currentScene.Substring(EditorApplication.currentScene.LastIndexOf('/') + 1);
        UIName       = UIName.Substring(0, UIName.LastIndexOf('.'));

        // 確保Layer正確
        bool changeLayer = false;

        foreach (Transform loopTrans in GameObject.FindObjectsOfType <Transform>())
        {
            if (loopTrans.gameObject.layer != (int)CLayerDef.UI)
            {
                NGUITools.SetLayer(loopTrans.gameObject, (int)CLayerDef.UI);
                changeLayer = true;
            }
        }

        foreach (Camera cam in GameObject.FindObjectsOfType <Camera>())
        {
            NGUITools.SetLayer(cam.gameObject, (int)CLayerDef.UI);
            if (cam.cullingMask != 1 << (int)CLayerDef.UI)
            {
                cam.cullingMask = 1 << (int)CLayerDef.UI;
                changeLayer     = true;
            }
        }

        if (changeLayer)
        {
            EditorApplication.SaveScene();
        }



        return(true);
    }