Ejemplo n.º 1
0
    void uploadOss(string name = null)
    {
        if (string.IsNullOrEmpty(selectedServer.ossCmd))
        {
            Debug.LogError("请先设置同步脚本!");
            return;
        }
        if (string.IsNullOrEmpty(name))
        {
            name = selectedPackageName;
        }
        string localDir = getUpgradePackagePath(name);
        string shell    = Path.Combine(Application.dataPath, ECLEditorUtl.getPathByObject(selectedServer.ossShell));
        string arg1     = Path.GetDirectoryName(shell);
        string arg2     = localDir.ToString();
        string argss    = shell + " " + arg1 + " " + arg2;

//		Debug.LogError (argss);
        System.Diagnostics.Process process = System.Diagnostics.Process.Start("/bin/bash", argss);
        //重新定向标准输入,输入,错误输出
//		process.StartInfo.RedirectStandardInput = true;
//		process.StartInfo.RedirectStandardOutput = true;
//		process.StartInfo.RedirectStandardError = true;
//
//		string ret = process.StandardOutput.ReadToEnd ();
//		Debug.Log (ret);
        Debug.LogWarning("Finished===" + name);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Get all textures from a material
    /// </summary>
    /// <returns>The textures from material.</returns>
    /// <param name="mat">Mat.</param>
    public static bool getTexturesFromMaterial(Material mat, ref ArrayList propNames, ref ArrayList texNames, ref ArrayList texPaths)
    {
        bool ret = false;

        if (mat == null)
        {
            Debug.LogWarning("The mat is null");
            return(ret);
        }
        Shader shader   = mat.shader;
        string propName = "";

        for (int i = 0; i < ShaderUtil.GetPropertyCount(shader); i++)
        {
            if (ShaderUtil.GetPropertyType(shader, i) == ShaderUtil.ShaderPropertyType.TexEnv)
            {
                propName = ShaderUtil.GetPropertyName(shader, i);
                Texture texture = mat.GetTexture(propName);
                if (texture != null)
                {
                    ret = ECLEditorUtl.moveAsset4Upgrade(texture) || ret ? true : false;
                    propNames.Add(propName);
                    texNames.Add(ECLEditorUtl.getAssetName4Upgrade(texture));
                    texPaths.Add(ECLEditorUtl.getPathByObject(texture));
                }
            }
        }
        return(ret);
    }
Ejemplo n.º 3
0
    public static void doSaveAsset(GameObject go)
    {
        CLPanelBase panel = go.GetComponent <CLPanelBase>();

        if (panel == null)
        {
            return;
        }
        Debug.Log(panel.name);
        if (panel.isNeedResetAtlase)
        {
            CLUIUtl.resetAtlasAndFont(panel.transform, true);
            PrefabUtility.SavePrefabAsset(go);
        }
        string dir = Application.dataPath + "/" + ECLEditorUtl.getPathByObject(go);

        dir = Path.GetDirectoryName(dir);
        ECLCreatAssetBundle4Update.createAssets4Upgrade(dir, panel.gameObject, true);

        // 必须再取一次,好像执行了上面一句方法后,cell就会变成null
        panel = go.GetComponent <CLPanelBase>();
        if (panel != null && panel.isNeedResetAtlase)
        {
            CLUIUtl.resetAtlasAndFont(panel.transform, false);
            PrefabUtility.SavePrefabAsset(go);
        }
    }
Ejemplo n.º 4
0
    string getMatName(Material mat)
    {
        string materialPath = ECLEditorUtl.getPathByObject(mat);

        materialPath = materialPath.Replace(CLPathCfg.self.basePath + "/upgradeRes4Dev/other/Materials/", "");
        materialPath = materialPath.Replace(".mat", "");
        materialPath = materialPath.Replace("/", ".");
        return(materialPath);
    }
Ejemplo n.º 5
0
    void uploadOss(string name = null)
    {
        if (string.IsNullOrEmpty(selectedServer.ossCmd))
        {
            Debug.LogError("请先设置同步脚本!");
            return;
        }
        if (string.IsNullOrEmpty(name))
        {
            name = selectedPackageName;
        }
        string localDir = getUpgradePackagePath(name);
        string shell    = Path.Combine(Application.dataPath, ECLEditorUtl.getPathByObject(selectedServer.ossShell));
        string arg1     = Path.GetDirectoryName(shell);
        string arg2     = localDir.ToString();

//		Debug.LogError (argss);
//		System.Diagnostics.Process process = System.Diagnostics.Process.Start ("/bin/bash", argss);
        //重新定向标准输入,输入,错误输出
//		process.StartInfo.RedirectStandardInput = true;
//		process.StartInfo.RedirectStandardOutput = true;
//		process.StartInfo.RedirectStandardError = true;
//
//		string ret = process.StandardOutput.ReadToEnd ();
//		Debug.Log (ret);

//		Debug.LogError (shell + " " + arg1 + " " + arg2);
        if ("MacOSX".Equals(SystemInfo.operatingSystemFamily.ToString()))
        {
            string argss = Path.Combine(Path.GetDirectoryName(shell), Path.GetFileNameWithoutExtension(shell)) + ".sh" + " " + arg1 + " " + arg2;
//			Debug.LogError (argss);
            System.Diagnostics.Process process = System.Diagnostics.Process.Start("/bin/bash", argss);
        }
        else
        {
            string batFile = Path.Combine(Path.GetDirectoryName(shell), Path.GetFileNameWithoutExtension(shell)) + ".bat";
            System.Diagnostics.Process.Start(batFile, arg1 + " " + arg2);
        }
        Debug.LogWarning("Finished===" + name);
    }
Ejemplo n.º 6
0
    public override void OnInspectorGUI()
    {
        instance = target as CLUIPlaySound;
        DrawDefaultInspector();

        if (instance != null)
        {
            init();
            NGUIEditorTools.BeginContents();
            {
                GUILayout.BeginHorizontal(); {
                    EditorGUILayout.LabelField("AudioClip", GUILayout.Width(100));
                    asset = EditorGUILayout.ObjectField(asset, typeof(UnityEngine.Object), GUILayout.Width(125));
                }
                GUILayout.EndHorizontal();
                string soundPath = ECLEditorUtl.getPathByObject(asset);
                instance.soundFileName = Path.GetFileName(soundPath);
                instance.soundName     = Path.GetFileNameWithoutExtension(soundPath);
                EditorUtility.SetDirty(instance);
            }
            NGUIEditorTools.EndContents();
        }
    }