Пример #1
0
    bool LoadGroup(int nProjectIndex, int nGroupIndex, string groupName)
    {
        if (m_nProjectCount <= nProjectIndex)
        {
            nProjectIndex = m_nProjectCount - 1;
        }
        m_nProjectIndex = nProjectIndex;

        // load Group
        if (0 <= m_nProjectIndex && m_nProjectIndex < m_nProjectCount)
        {
            string[] groupFolderStrings = NgAsset.GetFolderList(NgFile.CombinePath(FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.PROJECTS), m_ProjectFolerContents[m_nProjectIndex].text), null, null, FXMakerOption.inst.m_nMinBottomToolbarCount, out m_nGroupCount);
            m_GroupFolderContents = NgConvert.StringsToContents(groupFolderStrings);
            if (m_GroupFolderContents != null)
            {
                for (int n = 0; n < m_GroupFolderContents.Length; n++)
                {
                    if (groupName != "" && m_GroupFolderContents[n].text == groupName)
                    {
                        nGroupIndex = n;
                    }
                    if (m_GroupFolderContents[n].text == null)
                    {
                        m_GroupFolderContents[n].tooltip = FXMakerTooltip.GetHsToolEffect("EMPTYGROUP_HOVER", NgFile.CombinePath(FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.PROJECTS), m_ProjectFolerContents[m_nProjectIndex].text));
                    }
                    else
                    {
                        if (IsReadOnlyFolder(m_ProjectFolerContents[m_nProjectIndex].text) || IsReadOnlyFolder(m_GroupFolderContents[n].text))
                        {
                            m_GroupFolderContents[n].tooltip = FXMakerTooltip.GetHsToolEffect("GROUP_HOVER", NgFile.CombinePath(FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.PROJECTS), m_ProjectFolerContents[m_nProjectIndex].text, m_GroupFolderContents[n].text) + "\n" + FXMakerTooltip.GetHsToolMessage("FOLDER_READONLY", ""));
                        }
                        else
                        {
                            m_GroupFolderContents[n].tooltip = FXMakerTooltip.GetHsToolEffect("GROUP_HOVER", NgFile.CombinePath(FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.PROJECTS), m_ProjectFolerContents[m_nProjectIndex].text, m_GroupFolderContents[n].text));
                        }
                    }
                }
            }

            SetGroupIndex(nGroupIndex);
            LoadEffectFolder("");
            return(true);
        }
        else
        {
            m_nGroupCount = 0;
            SetGroupIndex(-1);
            return(false);
        }
    }
Пример #2
0
    void BuildContents()
    {
        CancelInvoke("BuildContents");
        if (enabled == false)
        {
            return;
        }

        int nNotLoadPreviewCount = 0;

        for (int n = 0; n < m_nEffectCount; n++)
        {
            if (m_EffectContents[n] == null)
            {
                string subDir = AssetDatabase.GetAssetPath(m_EffectPrefabs[n]);
                subDir = NgFile.PathSeparatorNormalize(subDir).Replace(m_LoadDirectory, "");

                m_EffectContents[n]         = new GUIContent();
                m_EffectContents[n].text    = m_EffectPrefabs[n].name;
                m_EffectContents[n].tooltip = FXMakerTooltip.GetHsToolEffect("EFFECT_HOVER", subDir);
            }
            if (m_EffectContents[n].image == null)
            {
                m_EffectContents[n].image = FXMakerMain.inst.GetPrefabThumbTexture(m_EffectPrefabs[n]);
            }
            if (m_EffectContents[n].image == null)
            {
                nNotLoadPreviewCount++;
            }
        }
//		Debug.Log("BuildContents - " + nNotLoadPreviewCount);
        if (0 < nNotLoadPreviewCount)
        {
            Invoke("BuildContents", FXMakerLayout.m_fReloadPreviewTime);
        }
    }
Пример #3
0
    public void LoadProject(string defaultEffectPath)
    {
//      Debug.Log(defaultEffectPath);
        NgUtil.LogDevelop("LoadProject - FXMakerMain");

        // clear current
        FXMakerMain.inst.ClearCurrentEffectObject(m_CurrentEffectRoot, true);

        // load Project
        string[] projectFolerStrings = NgAsset.GetFolderList(FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.PROJECTS), null, null, FXMakerOption.inst.m_nMinTopToolbarCount, out m_nProjectCount);
        m_ProjectFolerContents = NgConvert.StringsToContents(projectFolerStrings);
        for (int n = 0; n < m_ProjectFolerContents.Length; n++)
        {
            if (m_ProjectFolerContents[n].text == null)
            {
                m_ProjectFolerContents[n].tooltip = FXMakerTooltip.GetHsToolEffect("EMPTYPROJECT_HOVER", FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.PROJECTS));
            }
            else
            {
                if (IsReadOnlyFolder(m_ProjectFolerContents[n].text))
                {
                    m_ProjectFolerContents[n].tooltip = FXMakerTooltip.GetHsToolEffect("PROJECT_HOVER", NgFile.CombinePath(FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.PROJECTS), m_ProjectFolerContents[n].text) + "\n" + FXMakerTooltip.GetHsToolMessage("FOLDER_READONLY", ""));
                }
                else
                {
                    m_ProjectFolerContents[n].tooltip = FXMakerTooltip.GetHsToolEffect("PROJECT_HOVER", NgFile.CombinePath(FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.PROJECTS), m_ProjectFolerContents[n].text));
                }
            }
        }

        int nProjectIndex = -1;
        int nGroupIndex   = 0;
        int nEffectIndex  = 0;

        // 捞傈 急琶沥焊 贸府
        if (FXMakerLayout.m_bDevelopPrefs == false)
        {
            nProjectIndex   = UnityEditor.EditorPrefs.GetInt("FXMakerEffect.m_nProjectIndex", nProjectIndex);
            nGroupIndex     = UnityEditor.EditorPrefs.GetInt("FXMakerEffect.m_nGroupIndex", nGroupIndex);
            nEffectIndex    = UnityEditor.EditorPrefs.GetInt("FXMakerEffect.m_nEffectIndex", nEffectIndex);
            m_nScrollColumn = UnityEditor.EditorPrefs.GetInt("FXMakerEffect.m_nScrollColumn", m_nScrollColumn);
        }

        // defaultEffectPath
        if (defaultEffectPath != null && defaultEffectPath != "")
        {
            string projectPath = defaultEffectPath.Replace(FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.PROJECTS), "");
            string projectName = NgFile.GetSplit(projectPath, 1);
            string groupName   = NgFile.GetSplit(projectPath, 2);

            for (nProjectIndex = 0; nProjectIndex < m_ProjectFolerContents.Length; nProjectIndex++)
            {
                if (m_ProjectFolerContents[nProjectIndex].text == projectName)
                {
                    break;
                }
            }
            SelectToolbar(nProjectIndex, groupName, defaultEffectPath);
        }
        else
        {
            // Search DefaultDir
            if (nProjectIndex < 0)
            {
                for (nProjectIndex = 0; nProjectIndex < m_ProjectFolerContents.Length; nProjectIndex++)
                {
                    if (m_ProjectFolerContents[nProjectIndex].text == m_DefaultProjectName)
                    {
                        break;
                    }
                }
            }
            SelectToolbar(nProjectIndex, nGroupIndex, nEffectIndex);
        }
    }