// ========================================================================================================== 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); m_nClonePrefabSelIndex[nWinIndex] = FXMakerLayout.TooltipSelectionGrid(FXMakerLayout.GetOffsetRect(FXMakerLayout.GetResListRect(nWinIndex), 0, -m_CloneWindowScrollPos[nWinIndex].y), listRect, 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(); }
void ThumbPrefab() { FXMakerCapture.StartSaveBackThumb(NgAsset.GetPrefabThumbFilename(m_BackgroundPrefabs[m_nBackgroundIndex])); }