// ------------------------------------------------------------------------------------------- void Awake() { NgUtil.LogDevelop("Awake - m_FXMakerControls"); LoadPrefs(); }
void OnEnable() { NgUtil.LogDevelop("OnEnable - m_FXMakerControls"); LoadPrefs(); }
// ------------------------------------------------------------------------------------------- void Awake() { NgUtil.LogDevelop("Awake - FxmBackToolMain"); }
void OnEnable() { NgUtil.LogDevelop("OnEnable - FXMakerMain"); // CreateCurrentInstanceEffect(true); }
// ========================================================================================================== void winResourceList(int id) { GUIStyle labelStyle = GUI.skin.GetStyle("BackMain_NotSelected"); int nWinIndex = id - FXMakerLayout.GetWindowId(FXMakerLayout.WINDOWID.RESOURCE_START); int nBackIndex = nWinIndex - m_CloneTypeCount; bool bCloneType = nWinIndex < m_CloneTypeCount; GameObject settingObj = (m_CurrentBackgroundInfo != null) ? m_CurrentBackgroundInfo.GetChildObject(nWinIndex) : null; // 현재 선택된 prefab if (settingObj != null) { GUIContent econ = new GUIContent(); econ.image = FXMakerMain.inst.GetPrefabThumbTexture(m_CurrentBackgroundInfo.GetClildThumbFilename(nWinIndex)); econ.text = settingObj.name; econ.tooltip = bCloneType ? FXMakerTooltip.GetHsToolBackground("RES_CLONE_HOVER", settingObj.name) : FXMakerTooltip.GetHsToolBackground("RES_REFERENCE_HOVER", settingObj.name); // Current Selected if (settingObj != null && GUI.Button(new Rect(FXMakerLayout.m_rectInnerMargin.x, 20, FXMakerLayout.GetFixedWindowWidth() - FXMakerLayout.m_rectInnerMargin.x * 2, FXMakerLayout.m_fScrollButtonHeight), econ)) { m_CurrentBackgroundInfo.SetPingObject(nWinIndex); } // Clear Selected if (GUI.Button(new Rect(FXMakerLayout.m_rectInnerMargin.x, 20 + FXMakerLayout.m_fScrollButtonHeight + 3, FXMakerLayout.GetFixedWindowWidth() - FXMakerLayout.m_rectInnerMargin.x * 2, 25), FXMakerTooltip.GetHcToolBackground("Clear Selected", settingObj.name))) { settingObj = null; if (bCloneType) { m_CurrentBackgroundInfo.SetCloneObject(nWinIndex, null); } else { m_CurrentBackgroundInfo.SetReferenceObject(nBackIndex, null); } // SaveBackgroundPrefab(); } // Thumb Selected if (bCloneType && m_CurrentBackgroundInfo.GetClildThumbFilename(nWinIndex) != "" && GUI.Button(new Rect(FXMakerLayout.m_rectInnerMargin.x, 48 + FXMakerLayout.m_fScrollButtonHeight + 3, FXMakerLayout.GetFixedWindowWidth() - FXMakerLayout.m_rectInnerMargin.x * 2, 25), FXMakerTooltip.GetHcToolBackground("Create Thumb", settingObj.name))) { FXMakerCapture.StartSaveBackThumb(m_CurrentBackgroundInfo.GetClildThumbFilename(nWinIndex)); return; } } else { if (bCloneType) { string strDir = NgFile.CombinePath(FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.BACKGROUNDRESOURCES), m_ResourceSubDir[nWinIndex]); GUI.Box(new Rect(FXMakerLayout.m_rectInnerMargin.x, 20, FXMakerLayout.GetFixedWindowWidth() - FXMakerLayout.m_rectInnerMargin.x * 2, FXMakerLayout.m_fScrollButtonHeight), FXMakerTooltip.GetHcToolBackground("[Not Selected]", strDir), labelStyle); // list ---------------------------- int nNodeCount = m_ClonePrefabs[nWinIndex].Length; Rect listRect = FXMakerLayout.GetChildVerticalRect(FXMakerLayout.GetResListRect(nWinIndex), 160, 1, 0, 1); Rect scrollRect = FXMakerLayout.GetScrollViewRect((int)listRect.width, nNodeCount, 1); Rect gridRect = FXMakerLayout.GetScrollGridRect((int)listRect.width, nNodeCount, 1); m_CloneWindowScrollPos[nWinIndex] = GUI.BeginScrollView(listRect, m_CloneWindowScrollPos[nWinIndex], scrollRect); // m_nResourceSelIndex[nWinIndex] = GUI.SelectionGrid(gNcLayout.GetChildVerticalRect(gNcLayout.GetResListRect(nWinIndex), 80, 1, 0, 1), m_nResourceSelIndex[nWinIndex], m_strResourceList[nWinIndex], 1); m_nClonePrefabSelIndex[nWinIndex] = GUI.SelectionGrid(gridRect, m_nClonePrefabSelIndex[nWinIndex], m_CloneContents[nWinIndex], 1); if (GUI.changed) { NgUtil.LogDevelop("changed m_nResourceSelIndex - nWinIndex = " + nWinIndex + ", value = " + m_nClonePrefabSelIndex[nWinIndex]); GameObject selPrefab = m_ClonePrefabs[nWinIndex][m_nClonePrefabSelIndex[nWinIndex]]; m_CurrentBackgroundInfo.SetCloneObject(nWinIndex, selPrefab); // SaveBackgroundPrefab(); } GUI.EndScrollView(); } } // select prefab if (bCloneType == false) { Rect subRect = new Rect(FXMakerLayout.m_rectInnerMargin.x, 48 + FXMakerLayout.m_fScrollButtonHeight + 3, FXMakerLayout.GetFixedWindowWidth() - FXMakerLayout.m_rectInnerMargin.x * 2, 25); if (GUI.Button(FXMakerLayout.GetInnerHorizontalRect(subRect, 2, 0, 1), FXMakerTooltip.GetHcToolBackground("Select", ""))) { FxmPopupManager.inst.ShowSelectPrefabPopup(m_CurrentBackgroundInfo, false, nBackIndex); // SaveBackgroundPrefab(); } if (NgLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(subRect, 2, 1, 1), FXMakerTooltip.GetHcToolBackground("Open", ""), m_CurrentBackgroundInfo.GetReferenceObject(nBackIndex) != null)) { FXMakerEffect.inst.LoadProject(AssetDatabase.GetAssetPath(m_CurrentBackgroundInfo.GetReferenceObject(nBackIndex))); FXMakerMain.inst.SetActiveTool(1); // SaveBackgroundPrefab(); } } FXMakerMain.inst.SaveTooltip(); }
public void SaveBackgroundPrefab() { NgUtil.LogDevelop("SaveBackgroundPrefab - FxmBack prefab"); m_BackgroundPrefabs[m_nBackgroundIndex] = FXMakerAsset.SaveEffectPrefab(m_CurrentBackgroundInfo.gameObject, m_BackgroundPrefabs[m_nBackgroundIndex]); ShowBackground(true, true); }
// ========================================================================================================== void winEffectList(int id) { if (GetGroupIndex() < 0) { return; } Rect effectRect = FXMakerLayout.GetEffectListRect(); // window desc ----------------------------------------------------------- FXMakerTooltip.WindowDescription(effectRect, FXMakerLayout.WINDOWID.EFFECT_LIST, null); // mini ---------------------------------------------------------------- m_bMinimize = GUI.Toggle(new Rect(3, 1, FXMakerLayout.m_fMinimizeClickWidth, FXMakerLayout.m_fMinimizeClickHeight), m_bMinimize, "Mini"); GUI.changed = false; if (FXMakerLayout.m_bMinimizeAll || m_bMinimize) { RenameCurrentPrefab(m_EditingName); FXMakerMain.inst.SaveTooltip(); return; } // 기능 버튼 ----------------------------------------------------------- Rect rect1Row = new Rect(FXMakerLayout.m_rectInnerMargin.x, 20, effectRect.width - FXMakerLayout.m_rectInnerMargin.x * 2, 25); Rect rect2Row = new Rect(FXMakerLayout.m_rectInnerMargin.x, 50, effectRect.width - FXMakerLayout.m_rectInnerMargin.x * 2, 20); Rect rect3Row = new Rect(FXMakerLayout.m_rectInnerMargin.x, 75, effectRect.width - FXMakerLayout.m_rectInnerMargin.x * 2, 12); // Add button if (m_nEffectCount < FXMakerLayout.m_nMaxPrefabListCount) { if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect1Row, 5, 0, 1), FXMakerTooltip.GetHcToolEffect("New"), IsReadOnlyFolder() == 0)) { RenameCurrentPrefab(m_EditingName); ShowNewMenu(); return; } } if (m_nEffectCount <= 0) { // right button if (Input.GetMouseButtonUp(1)) { ShowRightMenu(-1, false); } return; } // Selected state bool bEnable = (FXMakerMain.inst.IsCurrentEffectObject() && IsReadOnlyFolder() == 0); // Delete button if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect1Row, 5, 1, 1), FXMakerTooltip.GetHcToolEffect("Del"), bEnable)) { RenameCurrentPrefab(m_EditingName); m_bProcessDelete = true; } if (m_bProcessDelete) { m_bProcessDelete = FxmPopupManager.inst.ShowModalOkCancelMessage("'" + m_EffectContents[m_nEffectIndex].text + "'\n" + FXMakerTooltip.GetHsToolMessage("DIALOG_DELETEPREFAB", "")); if (m_bProcessDelete == false) { if (FxmPopupManager.inst.GetModalMessageValue() == FXMakerLayout.MODALRETURN_TYPE.MODALRETURN_OK) { NcSpriteAnimation spriteCom = FXMakerMain.inst.GetOriginalEffectPrefab().GetComponent <NcSpriteAnimation>(); if (spriteCom != null && spriteCom.m_bBuildSpriteObj && spriteCom.GetComponent <Renderer>().sharedMaterial != null) { m_bProcessDelSprite = true; } else { GameObject deletePrefab = FXMakerMain.inst.ClearCurrentEffectObject(m_CurrentEffectRoot, true); FXMakerAsset.DeleteEffectPrefab(deletePrefab); SelectToolbar(m_nProjectIndex, GetGroupIndex(), m_nEffectIndex); return; } } } } if (m_bProcessDelSprite) { m_bProcessDelSprite = FxmPopupManager.inst.ShowModalOkCancelMessage("'" + m_EffectContents[m_nEffectIndex].text + "'\n" + FXMakerTooltip.GetHsToolMessage("DIALOG_DELETESPRITE", "")); if (m_bProcessDelSprite == false) { if (FxmPopupManager.inst.GetModalMessageValue() == FXMakerLayout.MODALRETURN_TYPE.MODALRETURN_OK) { // delete material, texture NcSpriteAnimation spriteCom = FXMakerMain.inst.GetOriginalEffectPrefab().GetComponent <NcSpriteAnimation>(); if (spriteCom.GetComponent <Renderer>().sharedMaterial.mainTexture != null) { string path = AssetDatabase.GetAssetPath(spriteCom.GetComponent <Renderer>().sharedMaterial.mainTexture); AssetDatabase.MoveAssetToTrash(path); // AssetDatabase.DeleteAsset(path); } string matpath = AssetDatabase.GetAssetPath(spriteCom.GetComponent <Renderer>().sharedMaterial); AssetDatabase.MoveAssetToTrash(matpath); // AssetDatabase.DeleteAsset(matpath); } // delete prefab GameObject deletePrefab = FXMakerMain.inst.ClearCurrentEffectObject(m_CurrentEffectRoot, true); FXMakerAsset.DeleteEffectPrefab(deletePrefab); SelectToolbar(m_nProjectIndex, GetGroupIndex(), m_nEffectIndex); return; } } // Clone button if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect1Row, 5, 2, 1), FXMakerTooltip.GetHcToolEffect("Clone"), bEnable)) { RenameCurrentPrefab(m_EditingName); ClonePrefab(); return; } // Capture Thumb button if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect1Row, 5, 3, 1), FXMakerTooltip.GetHcToolEffect("Thumb"), bEnable)) { RenameCurrentPrefab(m_EditingName); ThumbPrefab(); return; } // // History button // if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect1Row, 5, 4, 1), FXMakertip.GetHcToolEffect("History"), bEnable)) // { // SetActiveEffect(m_nEffectIndex); // return; // } // Sprite button if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect1Row, 5, 4, 1), FXMakerTooltip.GetHcToolEffect("Sprite"), bEnable)) { RenameCurrentPrefab(m_EditingName); SpritePrefab(); return; } // Selected state if (FXMakerMain.inst.IsCurrentEffectObject()) { // ChangeName if (FXMakerMain.inst.IsCurrentEffectObject() && 0 <= m_nEffectIndex && m_nEffectIndex < m_nEffectCount) { GUI.SetNextControlName("TextField"); FXMakerLayout.GUIEnableBackup(IsReadOnlyFolder() == 0); // FXMakerMain.inst.ToggleGlobalLangSkin(true); m_EditingName = GUI.TextField(FXMakerLayout.GetInnerHorizontalRect(rect2Row, 4, 0, 4), m_EditingName, 50); // FXMakerMain.inst.ToggleGlobalLangSkin(false); FXMakerLayout.GUIEnableRestore(); bool bEnterKey = (Event.current.isKey && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.KeypadEnter)); if (bEnterKey || (FXMakerMain.GetPrevWindowFocus() == (int)FXMakerLayout.WINDOWID.EFFECT_LIST && FXMakerMain.GetWindowFocus() != (int)FXMakerLayout.WINDOWID.EFFECT_LIST)) { RenameCurrentPrefab(m_EditingName); } } } // Resize -------------------------------------------------------------- bool bChangeScrollColumn = false; m_nScrollColumn = (int)GUI.HorizontalScrollbar(rect3Row, m_nScrollColumn, 1, 1, m_nMaxObjectColumn + 1); if (GUI.changed) { UnityEditor.EditorPrefs.SetInt("FXMakerEffect.Effect_nScrollColumn", m_nScrollColumn); bChangeScrollColumn = true; Rect rect = FXMakerLayout.GetAspectScrollViewRect((int)rect3Row.width, FXMakerLayout.m_fScrollButtonAspect, m_nEffectCount, m_nScrollColumn, false); m_EffectListScrollPos.y = rect.height * (m_nEffectIndex - m_nScrollColumn) / (float)m_nEffectCount; } // Draw line Rect lineRect = rect3Row; lineRect.y = rect3Row.yMax + 5; lineRect.height = 3; NgGUIDraw.DrawHorizontalLine(new Vector2(lineRect.x, lineRect.y), (int)lineRect.width, new Color(0.1f, 0.1f, 0.1f, 0.7f), 2, false); // Effect List ------------------------------------------------------ Rect listRect = FXMakerLayout.GetChildVerticalRect(effectRect, m_nGuiTopHeight, 1, 0, 1); Rect scrollRect = FXMakerLayout.GetAspectScrollViewRect((int)listRect.width, FXMakerLayout.m_fScrollButtonAspect, m_nEffectCount, m_nScrollColumn, false); Rect gridRect = FXMakerLayout.GetAspectScrollGridRect((int)listRect.width, FXMakerLayout.m_fScrollButtonAspect, m_nEffectCount, m_nScrollColumn, false); m_EffectListScrollPos = GUI.BeginScrollView(listRect, m_EffectListScrollPos, scrollRect); // FXMakerMain.inst.ToggleGlobalLangSkin(true); // int nEffectIndex = GUI.SelectionGrid(listRect, m_nEffectIndex, m_EffectNameStrings, m_nScrollColumn); // int nEffectIndex = GUI.SelectionGrid(gridRect, m_nEffectIndex, m_EffectContents, m_nScrollColumn); int nEffectIndex = FXMakerLayout.TooltipSelectionGrid(FXMakerLayout.GetOffsetRect(effectRect, 0, -m_EffectListScrollPos.y), listRect, gridRect, m_nEffectIndex, m_EffectContents, m_nScrollColumn); // FXMakerMain.inst.ToggleGlobalLangSkin(false); // move key if (FXMakerMain.inst.GetFocusInputKey(FXMakerLayout.GetWindowId(FXMakerLayout.WINDOWID.EFFECT_LIST)) != 0) { switch (FXMakerMain.inst.GetFocusInputKey(FXMakerLayout.GetWindowId(FXMakerLayout.WINDOWID.EFFECT_LIST))) { case KeyCode.LeftArrow: nEffectIndex--; FXMakerMain.inst.SetFocusInputKey(0); break; case KeyCode.RightArrow: nEffectIndex++; FXMakerMain.inst.SetFocusInputKey(0); break; case KeyCode.UpArrow: nEffectIndex -= m_nScrollColumn; FXMakerMain.inst.SetFocusInputKey(0); break; case KeyCode.DownArrow: nEffectIndex += m_nScrollColumn; FXMakerMain.inst.SetFocusInputKey(0); break; } if (nEffectIndex < 0) { nEffectIndex = 0; } if (m_nEffectCount <= nEffectIndex) { nEffectIndex = m_nEffectCount - 1; } } // select if ((bChangeScrollColumn == false && GUI.changed) || m_nEffectIndex != nEffectIndex) { RenameCurrentPrefab(m_EditingName); // right button if (Input.GetMouseButtonUp(1)) { ShowRightMenu(nEffectIndex, true); } // active NgUtil.LogDevelop("changed m_nEffectIndex - id = " + id + ", value = " + m_EffectContents[nEffectIndex].text); if (nEffectIndex == m_nEffectIndex && FXMakerMain.inst.IsCurrentEffectObject()) { FXMakerMain.inst.CreateCurrentInstanceEffect(true); } else { SetActiveEffect(nEffectIndex); } } else { // right button if (Input.GetMouseButtonUp(1)) { RenameCurrentPrefab(m_EditingName); ShowRightMenu(-1, false); } } GUI.EndScrollView(); FXMakerMain.inst.SaveTooltip(); }
void Awake() { NgUtil.LogDevelop("Awake - FXMakerMain"); GetFXMakerControls().enabled = true; }
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); if (projectPath.Contains("Assets/Resources") && projectName == "Resources" && projectPath.Contains("Res..")) { projectName = "2 Background"; } 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); } }
// ========================================================================================================== void winMenuToolbar(int id) { if (m_nProjectCount <= 0) { return; } bool bChanged = false; Rect popupRect = FXMakerLayout.GetMenuToolbarRect(); // window desc ----------------------------------------------------------- FXMakerTooltip.WindowDescription(popupRect, FXMakerLayout.WINDOWID.TOP_CENTER, null); // mini ---------------------------------------------------------------- FXMakerLayout.m_bMinimizeTopMenu = GUI.Toggle(new Rect(3, 1, FXMakerLayout.m_fMinimizeClickWidth, FXMakerLayout.m_fMinimizeClickHeight), FXMakerLayout.m_bMinimizeTopMenu, "Mini"); // if (GUI.changed) // EditorPrefs.SetBool("FXMakerEffect.m_bMinimize", FXMakerLayout.m_bMinimizeTopMenu); FXMakerLayout.m_bMinimizeAll = GUI.Toggle(new Rect(popupRect.width - 60, 1, FXMakerLayout.m_fMinimizeClickWidth, FXMakerLayout.m_fMinimizeClickHeight), FXMakerLayout.m_bMinimizeAll, "MiniAll"); GUI.changed = false; if (FXMakerLayout.m_bMinimizeAll || FXMakerLayout.m_bMinimizeTopMenu) { FXMakerMain.inst.SaveTooltip(); return; } // FXMakerMain.inst.ToggleGlobalLangSkin(true); // Group Project // int nProjectIndex = GUI.Toolbar(FXMakerLayout.GetChildVerticalRect(popupRect, 0, 10, 0, 3), m_nProjectIndex, m_ProjectFolerContents); int nProjectIndex = FXMakerLayout.TooltipToolbar(popupRect, FXMakerLayout.GetChildVerticalRect(popupRect, 0, 10, 0, 3), m_nProjectIndex, m_ProjectFolerContents); if (GUI.changed) { bChanged = true; } // Draw line Rect lineRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, 10, 3, 1); NgGUIDraw.DrawHorizontalLine(new Vector2(lineRect.x, lineRect.y + 2), (int)lineRect.width, new Color(0.1f, 0.1f, 0.1f, 0.7f), 2, false); // Group List Rect groupRect = FXMakerLayout.GetChildVerticalRect(popupRect, 0, 10, 4, 6); // int nGroupIndex = GUI.Toolbar(gNcLayout.GetChildVerticalRect(gNcLayout.GetMenuToolbarRect(), 0, 10, 4, 6), GetGroupIndex(), m_GroupFolderStrings); // int nGroupIndex = GUI.SelectionGrid(groupRect, GetGroupIndex(), m_GroupFolderContents, m_GroupFolderContents.Length/2+m_GroupFolderContents.Length%2); int nGroupIndex = FXMakerLayout.TooltipSelectionGrid(popupRect, groupRect, GetGroupIndex(), m_GroupFolderContents, m_GroupFolderContents.Length / 2 + m_GroupFolderContents.Length % 2); if (GUI.changed) { bChanged = true; } // FXMakerMain.inst.ToggleGlobalLangSkin(false); if (bChanged) { NgUtil.LogDevelop("changed MenuToolbar = " + nProjectIndex + " " + nGroupIndex); SaveProject(); if (m_nProjectCount <= nProjectIndex) { nProjectIndex = m_nProjectCount - 1; m_nProjectIndex = nProjectIndex; } SelectToolbar(nProjectIndex, (m_nProjectIndex != nProjectIndex ? GetGroupIndex(nProjectIndex) : nGroupIndex), ""); } FXMakerMain.inst.SaveTooltip(); }
void OnEnable() { NgUtil.LogDevelop("OnEnable - FXMakerMain"); LoadProject(); }
protected void RunActionControl(int nPlayIndex, int nTransIndex) { NgUtil.LogDevelop("RunActionControl() - nPlayIndex " + nPlayIndex); CancelInvoke("CreateInstanceEffect"); m_bCalledDelayCreate = false; // チ、チ?オネ ステー霏マ ー豼?ソ?チ?タフオオキマ ヌリオホタレ... ResumeTimeScale(); // Play --------------------------------------- m_bStartAliveAnimation = false; switch (nPlayIndex) { /*AutoRet*/ case 0: break; case 1: break; /*OneShot*/ case 2: SetTimeScale(m_fPlayToolbarTimes[nPlayIndex]); break; /*Repeat*/ case m_nRepeatIndex: case m_nRepeatIndex + 1: case m_nRepeatIndex + 2: case m_nRepeatIndex + 3: case m_nRepeatIndex + 4: { // repeatシアナテタフク?. タフオソー?キテ ソノシヌタサ イ?エル. if (nPlayIndex != m_nPlayIndex) { nTransIndex = 0; } break; } } // Trans --------------------------------------- if (0 < nTransIndex) { // init multishot // if (m_nTransIndex != nTransIndex && (m_nTransIndex != 0 && nTransIndex != 0)) // m_nMultiShotCount = 1; // 2016.10.07 長坂 メインカメラ固定になってうため、変更できるように修正. #if __DRECOM_ float fTransHalfDist = (NcUtility.Camera != null ? (Vector3.Magnitude(NcUtility.Camera.transform.position) * 0.65f) : 1) * m_fTransRate; #else float fTransHalfDist = (Camera.main != null ? (Vector3.Magnitude(Camera.main.transform.position) * 0.65f) : 1) * m_fTransRate; #endif GameObject instEffectObject = FXMakerMain.inst.GetInstanceEffectObject(); GameObject simRoot = NgObject.CreateGameObject(instEffectObject.transform.parent.gameObject, "simulate"); FXMakerSimulate simComponent = simRoot.AddComponent <FXMakerSimulate>(); instEffectObject.transform.parent = simRoot.transform; FXMakerMain.inst.ChangeRoot_InstanceEffectObject(simRoot); simComponent.Init(this, m_nMultiShotCount); switch (nTransIndex) { case 1: // Move { simComponent.SimulateMove(m_nTransAxis, fTransHalfDist, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0)); break; } case 2: // scale { simComponent.SimulateScale(m_nTransAxis, fTransHalfDist * 0.3f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0)); break; } case 3: // Arc { simComponent.SimulateArc(fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0)); break; } case 4: // fall { simComponent.SimulateFall(fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0)); break; } case 5: // raise { simComponent.SimulateRaise(fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0)); break; } case 6: // circle { simComponent.SimulateCircle(fTransHalfDist * 0.5f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0)); break; } case 7: // tornado { simComponent.SimulateTornado(fTransHalfDist * 0.3f, fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0)); break; } } } // タフオソテウクョチ゚タフク?.. タレオソケンコケオヌケヌキホ ア簔クrepeatソノシヌタコ イ?エル. if (0 < nTransIndex) { if (m_nRepeatIndex <= nPlayIndex) { nPlayIndex = 0; } } // テヨチキ ー眞、ーェ タ?タ? m_nPlayIndex = nPlayIndex; m_nTransIndex = nTransIndex; if (IsRepeat()) { m_fCreateTime = Time.time; } }
void OnEnable() { NgUtil.LogDevelop("OnEnable - FXMakerMain"); }
protected void RunActionControl(int nPlayIndex, int nTransIndex) { NgUtil.LogDevelop("RunActionControl() - nPlayIndex " + nPlayIndex); CancelInvoke("CreateInstanceEffect"); m_bCalledDelayCreate = false; // ������ �ð��� ���� �����̵��� �ص���... ResumeTimeScale(); // Play --------------------------------------- m_bStartAliveAnimation = false; switch (nPlayIndex) { /*AutoRet*/ case 0: break; case 1: break; /*OneShot*/ case 2: SetTimeScale(m_fPlayToolbarTimes[nPlayIndex]); break; /*Repeat*/ case m_nRepeatIndex: case m_nRepeatIndex + 1: case m_nRepeatIndex + 2: case m_nRepeatIndex + 3: case m_nRepeatIndex + 4: { // repeat�����̸�.. �̵����� �ɼ��� ����. if (nPlayIndex != m_nPlayIndex) { nTransIndex = 0; } break; } } // Trans --------------------------------------- if (0 < nTransIndex) { // init multishot // if (m_nTransIndex != nTransIndex && (m_nTransIndex != 0 && nTransIndex != 0)) // m_nMultiShotCount = 1; float fTransHalfDist = (Camera.main != null ? (Vector3.Magnitude(Camera.main.transform.position) * 0.65f) : 1) * m_fTransRate; GameObject instEffectObject = FXMakerMain.inst.GetInstanceEffectObject(); GameObject simRoot = NgObject.CreateGameObject(instEffectObject.transform.parent.gameObject, "simulate"); FXMakerSimulate simComponent = simRoot.AddComponent <FXMakerSimulate>(); instEffectObject.transform.parent = simRoot.transform; FXMakerMain.inst.ChangeRoot_InstanceEffectObject(simRoot); simComponent.Init(this, m_nMultiShotCount); switch (nTransIndex) { case 1: // Move { simComponent.SimulateMove(m_nTransAxis, fTransHalfDist, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0)); break; } case 2: // scale { simComponent.SimulateScale(m_nTransAxis, fTransHalfDist * 0.3f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0)); break; } case 3: // Arc { simComponent.SimulateArc(fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0)); break; } case 4: // fall { simComponent.SimulateFall(fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0)); break; } case 5: // raise { simComponent.SimulateRaise(fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0)); break; } case 6: // circle { simComponent.SimulateCircle(fTransHalfDist * 0.5f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0)); break; } case 7: // tornado { simComponent.SimulateTornado(fTransHalfDist * 0.3f, fTransHalfDist * 0.7f, FXMakerOption.inst.m_fScaleTransSpeed * m_fDistPerTime, (m_nRotateIndex == 0)); break; } } } // �̵�ó�����̸�... �ڵ��ݺ��ǹǷ� ����repeat�ɼ��� ����. if (0 < nTransIndex) { if (m_nRepeatIndex <= nPlayIndex) { nPlayIndex = 0; } } // ���� ������ ���� m_nPlayIndex = nPlayIndex; m_nTransIndex = nTransIndex; if (IsRepeat()) { m_fCreateTime = Time.time; } }
// ========================================================================================================== void winMenuToolbar(int id) { if (m_nGroupCount <= 0) { return; } // Group List int nGroupIndex = 0; if (m_bGroupFoler) { nGroupIndex = GUI.Toolbar(FXMakerLayout.GetChildVerticalRect(FXMakerLayout.GetMenuToolbarRect(), 0, 10, 0, 3), m_nGroupIndex, m_GroupFolerContents); if (GUI.changed) { SelectToolbar(nGroupIndex, ""); } // Draw line Rect lineRect = FXMakerLayout.GetChildVerticalRect(FXMakerLayout.GetMenuToolbarRect(), 0, 10, 3, 1); NgGUIDraw.DrawHorizontalLine(new Vector2(lineRect.x, lineRect.y), (int)lineRect.width, new Color(0.1f, 0.1f, 0.1f, 0.7f), 2, false); } // Background List int nSetIndex; if (m_bGroupFoler) { nSetIndex = GUI.SelectionGrid(FXMakerLayout.GetChildVerticalRect(FXMakerLayout.GetMenuToolbarRect(), 0, 10, 4, 6), Mathf.Min(m_nBackgroundIndex, m_nBackgroundCount - 1), m_BackgroundContents, m_BackgroundContents.Length); } else { nSetIndex = GUI.SelectionGrid(FXMakerLayout.GetChildVerticalRect(FXMakerLayout.GetMenuToolbarRect(), 0, 10, 0, 10), Mathf.Min(m_nBackgroundIndex, m_nBackgroundCount - 1), m_BackgroundContents, m_BackgroundContents.Length); } // select if (GUI.changed) { if (nSetIndex < m_nBackgroundCount) { NgUtil.LogDevelop("changed MenuToolbar = " + nGroupIndex + " " + nSetIndex); // Change Background Prefab if (0 <= nSetIndex) { // right button if (Input.GetMouseButtonUp(1)) { ShowRightMenu(nSetIndex, true); } // active SelectToolbar(nGroupIndex, nSetIndex); } else { } } else { // right button if (Input.GetMouseButtonUp(1)) { ShowRightMenu(-1, false); } } } FXMakerMain.inst.SaveTooltip(); }
public static ArrayList GetResourceFiles <TT>(string strDir, string containFileName, int nMaxFile, bool bAsyncLoad, NgEnum.PREFAB_TYPE prefabType, out int nOutFindFile) where TT : Object { #if UNITY_WEBPLAYER Debug.LogError("In WEB_PLAYER mode, you cannot run the FXMaker."); Debug.Break(); nOutFindFile = 0; return(null); #else if (strDir[strDir.Length - 1] != '/' && strDir[strDir.Length - 1] != '\\') { strDir = strDir + "/"; } strDir = NgFile.PathSeparatorNormalize(strDir); NgUtil.LogDevelop("GetPrefabList() - LoadDir - " + strDir); ArrayList retArray = new ArrayList(); { DirectoryInfo dir = new DirectoryInfo(strDir); // CheckDir if (dir.Exists == false) { Debug.LogError("Directory not found - " + strDir); } FileInfo[] info = dir.GetFiles(); foreach (FileInfo fileInfo in info) { if (0 < nMaxFile && nMaxFile <= retArray.Count) { Debug.LogWarning("GetPrefabList - Over MaxCount!!!"); break; } if (containFileName != null) { if (fileInfo.Name.Contains(containFileName) == false) { continue; } } // TT obj = (TT)Resources.LoadAssetAtPath(strDir + fileInfo.Name, typeof(TT)); TT obj = null; // if (fileInfo.Name.Contains(".prefab")) // if (fileInfo.Name.Contains(".prefab") || fileInfo.Name.Contains(".png")) string compareName = NgFile.GetFileExt(fileInfo.Name).ToLower(); if (typeof(TT) == typeof(GameObject)) { if (compareName == "mat") { continue; } if (compareName == "png") { continue; } if (compareName == "tga") { continue; } if (compareName == "jpg") { continue; } if (compareName == "psd") { continue; } if (compareName == "tif") { continue; } if (compareName == "wav") { continue; } if (bAsyncLoad && (compareName == "prefab")) { retArray.Add(strDir + fileInfo.Name); continue; } } else if (typeof(TT) == typeof(Texture)) { if (compareName == "mat") { continue; } if (compareName == "prefab") { continue; } if (compareName == "fbx") { continue; } if (compareName == "wav") { continue; } if (bAsyncLoad && (compareName == "png" || compareName == "tga" || compareName == "jpg" || compareName == "psd" || compareName == "tif")) { retArray.Add(strDir + fileInfo.Name); continue; } } else if (typeof(TT) == typeof(Material)) { if (compareName != "mat") { continue; } if (bAsyncLoad && (compareName == "mat")) { retArray.Add(strDir + fileInfo.Name); continue; } } else if (typeof(TT) == typeof(AudioClip)) { if (compareName == "mat") { continue; } if (compareName == "png") { continue; } if (compareName == "tga") { continue; } if (compareName == "jpg") { continue; } if (compareName == "psd") { continue; } if (compareName == "tif") { continue; } if (compareName == "prefab") { continue; } if (compareName == "fbx") { continue; } } // 싱크 로드 obj = (TT)AssetDatabase.LoadAssetAtPath(strDir + fileInfo.Name, typeof(TT)); // Debug.Log(strDir + fileInfo.Name); // Debug.Log(AssetDatabase.GetAssetPath(obj)); if (typeof(TT) == typeof(GameObject) && prefabType != NgEnum.PREFAB_TYPE.All) { GameObject chkObj = obj as GameObject; Debug.Log(prefabType); Debug.Log(chkObj.GetComponent <ParticleEmitter>()); Debug.Log(chkObj.GetComponent <ParticleSystem>()); if (prefabType == NgEnum.PREFAB_TYPE.ParticleSystem && (chkObj.GetComponent <ParticleEmitter>() == null && chkObj.GetComponent <ParticleSystem>() == null)) { continue; } if (prefabType == NgEnum.PREFAB_TYPE.NcSpriteFactory && (chkObj.GetComponent <NcSpriteFactory>() == null)) { continue; } if (prefabType == NgEnum.PREFAB_TYPE.LegacyParticle && (chkObj.GetComponent <ParticleEmitter>() == null)) { continue; } } if (obj != null) { retArray.Add(obj); } } NgUtil.LogDevelop("GetPrefabList() - nCount - " + retArray.Count); nOutFindFile = retArray.Count; return(retArray); } #endif }
protected void RunActionControl(int nPlayIndex, int nTransIndex) { NgUtil.LogDevelop("RunActionControl() - nPlayIndex " + nPlayIndex); base.CancelInvoke(); this.m_bCalledDelayCreate = false; this.ResumeTimeScale(); this.m_bStartAliveAnimation = false; switch (nPlayIndex) { case 2: this.SetTimeScale(this.m_fPlayToolbarTimes[nPlayIndex]); break; case 3: case 4: case 5: case 6: case 7: if (nPlayIndex != this.m_nPlayIndex) { nTransIndex = 0; } break; } if (0 < nTransIndex) { float num = ((!(Camera.main != null)) ? 1f : (Vector3.Magnitude(Camera.main.transform.position) * 0.8f)) * this.m_fTransRate; GameObject instanceEffectObject = FxmTestMain.inst.GetInstanceEffectObject(); GameObject gameObject = NgObject.CreateGameObject(instanceEffectObject.transform.parent.gameObject, "simulate"); FxmTestSimulate fxmTestSimulate = gameObject.AddComponent <FxmTestSimulate>(); instanceEffectObject.transform.parent = gameObject.transform; FxmTestMain.inst.ChangeRoot_InstanceEffectObject(gameObject); fxmTestSimulate.Init(this, this.m_nMultiShotCount); switch (nTransIndex) { case 1: fxmTestSimulate.SimulateMove(this.m_nTransAxis, num, this.m_fDistPerTime, this.m_nRotateIndex == 0); break; case 2: fxmTestSimulate.SimulateScale(this.m_nTransAxis, num * 0.3f, this.m_fStartPosition, this.m_fDistPerTime, this.m_nRotateIndex == 0); break; case 3: fxmTestSimulate.SimulateArc(num * 0.7f, this.m_fDistPerTime, this.m_nRotateIndex == 0); break; case 4: fxmTestSimulate.SimulateFall(num * 0.7f, this.m_fDistPerTime, this.m_nRotateIndex == 0); break; case 5: fxmTestSimulate.SimulateRaise(num * 0.7f, this.m_fDistPerTime, this.m_nRotateIndex == 0); break; case 6: fxmTestSimulate.SimulateCircle(num * 0.5f, this.m_fDistPerTime, this.m_nRotateIndex == 0); break; case 7: fxmTestSimulate.SimulateTornado(num * 0.3f, num * 0.7f, this.m_fDistPerTime, this.m_nRotateIndex == 0); break; } } if (0 < nTransIndex && 3 <= nPlayIndex) { nPlayIndex = 0; } this.m_nPlayIndex = nPlayIndex; this.m_nTransIndex = nTransIndex; if (this.IsRepeat()) { this.m_fCreateTime = Time.time; } }