protected virtual void LoadGroups() { // Load Group if (0 < m_nProjectCount) { string[] groupFolderStrings = NgAsset.GetFolderList(NgFile.CombinePath(FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.PROJECTS), m_ProjectFolerContents[m_nProjectIndex].text), null, null, 0, out m_nGroupCount); m_GroupFolderContents = NgConvert.StringsToContents(groupFolderStrings); } }
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); } }
public void LoadProject() { NgUtil.LogDevelop("LoadProject - FxmBackMain"); // group 弃歹甸 捞抚 阂矾坷扁 if (m_bGroupFoler) { string[] groupFolerStrings = NgAsset.GetFolderList(FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.BACKGROUNDPREFABS), null, null, FXMakerOption.inst.m_nMinTopToolbarCount, out m_nGroupCount); m_GroupFolerContents = NgConvert.StringsToContents(groupFolerStrings); for (int n = 0; n < m_GroupFolerContents.Length; n++) { if (m_GroupFolerContents[n].text == null) { m_GroupFolerContents[n].tooltip = FXMakerTooltip.GetHsToolBackground("EMPTYGROUP_HOVER", FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.BACKGROUNDPREFABS)); } else { m_GroupFolerContents[n].tooltip = FXMakerTooltip.GetHsToolBackground("GROUP_HOVER", m_GroupFolerContents[n].text); } } } else { m_GroupFolerContents = new GUIContent[1]; m_GroupFolerContents[0] = new GUIContent("", ""); m_nGroupCount = 1; } // 固府 沥狼等 府家胶 肺靛 LoadResourceFolder(); // 捞傈 急琶沥焊 贸府 int nGroupIndex = 0; int nBackgroundIndex = 0; if (FXMakerLayout.m_bDevelopPrefs == false) { nGroupIndex = UnityEditor.EditorPrefs.GetInt("FXMakerBackground.m_nGroupIndex", 0); nBackgroundIndex = UnityEditor.EditorPrefs.GetInt("FXMakerBackground.m_nBackgroundIndex", 0); } SelectToolbar(nGroupIndex, nBackgroundIndex); // default Background if (m_CurrentBackgroundInfo == null) { SelectToolbar(0, 0); } }
void LoadScriptList() { int nScriptCount; int nFindFolderCount; int nCount = 0; string scriptDir = FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.SCRIPTS); // load folder string[] groupStrings = NgAsset.GetFolderList(scriptDir, null, "Hide", 0, out nFindFolderCount); m_GroupContents = NgConvert.StringsToContents(groupStrings); if (m_nGroupIndex < 0 || m_GroupContents.Length <= m_nGroupIndex) { m_nGroupIndex = 0; } if (m_GroupContents.Length == 0) { m_nGroupIndex = -1; } // load file if (m_GroupContents[m_nGroupIndex].text == "Unity") { List <string> addList = new List <string>(); // add UnityComponent addList.Add("MeshFilter"); addList.Add("MeshRenderer"); addList.Add(""); addList.Add("ParticleSystem"); addList.Add("ParticleSystemRenderer"); addList.Add("TrailRenderer"); addList.Add("LineRenderer"); addList.Add(""); addList.Add("EllipsoidParticleEmitter"); addList.Add("MeshParticleEmitter"); addList.Add("ParticleAnimator"); addList.Add("ParticleRenderer"); addList.Add(""); addList.Add("Rigidbody"); addList.Add("BoxCollider"); addList.Add("SphereCollider"); addList.Add("CapsuleCollider"); addList.Add("MeshCollider"); addList.Add("WorldParticleCollider"); addList.Add(""); addList.Add("Animation"); addList.Add("AudioSource"); m_ScriptScrings = new string[addList.Count]; m_ScriptContents = new GUIContent[addList.Count]; for (int n = 0; n < addList.Count; n++) { m_ScriptContents[n] = GetHelpContentScript(addList[n]); m_ScriptScrings[n] = addList[n]; } } else { string dir = (m_nGroupIndex < 0 ? scriptDir : NgFile.CombinePath(scriptDir, m_GroupContents[m_nGroupIndex].text + "/")); string[] scriptScrings = NgAsset.GetFileList(dir, 0, out nScriptCount); m_ScriptScrings = new string[scriptScrings.Length]; m_ScriptContents = new GUIContent[scriptScrings.Length]; for (int n = 0; n < scriptScrings.Length; n++) { // if (scriptScrings[n].Contains("Behaviour.")) // continue; string ext = Path.GetExtension(scriptScrings[n]); ext = ext.ToLower(); if (ext == ".cs" || ext == ".js") { m_ScriptContents[nCount] = GetHelpContentScript(NgFile.TrimFileExt(scriptScrings[n])); m_ScriptScrings[nCount] = NgFile.TrimFileExt(scriptScrings[n]); nCount++; } } m_ScriptScrings = NgConvert.ResizeArray(m_ScriptScrings, nCount); m_ScriptContents = NgConvert.ResizeArray(m_ScriptContents, nCount); } }
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); } }