public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.Space(); GUILayout.BeginHorizontal(); if (GUILayout.Toggle(tab == TAB.General, "General", EditorStyles.toolbarButton)) { tab = TAB.General; } if (GUILayout.Toggle(tab == TAB.Displacement, "Displacement", EditorStyles.toolbarButton)) { tab = TAB.Displacement; } if (GUILayout.Toggle(tab == TAB.Materials, "Materials", EditorStyles.toolbarButton)) { tab = TAB.Materials; } if (GUILayout.Toggle(tab == TAB.Objects, "Objects", EditorStyles.toolbarButton)) { tab = TAB.Objects; } GUILayout.EndHorizontal(); EditorGUILayout.Space(); if (tab == TAB.General) { GeneralTab(); } else if (tab == TAB.Displacement) { DisplacementTab(); } else if (tab == TAB.Materials) { MaterialsTab(); } else if (tab == TAB.Objects) { ObjectsTab(); } EditorGUILayout.Space(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Generate")) { pt.UpdateTerrain(); } if (GUILayout.Button("Clear")) { pt.ClearTerrain(); } GUILayout.EndHorizontal(); serializedObject.ApplyModifiedProperties(); }
public void changeOfTab(TAB index) { if (index != indexTabSelected) { indexTabSelected = index; UpdateInvestigationList(true); updateDirButts(); } }
/// <summary> /// Each call to this method will rotate this puzzle piece clockwise by 90 degrees. /// Found help on how to do this online by user "Robert Fricke". /// </summary> /// <see cref="https://stackoverflow.com/questions/21385066/shifting-array-elements-to-right"/> internal PuzzlePiece Rotate() { var newArrayOfRotatedTabs = new TAB[4]; for (int i = 0; i < ContainingTabs.Length; i++) { newArrayOfRotatedTabs[(i + 1) % ContainingTabs.Length] = ContainingTabs[i]; } ContainingTabs = newArrayOfRotatedTabs; return(this); }
void init() { _tutMan = GameObject.FindGameObjectWithTag("Tutorial").GetComponent <TutorialManager> (); if (descriptionText == null) { descriptionText = GameObject.Find("InvestigationDescription").GetComponent <Text>(); } if (nameText == null) { nameText = GameObject.Find("InvestigationName").GetComponent <Text>(); } if (priceText == null) { priceText = GameObject.Find("InvestigationPrice").GetComponent <Text>(); } if (investigationButton == null) { investigationButton = GameObject.Find("InvestigationButton").GetComponent <Button>(); } if (investigationButtonText == null) { investigationButtonText = GameObject.Find("InvestigationButtonText").GetComponent <Text>(); } if (investigationLeftPanel == null) { investigationLeftPanel = GameObject.Find("InvestigationItemsPanelLeft").GetComponent <RectTransform>(); } if (investigationCenterPanel == null) { investigationCenterPanel = GameObject.Find("InvestigationItemsPanelCenter").GetComponent <RectTransform>(); } if (investigationRightPanel == null) { investigationRightPanel = GameObject.Find("InvestigationItemsPanelRight").GetComponent <RectTransform>(); } if (leftButt == null) { leftButt = GameObject.Find("InvestigationLeftDir").GetComponent <Button>(); } if (rightButt == null) { rightButt = GameObject.Find("InvestigationRightDir").GetComponent <Button>(); } selectedPage = 0; selectedId = -1; indexTabSelected = TAB.AVAILABLE; UpdateInvestigationList(true); updateDirButts(); }
private void button2_Click(object sender, EventArgs e) { double temperature = hScrollBar1.Value + 215; double speed = hScrollBar2.Value * 10.0; double pressure = vScrollBar3.Value; double throttle = 100.0 - vScrollBar2.Value; status_string = "Temperature:\t" + temperature.ToString() + " K\r\n" + "Throttle:\t\t" + throttle.ToString() + " %\r\n" + "Pressure:\t\t" + pressure.ToString() + " Kpa\r\n" + "Speed:\t\t" + speed.ToString() + " m/s\r\n"; status_string += "\r\n\r\n"; status_string += "\tMODULE\r\n"; status_string += "\t{\r\n"; status_string += "\t\tname = AJEModule\r\n"; status_string += "\t\tArea = " + Area.ToString() + "\r\n"; status_string += "\t\tBPR = " + BPR.ToString() + "\r\n"; status_string += "\t\tCPR = " + CPR.ToString() + "\r\n"; status_string += "\t\tFPR = " + FPR.ToString() + "\r\n"; status_string += "\t\tMdes = " + Mach_D.ToString() + "\r\n"; status_string += "\t\tTdes = " + Temp_D.ToString() + "\r\n"; status_string += "\t\teta_c = " + eta_c.ToString() + "\r\n"; status_string += "\t\teta_t = " + eta_t.ToString() + "\r\n"; status_string += "\t\teta_n = " + eta_n.ToString() + "\r\n"; status_string += "\t\tFHV = " + FHV.ToString() + "\r\n"; status_string += "\t\tTIT = " + TIT.ToString() + "\r\n"; status_string += "\t\tTAB = " + TAB.ToString() + "\r\n"; status_string += "\t\texhaustMixer = " + checkBox1.Checked.ToString() + "\r\n"; status_string += "\t\tmaxThrust = 999999\r\n"; status_string += "\t\tmaxT3 = 9999\r\n"; status_string += "\t}\r\n\r\n\r\n"; aje.InitializeOverallEngineData( Area, TPR, BPR, CPR, FPR, Mach_D, Temp_D, eta_c, eta_t, eta_n, FHV, TIT, TAB, checkBox1.Checked ); aje.CalculatePerformance(pressure, temperature, speed, throttle/100); result_string = aje.debugstring; }
private void AllAlertsOFFExceptOne(TAB tab, string message) { bool visibleOn = false; bool visibleOff = true; EnableTabAlert(frmPatientRecordTabs.tabRoutineCheck, visibleOff, message); EnableTabAlert(frmPatientRecordTabs.tabViewAppointments, visibleOff, message); EnableTabAlert(frmPatientRecordTabs.tabOrderTests, visibleOff, message); EnableTabAlert(frmPatientRecordTabs.tabTestsResults, visibleOff, message); EnableTabAlert(frmPatientRecordTabs.tabSetAppointments, visibleOff, message); EnableTabAlert(frmPatientRecordTabs.tabPersonal, visibleOff, message); EnableTabAlert(frmPatientRecordTabs.tabDiagnosis, visibleOff, message); switch (tab) { case TAB.PERSONAL: EnableTabAlert(frmPatientRecordTabs.tabPersonal, visibleOn, message); break; case TAB.SET_APPONTMENT: EnableTabAlert(frmPatientRecordTabs.tabSetAppointments, visibleOn, message); break; case TAB.VIEW_APPOINTMENT: EnableTabAlert(frmPatientRecordTabs.tabViewAppointments, visibleOn, message); break; case TAB.ROUTINE_CHECK: EnableTabAlert(frmPatientRecordTabs.tabRoutineCheck, visibleOn, message); break; case TAB.ORDER_TEST: EnableTabAlert(frmPatientRecordTabs.tabOrderTests, visibleOn, message); break; case TAB.TEST_RESULTS: EnableTabAlert(frmPatientRecordTabs.tabTestsResults, visibleOn, message); break; case TAB.DIAGNOSIS: EnableTabAlert(frmPatientRecordTabs.tabDiagnosis, visibleOn, message); break; default: break; } }
public void Iniciar() { Turno = 1; Vez = A; Branco = A; while (Rodando) { Console.Clear(); Console.WriteLine($"Jogador 1: {A.Nome}\t Jogador 2:{B.Nome}"); TAB.Imprimir(); goTurno(); if (Vez == A) { Vez = B; } else { Vez = A; } } }
private void ApplyFilters(String[] statuses, TAB activeTab, string colName, bool resetFilter) { GridViewColumn statusColumn = null; RadGridView radGrid = null; if (activeTab == TAB.MY_IDEAS) { radGrid = myideasGrid; } else if (activeTab == TAB.TEAM_IDEAS) { radGrid = myteamGrid; } else if (activeTab == TAB.FINANCE) { radGrid = financeGrid; } else if (activeTab == TAB.ADMIN) { BindGrid(statuses, resetFilter); return; } if (resetFilter) { statusColumn = radGrid.Columns[colName]; IColumnFilterDescriptor columnDescriptor = statusColumn.ColumnFilterDescriptor; columnDescriptor.SuspendNotifications(); //radGrid.FilterDescriptors.Clear(); columnDescriptor.DistinctFilter.Clear(); foreach (String status in statuses) { columnDescriptor.DistinctFilter.AddDistinctValue(status); } columnDescriptor.ResumeNotifications(); } }
/* * private void setQuantityTextVisible(bool isVisible) * { * Transform childPanel = buyLeftPanel.transform.FindChild("Quantities"); * Text quantities = childPanel.gameObject.GetComponent<Text>(); * quantities.gameObject.SetActive(isVisible); * * childPanel = buyCenterPanel.transform.FindChild("Quantities"); * quantities = childPanel.gameObject.GetComponent<Text>(); * quantities.gameObject.SetActive(isVisible); * * childPanel = buyRightPanel.transform.FindChild("Quantities"); * quantities = childPanel.gameObject.GetComponent<Text>(); * quantities.gameObject.SetActive(isVisible); * } */ public void changeOfTab(TAB index) { if (index != indexTabSelected) { indexTabSelected = index; selectedPage = 0; UpdateBuyList(true); updateDirButts(); if (index == TAB.TERRAIN_TOOLS) { //setQuantityTextVisible(false); if (!Tutorial_ConstructionMenu.init) { _tutMan.startTuto(new Tutorial_ConstructionMenu()); } } else { //setQuantityTextVisible(true); } } }
private void FormatControls(TextBlock activeBlock, TAB activeTab) { TextBlock[] textBlocks = null; if (activeTab == TAB.MY_IDEAS) { textBlocks = new TextBlock[] { txtdraft, txtall, txtfuture, txtapproved, txtactive } } ; else if (activeTab == TAB.TEAM_IDEAS) { textBlocks = new TextBlock[] { teamDraft, teamAll, teamFuture, teamApproved, teamActive } } ; else if (activeTab == TAB.ADMIN) { textBlocks = new TextBlock[] { btn_adminGBS, btn_adminGBT, btn_adminGCP, btn_adminPBMT, btn_adminWSGCAT, btn_adminALL } } ; else if (activeTab == TAB.FINANCE) { textBlocks = new TextBlock[] { btn_financeGBS, btn_financeGBT, btn_financeGCP, btn_financePBMT, btn_financeWSGCAT, btn_financeALL } } ; foreach (TextBlock textBlock in textBlocks) { textBlock.TextDecorations = TextDecorations.Underline; textBlock.FontWeight = FontWeights.Normal; textBlock.Foreground = new SolidColorBrush(Colors.Black); } activeBlock.FontWeight = FontWeights.Bold; activeBlock.TextDecorations = null; activeBlock.Foreground = new SolidColorBrush(Colors.Green); }
public void selectObjectTab() { indexTabSelected = TAB.OBJECTS; }
void init() { if (descriptionText == null) { descriptionText = GameObject.Find("BuyDescription").GetComponent <Text>(); //transform.find? +++++++ } if (nameText == null) { nameText = GameObject.Find("BuyName").GetComponent <Text>(); } if (priceText == null) { priceText = GameObject.Find("BuyPrice").GetComponent <Text>(); } if (buyButton == null) { buyButton = GameObject.Find("BuyButton").GetComponent <Button>(); } if (buyButtonText == null) { buyButtonText = GameObject.Find("BuyButtonText").GetComponent <Text>(); } if (buyLeftPanel == null) { buyLeftPanel = GameObject.Find("BuyItemsPanelLeft").GetComponent <RectTransform>(); } if (buyCenterPanel == null) { buyCenterPanel = GameObject.Find("BuyItemsPanelCenter").GetComponent <RectTransform>(); } if (buyRightPanel == null) { buyRightPanel = GameObject.Find("BuyItemsPanelRight").GetComponent <RectTransform>(); } if (leftButt == null) { leftButt = GameObject.Find("BuyLeftDir").GetComponent <Button>(); } if (rightButt == null) { rightButt = GameObject.Find("BuyRightDir").GetComponent <Button>(); } if (sideMenu == null) { sideMenu = GameObject.Find("SideMenu").GetComponent <SideMenu>(); } selectedPage = 0; indexTabSelected = TAB.OBJECTS; if (_tutMan.getState() == TutorialManager.STATES.TutInfoHouse4 || _tutMan.getState() == TutorialManager.STATES.TutPlantell_NO || _tutMan.getState() == TutorialManager.STATES.TutBuildingsB1_NO || _tutMan.getState() == TutorialManager.STATES.TutBuildingsB2_NO || _tutMan.getState() == TutorialManager.STATES.TutBuildingsB3_NO) { indexTabSelected = TAB.BUILDINGS; } UpdateBuyList(true); updateDirButts(); }
// GUI //------------------------------------------------------------------ void OnGUI() { int width = (int)position.width; int height = (int)position.height; if (_editor == null || _targetPortrait == null) { CloseDialog(); return; } //만약 Portriat가 바뀌었거나 Editor가 리셋되면 닫자 if (_editor != apEditor.CurrentEditor || _targetPortrait != apEditor.CurrentEditor._portrait) { CloseDialog(); return; } //Sorting Layer를 추가하자 if (_sortingLayerNames == null || _sortingLayerIDs == null) { _sortingLayerNames = new string[SortingLayer.layers.Length]; _sortingLayerIDs = new int[SortingLayer.layers.Length]; } else if (_sortingLayerNames.Length != SortingLayer.layers.Length || _sortingLayerIDs.Length != SortingLayer.layers.Length) { _sortingLayerNames = new string[SortingLayer.layers.Length]; _sortingLayerIDs = new int[SortingLayer.layers.Length]; } for (int i = 0; i < SortingLayer.layers.Length; i++) { _sortingLayerNames[i] = SortingLayer.layers[i].name; _sortingLayerIDs[i] = SortingLayer.layers[i].id; } int width_2Btn = (width - 14) / 2; EditorGUILayout.BeginHorizontal(GUILayout.Width(width), GUILayout.Height(25)); GUILayout.Space(5); if (apEditorUtil.ToggledButton(_editor.GetText(TEXT.DLG_Bake), _tab == TAB.Bake, width_2Btn, 25)) { _tab = TAB.Bake; } if (apEditorUtil.ToggledButton(_editor.GetText(TEXT.DLG_Setting), _tab == TAB.Options, width_2Btn, 25)) { _tab = TAB.Options; } EditorGUILayout.EndHorizontal(); if (_tab == TAB.Bake) { GUILayout.Space(5); // 1. Bake에 대한 UI //Bake 설정 //EditorGUILayout.LabelField(_editor.GetText(TEXT.DLG_BakeSetting));//"Bake Setting" //GUILayout.Space(5); EditorGUILayout.ObjectField(_editor.GetText(TEXT.DLG_Portrait), _targetPortrait, typeof(apPortrait), true); //"Portait" GUILayout.Space(5); //"Bake Scale" float prevBakeScale = _targetPortrait._bakeScale; _targetPortrait._bakeScale = EditorGUILayout.FloatField(_editor.GetText(TEXT.DLG_BakeScale), _targetPortrait._bakeScale); //"Z Per Depth" float prevBakeZSize = _targetPortrait._bakeZSize; _targetPortrait._bakeZSize = EditorGUILayout.FloatField(_editor.GetText(TEXT.DLG_ZPerDepth), _targetPortrait._bakeZSize); if (_targetPortrait._bakeZSize < 0.5f) { _targetPortrait._bakeZSize = 0.5f; } if (prevBakeScale != _targetPortrait._bakeScale || prevBakeZSize != _targetPortrait._bakeZSize) { apEditorUtil.SetEditorDirty(); } //Bake 버튼 GUILayout.Space(10); if (GUILayout.Button(_editor.GetText(TEXT.DLG_Bake), GUILayout.Height(45))) //"Bake" { GUI.FocusControl(null); //CheckChangedProperties(nextRootScale, nextZScale); apEditorUtil.SetEditorDirty(); //------------------------------------- // Bake 함수를 실행한다. << 중요오오오오 //------------------------------------- apBakeResult bakeResult = _editor.Controller.Bake(); _editor.Notification("[" + _targetPortrait.name + "] is Baked", false, false); if (bakeResult.NumUnlinkedExternalObject > 0) { EditorUtility.DisplayDialog(_editor.GetText(TEXT.BakeWarning_Title), _editor.GetTextFormat(TEXT.BakeWarning_Body, bakeResult.NumUnlinkedExternalObject), _editor.GetText(TEXT.Okay)); } //추가 3.29 : Bake 후에 Ambient를 체크하자 CheckAmbientAndCorrection(); } GUILayout.Space(10); apEditorUtil.GUI_DelimeterBoxH(width - 10); GUILayout.Space(10); //최적화 Bake EditorGUILayout.LabelField(_editor.GetText(TEXT.DLG_OptimizedBaking)); //"Optimized Baking" //"Target" apPortrait nextOptPortrait = (apPortrait)EditorGUILayout.ObjectField(_editor.GetText(TEXT.DLG_Target), _targetPortrait._bakeTargetOptPortrait, typeof(apPortrait), true); if (nextOptPortrait != _targetPortrait._bakeTargetOptPortrait) { //타겟을 바꾸었다. bool isChanged = false; if (nextOptPortrait != null) { //1. 다른 Portrait를 선택했다. if (!nextOptPortrait._isOptimizedPortrait) { //1-1. 최적화된 객체가 아니다. EditorUtility.DisplayDialog(_editor.GetText(TEXT.OptBakeError_Title), _editor.GetText(TEXT.OptBakeError_NotOptTarget_Body), _editor.GetText(TEXT.Close)); } else if (nextOptPortrait._bakeSrcEditablePortrait != _targetPortrait) { //1-2. 다른 대상으로부터 Bake된 Portrait같다. (물어보고 계속) bool isResult = EditorUtility.DisplayDialog(_editor.GetText(TEXT.OptBakeError_Title), _editor.GetText(TEXT.OptBakeError_SrcMatchError_Body), _editor.GetText(TEXT.Okay), _editor.GetText(TEXT.Cancel)); if (isResult) { //뭐 선택하겠다는데요 뭐.. isChanged = true; } } else { //1-3. 오케이. 변경 가능 isChanged = true; } } else { //2. 선택을 해제했다. isChanged = true; } if (isChanged) { //Target을 변경한다. apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _targetPortrait._bakeTargetOptPortrait = nextOptPortrait; } } string optBtnText = ""; if (_targetPortrait._bakeTargetOptPortrait != null) { //optBtnText = "Optimized Bake to\n[" + _targetPortrait._bakeTargetOptPortrait.gameObject.name + "]"; optBtnText = string.Format("{0}\n[{1}]", _editor.GetText(TEXT.DLG_OptimizedBakeTo), _targetPortrait._bakeTargetOptPortrait.gameObject.name); } else { //optBtnText = "Optimized Bake\n(Make New GameObject)"; optBtnText = _editor.GetText(TEXT.DLG_OptimizedBakeMakeNew); } GUILayout.Space(10); if (GUILayout.Button(optBtnText, GUILayout.Height(45))) { GUI.FocusControl(null); //CheckChangedProperties(nextRootScale, nextZScale); //Optimized Bake를 하자 apBakeResult bakeResult = _editor.Controller.OptimizedBake(_targetPortrait, _targetPortrait._bakeTargetOptPortrait); if (bakeResult.NumUnlinkedExternalObject > 0) { EditorUtility.DisplayDialog(_editor.GetText(TEXT.BakeWarning_Title), _editor.GetTextFormat(TEXT.BakeWarning_Body, bakeResult.NumUnlinkedExternalObject), _editor.GetText(TEXT.Okay)); } _editor.Notification("[" + _targetPortrait.name + "] is Baked (Optimized)", false, false); //추가 3.29 : Bake 후에 Ambient를 체크하자 CheckAmbientAndCorrection(); } } else { //Vector2 curScroll = (_tab == TAB.Bake) ? _scroll_Bake : _scroll_Options; _scroll_Options = EditorGUILayout.BeginScrollView(_scroll_Options, false, true, GUILayout.Width(width), GUILayout.Height(height - 30)); EditorGUILayout.BeginVertical(GUILayout.Width(width - 24)); GUILayout.Space(5); width -= 24; // 2. Option에 대한 UI //1. Gamma Space Space bool prevBakeGamma = _editor._isBakeColorSpaceToGamma; int iPrevColorSpace = prevBakeGamma ? 0 : 1; int iNextColorSpace = EditorGUILayout.Popup(_editor.GetUIWord(UIWORD.ColorSpace), iPrevColorSpace, _colorSpaceNames); if (iNextColorSpace != iPrevColorSpace) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); if (iNextColorSpace == 0) { //Gamma _editor._isBakeColorSpaceToGamma = true; } else { //Linear _editor._isBakeColorSpaceToGamma = false; } } GUILayout.Space(10); //2. Sorting Layer int prevSortingLayerID = _editor._portrait._sortingLayerID; int prevSortingOrder = _editor._portrait._sortingOrder; apPortrait.SORTING_ORDER_OPTION prevSortingLayerOption = _editor._portrait._sortingOrderOption; int layerIndex = -1; for (int i = 0; i < SortingLayer.layers.Length; i++) { if (SortingLayer.layers[i].id == _editor._portrait._sortingLayerID) { //찾았다. layerIndex = i; break; } } if (layerIndex < 0) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); //어라 레이어가 없는데용.. //초기화해야겠다. _editor._portrait._sortingLayerID = -1; if (SortingLayer.layers.Length > 0) { _editor._portrait._sortingLayerID = SortingLayer.layers[0].id; layerIndex = 0; } } int nextIndex = EditorGUILayout.Popup(_editor.GetText(TEXT.SortingLayer), layerIndex, _sortingLayerNames); //"Sorting Layer" if (nextIndex != layerIndex) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); //레이어가 변경되었다. if (nextIndex >= 0 && nextIndex < SortingLayer.layers.Length) { //LayerID 변경 _editor._portrait._sortingLayerID = SortingLayer.layers[nextIndex].id; } } //추가 19.8.18 : Sorting Order를 지정하는 방식을 3가지 + 미적용 1가지로 더 세분화 apPortrait.SORTING_ORDER_OPTION nextSortingLayerOption = (apPortrait.SORTING_ORDER_OPTION)EditorGUILayout.EnumPopup(_editor.GetText(TEXT.SortingOrderOption), _editor._portrait._sortingOrderOption); if (nextSortingLayerOption != _editor._portrait._sortingOrderOption) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _editor._portrait._sortingOrderOption = nextSortingLayerOption; } if (_editor._portrait._sortingOrderOption == apPortrait.SORTING_ORDER_OPTION.SetOrder) { //Set Order인 경우에만 한정 int nextOrder = EditorGUILayout.IntField(_editor.GetText(TEXT.SortingOrder), _editor._portrait._sortingOrder); //"Sorting Order" if (nextOrder != _editor._portrait._sortingOrder) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _editor._portrait._sortingOrder = nextOrder; } } GUILayout.Space(10); //3. 메카님 사용 여부 //EditorGUILayout.LabelField("Animation Settings"); bool prevIsUsingMecanim = _targetPortrait._isUsingMecanim; string prevMecanimPath = _targetPortrait._mecanimAnimClipResourcePath; _targetPortrait._isUsingMecanim = EditorGUILayout.Toggle(_editor.GetText(TEXT.IsMecanimAnimation), _targetPortrait._isUsingMecanim); //"Is Mecanim Animation" EditorGUILayout.LabelField(_editor.GetText(TEXT.AnimationClipExportPath)); //"Animation Clip Export Path" GUIStyle guiStyle_ChangeBtn = new GUIStyle(GUI.skin.button); guiStyle_ChangeBtn.margin = GUI.skin.textField.margin; guiStyle_ChangeBtn.border = GUI.skin.textField.border; EditorGUILayout.BeginHorizontal(GUILayout.Width(width), GUILayout.Height(20)); GUILayout.Space(5); EditorGUILayout.TextField(_targetPortrait._mecanimAnimClipResourcePath, GUILayout.Width(width - (70 + 15))); if (GUILayout.Button(_editor.GetText(TEXT.DLG_Change), guiStyle_ChangeBtn, GUILayout.Width(70), GUILayout.Height(18))) { string nextPath = EditorUtility.SaveFolderPanel("Select to export animation clips", "", ""); if (!string.IsNullOrEmpty(nextPath)) { if (apEditorUtil.IsInAssetsFolder(nextPath)) { //유효한 폴더인 경우 //중요 : 경로가 절대 경로로 찍힌다. //상대 경로로 바꾸자 apEditorUtil.PATH_INFO_TYPE pathInfoType = apEditorUtil.GetPathInfo(nextPath); if (pathInfoType == apEditorUtil.PATH_INFO_TYPE.Absolute_InAssetFolder) { //절대 경로 + Asset 폴더 안쪽이라면 //Debug.LogError("절대 경로가 리턴 되었다. : " + nextPath); nextPath = apEditorUtil.AbsolutePath2RelativePath(nextPath); //Debug.LogError(">> 상대 경로로 변경 : " + nextPath); } apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_BakeOptionChanged, _editor, _targetPortrait, _targetPortrait, false); _targetPortrait._mecanimAnimClipResourcePath = nextPath; } else { //유효한 폴더가 아닌 경우 //EditorUtility.DisplayDialog("Invalid Folder Path", "Invalid Clip Path", "Close"); EditorUtility.DisplayDialog( _editor.GetText(TEXT.DLG_AnimClipSavePathValidationError_Title), _editor.GetText(TEXT.DLG_AnimClipSavePathResetError_Body), _editor.GetText(TEXT.Close)); } } GUI.FocusControl(null); } EditorGUILayout.EndHorizontal(); GUILayout.Space(10); if (_guiContent_Setting_IsImportant == null) { _guiContent_Setting_IsImportant = apGUIContentWrapper.Make(_editor.GetText(TEXT.DLG_Setting_IsImportant), false, "When this setting is on, it always updates and the physics effect works."); } if (_guiContent_Setting_FPS == null) { _guiContent_Setting_FPS = apGUIContentWrapper.Make(_editor.GetText(TEXT.DLG_Setting_FPS), false, "This setting is used when <Important> is off"); } //4. Important //"Is Important" bool nextImportant = EditorGUILayout.Toggle(_guiContent_Setting_IsImportant.Content, _targetPortrait._isImportant); if (nextImportant != _targetPortrait._isImportant) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _targetPortrait._isImportant = nextImportant; } //"FPS (Important Off)" int nextFPS = EditorGUILayout.DelayedIntField(_guiContent_Setting_FPS.Content, _targetPortrait._FPS); if (_targetPortrait._FPS != nextFPS) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); if (nextFPS < 10) { nextFPS = 10; } _targetPortrait._FPS = nextFPS; } GUILayout.Space(10); //5. Billboard + Perspective apPortrait.BILLBOARD_TYPE nextBillboardType = (apPortrait.BILLBOARD_TYPE)EditorGUILayout.Popup(_editor.GetText(TEXT.DLG_Billboard), (int)_targetPortrait._billboardType, _billboardTypeNames); if (nextBillboardType != _targetPortrait._billboardType) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _targetPortrait._billboardType = nextBillboardType; } //추가 19.9.24 : Billboard인 경우 카메라의 SortMode를 OrthoGraphic으로 강제할지 여부 if (_targetPortrait._billboardType != apPortrait.BILLBOARD_TYPE.None) { GUILayout.Space(2); EditorGUILayout.BeginHorizontal(GUILayout.Width(width)); int width_Value = 30; int width_Label = width - (width_Value + 10); GUIStyle guiStyle_LabelWrapText = new GUIStyle(GUI.skin.label); guiStyle_LabelWrapText.wordWrap = true; GUILayout.Space(5); EditorGUILayout.LabelField(_editor.GetText(TEXT.SetSortMode2Orthographic), guiStyle_LabelWrapText, GUILayout.Width(width_Label)); bool nextForceSortModeToOrtho = EditorGUILayout.Toggle(_targetPortrait._isForceCamSortModeToOrthographic, GUILayout.Width(width_Value), GUILayout.Height(20)); if (nextForceSortModeToOrtho != _targetPortrait._isForceCamSortModeToOrthographic) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _targetPortrait._isForceCamSortModeToOrthographic = nextForceSortModeToOrtho; } EditorGUILayout.EndHorizontal(); } GUILayout.Space(10); //6. Shadow apPortrait.SHADOW_CASTING_MODE nextChastShadows = (apPortrait.SHADOW_CASTING_MODE)EditorGUILayout.EnumPopup(_editor.GetUIWord(UIWORD.CastShadows), _targetPortrait._meshShadowCastingMode); bool nextReceiveShaodw = EditorGUILayout.Toggle(_editor.GetUIWord(UIWORD.ReceiveShadows), _targetPortrait._meshReceiveShadow); if (nextChastShadows != _targetPortrait._meshShadowCastingMode || nextReceiveShaodw != _targetPortrait._meshReceiveShadow) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _targetPortrait._meshShadowCastingMode = nextChastShadows; _targetPortrait._meshReceiveShadow = nextReceiveShaodw; } GUILayout.Space(10); //#if UNITY_2018_1_OR_NEWER //변경 19.6.22 : LWRP 기능은 삭제 //Material Library를 열도록 하자 //>> 다시 변경 19.8.5 : Clipped Mesh 땜시 다시 열자 //7. LWRP //LWRP 쉐이더를 쓸지 여부와 다시 강제로 생성하기 버튼을 만들자. : 이건 2019부터 적용 (그 전에는 SRP용 처리가 안된다.) #if UNITY_2019_1_OR_NEWER bool prevUseLWRP = _editor._isUseSRP; int iPrevUseLWRP = prevUseLWRP ? 1 : 0; int iNextUseLWRP = EditorGUILayout.Popup(_editor.GetText(TEXT.RenderPipeline), iPrevUseLWRP, _renderPipelineNames); //"Render Pipeline" if (iNextUseLWRP != iPrevUseLWRP) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); if (iNextUseLWRP == 0) { //사용 안함 _editor._isUseSRP = false; } else { //LWRP 사용함 _editor._isUseSRP = true; } } GUILayout.Space(10); #endif //if(GUILayout.Button("Generate Lightweight Shaders")) //{ // apShaderGenerator shaderGenerator = new apShaderGenerator(); // shaderGenerator.GenerateLWRPShaders(); //} //GUILayout.Space(10); //#endif //8. VR Supported 19.9.24 추가 //VR Supported int iNextVRSupported = EditorGUILayout.Popup(_editor.GetText(TEXT.VROption), (int)_targetPortrait._vrSupportMode, _vrSupportModeLabel); if (iNextVRSupported != (int)_targetPortrait._vrSupportMode) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _targetPortrait._vrSupportMode = (apPortrait.VR_SUPPORT_MODE)iNextVRSupported; } if (_targetPortrait._vrSupportMode == apPortrait.VR_SUPPORT_MODE.SingleCamera) { //Single Camera인 경우, Clipping Mask의 크기를 결정해야한다. int iNextVRRTSize = EditorGUILayout.Popup(_editor.GetUIWord(UIWORD.MaskTextureSize), (int)_targetPortrait._vrRenderTextureSize, _vrRTSizeLabel); if (iNextVRRTSize != (int)_targetPortrait._vrRenderTextureSize) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _targetPortrait._vrRenderTextureSize = (apPortrait.VR_RT_SIZE)iNextVRRTSize; } } GUILayout.Space(10); //11.7 추가 : Ambient Light를 검은색으로 만든다. if (GUILayout.Button(_editor.GetText(TEXT.DLG_AmbientToBlack), GUILayout.Height(20))) { MakeAmbientLightToBlack(); } //CheckChangedProperties(nextRootScale, nextZScale); if (prevSortingLayerID != _editor._portrait._sortingLayerID || prevSortingOrder != _editor._portrait._sortingOrder || prevSortingLayerOption != _editor._portrait._sortingOrderOption || prevIsUsingMecanim != _targetPortrait._isUsingMecanim || !string.Equals(prevMecanimPath, _targetPortrait._mecanimAnimClipResourcePath) || prevBakeGamma != _editor._isBakeColorSpaceToGamma #if UNITY_2019_1_OR_NEWER || prevUseLWRP != _editor._isUseSRP #endif ) { apEditorUtil.SetEditorDirty(); _editor.SaveEditorPref(); } GUILayout.Space(height + 500); EditorGUILayout.EndVertical(); EditorGUILayout.EndScrollView(); } GUILayout.Space(5); }
// GUI //------------------------------------------------------------------ void OnGUI() { int width = (int)position.width; int height = (int)position.height; if (_editor == null || _targetPortrait == null) { CloseDialog(); return; } //만약 Portriat가 바뀌었거나 Editor가 리셋되면 닫자 if (_editor != apEditor.CurrentEditor || _targetPortrait != apEditor.CurrentEditor._portrait) { CloseDialog(); return; } //Sorting Layer를 추가하자 if (_sortingLayerNames == null || _sortingLayerIDs == null) { _sortingLayerNames = new string[SortingLayer.layers.Length]; _sortingLayerIDs = new int[SortingLayer.layers.Length]; } else if (_sortingLayerNames.Length != SortingLayer.layers.Length || _sortingLayerIDs.Length != SortingLayer.layers.Length) { _sortingLayerNames = new string[SortingLayer.layers.Length]; _sortingLayerIDs = new int[SortingLayer.layers.Length]; } for (int i = 0; i < SortingLayer.layers.Length; i++) { _sortingLayerNames[i] = SortingLayer.layers[i].name; _sortingLayerIDs[i] = SortingLayer.layers[i].id; } int width_2Btn = (width - 14) / 2; EditorGUILayout.BeginHorizontal(GUILayout.Width(width), GUILayout.Height(25)); GUILayout.Space(5); if (apEditorUtil.ToggledButton(_editor.GetText(TEXT.DLG_Bake), _tab == TAB.Bake, width_2Btn, 25)) { _tab = TAB.Bake; } if (apEditorUtil.ToggledButton(_editor.GetText(TEXT.DLG_Setting), _tab == TAB.Options, width_2Btn, 25)) { _tab = TAB.Options; } EditorGUILayout.EndHorizontal(); if (_tab == TAB.Bake) { GUILayout.Space(5); // 1. Bake에 대한 UI //Bake 설정 //EditorGUILayout.LabelField(_editor.GetText(TEXT.DLG_BakeSetting));//"Bake Setting" //GUILayout.Space(5); EditorGUILayout.ObjectField(_editor.GetText(TEXT.DLG_Portrait), _targetPortrait, typeof(apPortrait), true); //"Portait" GUILayout.Space(5); //"Bake Scale" float prevBakeScale = _targetPortrait._bakeScale; _targetPortrait._bakeScale = EditorGUILayout.FloatField(_editor.GetText(TEXT.DLG_BakeScale), _targetPortrait._bakeScale); //"Z Per Depth" float prevBakeZSize = _targetPortrait._bakeZSize; _targetPortrait._bakeZSize = EditorGUILayout.FloatField(_editor.GetText(TEXT.DLG_ZPerDepth), _targetPortrait._bakeZSize); if (_targetPortrait._bakeZSize < 0.5f) { _targetPortrait._bakeZSize = 0.5f; } if (prevBakeScale != _targetPortrait._bakeScale || prevBakeZSize != _targetPortrait._bakeZSize) { apEditorUtil.SetEditorDirty(); } //Bake 버튼 GUILayout.Space(10); if (GUILayout.Button(_editor.GetText(TEXT.DLG_Bake), GUILayout.Height(45))) //"Bake" { GUI.FocusControl(null); //CheckChangedProperties(nextRootScale, nextZScale); apEditorUtil.SetEditorDirty(); //------------------------------------- // Bake 함수를 실행한다. << 중요오오오오 //------------------------------------- apBakeResult bakeResult = _editor.Controller.Bake(); _editor.Notification("[" + _targetPortrait.name + "] is Baked", false, false); if (bakeResult.NumUnlinkedExternalObject > 0) { EditorUtility.DisplayDialog(_editor.GetText(TEXT.BakeWarning_Title), _editor.GetTextFormat(TEXT.BakeWarning_Body, bakeResult.NumUnlinkedExternalObject), _editor.GetText(TEXT.Okay)); } } GUILayout.Space(10); apEditorUtil.GUI_DelimeterBoxH(width - 10); GUILayout.Space(10); //최적화 Bake EditorGUILayout.LabelField(_editor.GetText(TEXT.DLG_OptimizedBaking)); //"Optimized Baking" //"Target" apPortrait nextOptPortrait = (apPortrait)EditorGUILayout.ObjectField(_editor.GetText(TEXT.DLG_Target), _targetPortrait._bakeTargetOptPortrait, typeof(apPortrait), true); if (nextOptPortrait != _targetPortrait._bakeTargetOptPortrait) { //타겟을 바꾸었다. bool isChanged = false; if (nextOptPortrait != null) { //1. 다른 Portrait를 선택했다. if (!nextOptPortrait._isOptimizedPortrait) { //1-1. 최적화된 객체가 아니다. EditorUtility.DisplayDialog(_editor.GetText(TEXT.OptBakeError_Title), _editor.GetText(TEXT.OptBakeError_NotOptTarget_Body), _editor.GetText(TEXT.Close)); } else if (nextOptPortrait._bakeSrcEditablePortrait != _targetPortrait) { //1-2. 다른 대상으로부터 Bake된 Portrait같다. (물어보고 계속) bool isResult = EditorUtility.DisplayDialog(_editor.GetText(TEXT.OptBakeError_Title), _editor.GetText(TEXT.OptBakeError_SrcMatchError_Body), _editor.GetText(TEXT.Okay), _editor.GetText(TEXT.Cancel)); if (isResult) { //뭐 선택하겠다는데요 뭐.. isChanged = true; } } else { //1-3. 오케이. 변경 가능 isChanged = true; } } else { //2. 선택을 해제했다. isChanged = true; } if (isChanged) { //Target을 변경한다. apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _targetPortrait._bakeTargetOptPortrait = nextOptPortrait; } } string optBtnText = ""; if (_targetPortrait._bakeTargetOptPortrait != null) { //optBtnText = "Optimized Bake to\n[" + _targetPortrait._bakeTargetOptPortrait.gameObject.name + "]"; optBtnText = string.Format("{0}\n[{1}]", _editor.GetText(TEXT.DLG_OptimizedBakeTo), _targetPortrait._bakeTargetOptPortrait.gameObject.name); } else { //optBtnText = "Optimized Bake\n(Make New GameObject)"; optBtnText = _editor.GetText(TEXT.DLG_OptimizedBakeMakeNew); } GUILayout.Space(10); if (GUILayout.Button(optBtnText, GUILayout.Height(45))) { GUI.FocusControl(null); //CheckChangedProperties(nextRootScale, nextZScale); //Optimized Bake를 하자 apBakeResult bakeResult = _editor.Controller.OptimizedBake(_targetPortrait, _targetPortrait._bakeTargetOptPortrait); if (bakeResult.NumUnlinkedExternalObject > 0) { EditorUtility.DisplayDialog(_editor.GetText(TEXT.BakeWarning_Title), _editor.GetTextFormat(TEXT.BakeWarning_Body, bakeResult.NumUnlinkedExternalObject), _editor.GetText(TEXT.Okay)); } _editor.Notification("[" + _targetPortrait.name + "] is Baked (Optimized)", false, false); } } else { //Vector2 curScroll = (_tab == TAB.Bake) ? _scroll_Bake : _scroll_Options; _scroll_Options = EditorGUILayout.BeginScrollView(_scroll_Options, false, true, GUILayout.Width(width), GUILayout.Height(height - 30)); EditorGUILayout.BeginVertical(GUILayout.Width(width - 24)); GUILayout.Space(5); width -= 24; // 2. Option에 대한 UI //1. Gamma Space Space bool prevBakeGamma = _editor._isBakeColorSpaceToGamma; int iPrevColorSpace = prevBakeGamma ? 0 : 1; int iNextColorSpace = EditorGUILayout.Popup(_editor.GetUIWord(UIWORD.ColorSpace), iPrevColorSpace, _colorSpaceNames); if (iNextColorSpace != iPrevColorSpace) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); if (iNextColorSpace == 0) { //Gamma _editor._isBakeColorSpaceToGamma = true; } else { //Linear _editor._isBakeColorSpaceToGamma = false; } } GUILayout.Space(10); //2. Sorting Layer int prevSortingLayerID = _editor._portrait._sortingLayerID; int prevSortingOrder = _editor._portrait._sortingOrder; int layerIndex = -1; for (int i = 0; i < SortingLayer.layers.Length; i++) { if (SortingLayer.layers[i].id == _editor._portrait._sortingLayerID) { //찾았다. layerIndex = i; break; } } if (layerIndex < 0) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); //어라 레이어가 없는데용.. //초기화해야겠다. _editor._portrait._sortingLayerID = -1; if (SortingLayer.layers.Length > 0) { _editor._portrait._sortingLayerID = SortingLayer.layers[0].id; layerIndex = 0; } } int nextIndex = EditorGUILayout.Popup(_editor.GetText(TEXT.SortingLayer), layerIndex, _sortingLayerNames); //"Sorting Layer" if (nextIndex != layerIndex) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); //레이어가 변경되었다. if (nextIndex >= 0 && nextIndex < SortingLayer.layers.Length) { //LayerID 변경 _editor._portrait._sortingLayerID = SortingLayer.layers[nextIndex].id; } } _editor._portrait._sortingOrder = EditorGUILayout.IntField(_editor.GetText(TEXT.SortingOrder), _editor._portrait._sortingOrder); //"Sorting Order" GUILayout.Space(10); //3. 메카님 사용 여부 //EditorGUILayout.LabelField("Animation Settings"); bool prevIsUsingMecanim = _targetPortrait._isUsingMecanim; string prevMecanimPath = _targetPortrait._mecanimAnimClipResourcePath; _targetPortrait._isUsingMecanim = EditorGUILayout.Toggle(_editor.GetText(TEXT.IsMecanimAnimation), _targetPortrait._isUsingMecanim); //"Is Mecanim Animation" EditorGUILayout.LabelField(_editor.GetText(TEXT.AnimationClipExportPath)); //"Animation Clip Export Path" GUIStyle guiStyle_ChangeBtn = new GUIStyle(GUI.skin.button); guiStyle_ChangeBtn.margin = GUI.skin.textField.margin; guiStyle_ChangeBtn.border = GUI.skin.textField.border; EditorGUILayout.BeginHorizontal(GUILayout.Width(width), GUILayout.Height(20)); GUILayout.Space(5); EditorGUILayout.TextField(_targetPortrait._mecanimAnimClipResourcePath, GUILayout.Width(width - (70 + 15))); if (GUILayout.Button(_editor.GetText(TEXT.DLG_Change), guiStyle_ChangeBtn, GUILayout.Width(70), GUILayout.Height(18))) { string defaultPath = _targetPortrait._mecanimAnimClipResourcePath; if (string.IsNullOrEmpty(defaultPath)) { defaultPath = Application.dataPath; } string nextPath = EditorUtility.SaveFolderPanel("Select to export animation clips", defaultPath, ""); if (!string.IsNullOrEmpty(nextPath)) { if (apEditorUtil.IsInAssetsFolder(nextPath)) { //유효한 폴더인 경우 _targetPortrait._mecanimAnimClipResourcePath = nextPath; } else { //유효한 폴더가 아닌 경우 EditorUtility.DisplayDialog("Invalid Folder Path", "Invalid Clip Path", "Close"); } } GUI.FocusControl(null); } EditorGUILayout.EndHorizontal(); GUILayout.Space(10); //4. Important //"Is Important" bool nextImportant = EditorGUILayout.Toggle(new GUIContent(_editor.GetText(TEXT.DLG_Setting_IsImportant), "When this setting is on, it always updates and the physics effect works."), _targetPortrait._isImportant); if (nextImportant != _targetPortrait._isImportant) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _targetPortrait._isImportant = nextImportant; } //"FPS (Important Off)" int nextFPS = EditorGUILayout.DelayedIntField(new GUIContent(_editor.GetText(TEXT.DLG_Setting_FPS), "This setting is used when <Important> is off"), _targetPortrait._FPS); if (_targetPortrait._FPS != nextFPS) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); if (nextFPS < 10) { nextFPS = 10; } _targetPortrait._FPS = nextFPS; } GUILayout.Space(10); //5. Billboard + Perspective apPortrait.BILLBOARD_TYPE nextBillboardType = (apPortrait.BILLBOARD_TYPE)EditorGUILayout.Popup(_editor.GetText(TEXT.DLG_Billboard), (int)_targetPortrait._billboardType, _billboardTypeNames); if (nextBillboardType != _targetPortrait._billboardType) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _targetPortrait._billboardType = nextBillboardType; } GUILayout.Space(10); //6. Shadow apPortrait.SHADOW_CASTING_MODE nextChastShadows = (apPortrait.SHADOW_CASTING_MODE)EditorGUILayout.EnumPopup(_editor.GetUIWord(UIWORD.CastShadows), _targetPortrait._meshShadowCastingMode); bool nextReceiveShaodw = EditorGUILayout.Toggle(_editor.GetUIWord(UIWORD.ReceiveShadows), _targetPortrait._meshReceiveShadow); if (nextChastShadows != _targetPortrait._meshShadowCastingMode || nextReceiveShaodw != _targetPortrait._meshReceiveShadow) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _targetPortrait._meshShadowCastingMode = nextChastShadows; _targetPortrait._meshReceiveShadow = nextReceiveShaodw; } GUILayout.Space(10); #if UNITY_2018_2_OR_NEWER //7. LWRP //LWRP 쉐이더를 쓸지 여부와 다시 강제로 생성하기 버튼을 만들자. bool prevUseLWRP = _editor._isUseLWRPShader; int iPrevUseLWRP = prevUseLWRP ? 1 : 0; int iNextUseLWRP = EditorGUILayout.Popup("Render Pipeline", iPrevUseLWRP, _renderPipelineNames); if (iNextUseLWRP != iPrevUseLWRP) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); if (iNextUseLWRP == 0) { //사용 안함 _editor._isUseLWRPShader = false; } else { //LWRP 사용함 _editor._isUseLWRPShader = true; } } if (GUILayout.Button("Generate Lightweight Shaders")) { apShaderGenerator shaderGenerator = new apShaderGenerator(); shaderGenerator.GenerateLWRPShaders(); } GUILayout.Space(10); #endif //11.7 추가 : Ambient Light를 검은색으로 만든다. GUILayout.Space(10); if (GUILayout.Button(_editor.GetText(TEXT.DLG_AmbientToBlack), GUILayout.Height(20))) { MakeAmbientLightToBlack(); } //CheckChangedProperties(nextRootScale, nextZScale); if (prevSortingLayerID != _editor._portrait._sortingLayerID || prevSortingOrder != _editor._portrait._sortingOrder || prevIsUsingMecanim != _targetPortrait._isUsingMecanim || !string.Equals(prevMecanimPath, _targetPortrait._mecanimAnimClipResourcePath) || prevBakeGamma != _editor._isBakeColorSpaceToGamma #if UNITY_2018_2_OR_NEWER || prevUseLWRP != _editor._isUseLWRPShader #endif ) { apEditorUtil.SetEditorDirty(); _editor.SaveEditorPref(); } GUILayout.Space(height + 500); EditorGUILayout.EndVertical(); EditorGUILayout.EndScrollView(); } GUILayout.Space(5); }
// GUI //------------------------------------------------------------------ void OnGUI() { int width = (int)position.width; int height = (int)position.height; if (_editor == null || _targetPortrait == null) { Debug.LogError("Exit - Editor / Portrait is Null"); CloseDialog(); return; } //만약 Portriat가 바뀌었거나 Editor가 리셋되면 닫자 if (_editor != apEditor.CurrentEditor || _targetPortrait != apEditor.CurrentEditor._portrait) { Debug.LogError("Exit - Editor / Portrait Missmatch"); CloseDialog(); return; } int tabBtnHeight = 25; int tabBtnWidth = ((width - 10) / 3) - 4; EditorGUILayout.BeginHorizontal(GUILayout.Width(width), GUILayout.Height(tabBtnHeight)); GUILayout.Space(5); if (apEditorUtil.ToggledButton("Portrait", _tab == TAB.PortriatSetting, tabBtnWidth, tabBtnHeight)) { _tab = TAB.PortriatSetting; } if (apEditorUtil.ToggledButton("Editor", _tab == TAB.EditorSetting, tabBtnWidth, tabBtnHeight)) { _tab = TAB.EditorSetting; } if (apEditorUtil.ToggledButton("About", _tab == TAB.About, tabBtnWidth, tabBtnHeight)) { _tab = TAB.About; } EditorGUILayout.EndHorizontal(); GUILayout.Space(5); int scrollHeight = height - 40; _scroll = EditorGUILayout.BeginScrollView(_scroll, false, true, GUILayout.Width(width), GUILayout.Height(scrollHeight)); width -= 25; GUILayout.BeginVertical(GUILayout.Width(width)); switch (_tab) { case TAB.PortriatSetting: { //Portrait 설정 EditorGUILayout.LabelField("Portrait Settings"); GUILayout.Space(10); string nextName = EditorGUILayout.DelayedTextField("Name", _targetPortrait.name); if (nextName != _targetPortrait.name) { _targetPortrait.name = nextName; } int nextFPS = EditorGUILayout.DelayedIntField("Update FPS", _targetPortrait._FPS); if (_targetPortrait._FPS != nextFPS) { if (nextFPS < 10) { nextFPS = 10; } _targetPortrait._FPS = nextFPS; } bool nextGPUAcc = EditorGUILayout.Toggle("GPU Acceleration", _targetPortrait._isGPUAccel); if (nextGPUAcc != _targetPortrait._isGPUAccel) { _targetPortrait._isGPUAccel = nextGPUAcc; } } break; case TAB.EditorSetting: { EditorGUILayout.LabelField("Editor Settings"); GUILayout.Space(10); apEditor.LANGUAGE prevLanguage = _editor._language; bool prevGUIFPS = _editor._guiOption_isFPSVisible; Color prevColor_Background = _editor._colorOption_Background; Color prevColor_GridCenter = _editor._colorOption_GridCenter; Color prevColor_Grid = _editor._colorOption_Grid; Color prevColor_MeshEdge = _editor._colorOption_MeshEdge; Color prevColor_MeshHiddenEdge = _editor._colorOption_MeshHiddenEdge; Color prevColor_Outline = _editor._colorOption_Outline; Color prevColor_TFBorder = _editor._colorOption_TransformBorder; Color prevColor_VertNotSelected = _editor._colorOption_VertColor_NotSelected; Color prevColor_VertSelected = _editor._colorOption_VertColor_Selected; Color prevColor_GizmoFFDLine = _editor._colorOption_GizmoFFDLine; Color prevColor_GizmoFFDInnerLine = _editor._colorOption_GizmoFFDInnerLine; _editor._language = (apEditor.LANGUAGE)EditorGUILayout.EnumPopup("Language", _editor._language); GUILayout.Space(10); _editor._guiOption_isFPSVisible = EditorGUILayout.Toggle("Show FPS", _editor._guiOption_isFPSVisible); GUILayout.Space(10); try { int width_Btn = 65; int width_Color = width - (width_Btn + 8); int height_Color = 18; EditorGUILayout.LabelField("Background Colors"); //EditorGUILayout.BeginHorizontal(GUILayout.Width(width), GUILayout.Height(height_Color)); //GUILayout.Space(5); //_editor._colorOption_Background = EditorGUILayout.ColorField("Background", _editor._colorOption_Background, GUILayout.Width(width_Color), GUILayout.Height(height_Color)); //if(GUILayout.Button("Default", GUILayout.Width(width_Btn), GUILayout.Height(height_Color))) //{ // _editor._colorOption_Background = apEditor.DefaultColor_Background; //} //EditorGUILayout.EndHorizontal(); //_editor._colorOption_GridCenter = EditorGUILayout.ColorField("Grid Center", _editor._colorOption_GridCenter); //_editor._colorOption_Grid = EditorGUILayout.ColorField("Grid", _editor._colorOption_Grid); //_editor._colorOption_AtlasBorder = EditorGUILayout.ColorField("Atlas Border", _editor._colorOption_AtlasBorder); _editor._colorOption_Background = ColorUI("Background", _editor._colorOption_Background, width, apEditor.DefaultColor_Background); _editor._colorOption_GridCenter = ColorUI("Grid Center", _editor._colorOption_GridCenter, width, apEditor.DefaultColor_GridCenter); _editor._colorOption_Grid = ColorUI("Grid", _editor._colorOption_Grid, width, apEditor.DefaultColor_Grid); _editor._colorOption_AtlasBorder = ColorUI("Atlas Border", _editor._colorOption_AtlasBorder, width, apEditor.DefaultColor_AtlasBorder); GUILayout.Space(5); EditorGUILayout.LabelField("Mesh GUI Colors"); //_editor._colorOption_MeshEdge = EditorGUILayout.ColorField("Mesh Edge", _editor._colorOption_MeshEdge); //_editor._colorOption_MeshHiddenEdge = EditorGUILayout.ColorField("Mesh Hidden Edge", _editor._colorOption_MeshHiddenEdge); //_editor._colorOption_Outline = EditorGUILayout.ColorField("Outline", _editor._colorOption_Outline); //_editor._colorOption_TransformBorder = EditorGUILayout.ColorField("Transform Border", _editor._colorOption_TransformBorder); //_editor._colorOption_VertColor_NotSelected = EditorGUILayout.ColorField("Vertex", _editor._colorOption_VertColor_NotSelected); //_editor._colorOption_VertColor_Selected = EditorGUILayout.ColorField("Selected Vertex", _editor._colorOption_VertColor_Selected); _editor._colorOption_MeshEdge = ColorUI("Mesh Edge", _editor._colorOption_MeshEdge, width, apEditor.DefaultColor_MeshEdge); _editor._colorOption_MeshHiddenEdge = ColorUI("Mesh Hidden Edge", _editor._colorOption_MeshHiddenEdge, width, apEditor.DefaultColor_MeshHiddenEdge); _editor._colorOption_Outline = ColorUI("Outline", _editor._colorOption_Outline, width, apEditor.DefaultColor_Outline); _editor._colorOption_TransformBorder = ColorUI("Transform Border", _editor._colorOption_TransformBorder, width, apEditor.DefaultColor_TransformBorder); _editor._colorOption_VertColor_NotSelected = ColorUI("Vertex", _editor._colorOption_VertColor_NotSelected, width, apEditor.DefaultColor_VertNotSelected); _editor._colorOption_VertColor_Selected = ColorUI("Selected Vertex", _editor._colorOption_VertColor_Selected, width, apEditor.DefaultColor_VertSelected); GUILayout.Space(5); EditorGUILayout.LabelField("Gizmo Colors"); //_editor._colorOption_GizmoFFDLine = EditorGUILayout.ColorField("FFD Line", _editor._colorOption_GizmoFFDLine); //_editor._colorOption_GizmoFFDInnerLine = EditorGUILayout.ColorField("FFD Inner Line", _editor._colorOption_GizmoFFDInnerLine); _editor._colorOption_GizmoFFDLine = ColorUI("FFD Line", _editor._colorOption_GizmoFFDLine, width, apEditor.DefaultColor_GizmoFFDLine); _editor._colorOption_GizmoFFDInnerLine = ColorUI("FFD Inner Line", _editor._colorOption_GizmoFFDInnerLine, width, apEditor.DefaultColor_GizmoFFDInnerLine); } catch (Exception) { } GUILayout.Space(20); if (GUILayout.Button("Restore Editor Default Setting", GUILayout.Height(20))) { _editor.RestoreEditorPref(); } if (prevLanguage != _editor._language || prevGUIFPS != _editor._guiOption_isFPSVisible || prevColor_Background != _editor._colorOption_Background || prevColor_GridCenter != _editor._colorOption_GridCenter || prevColor_Grid != _editor._colorOption_Grid || prevColor_MeshEdge != _editor._colorOption_MeshEdge || prevColor_MeshHiddenEdge != _editor._colorOption_MeshHiddenEdge || prevColor_Outline != _editor._colorOption_Outline || prevColor_TFBorder != _editor._colorOption_TransformBorder || prevColor_VertNotSelected != _editor._colorOption_VertColor_NotSelected || prevColor_VertSelected != _editor._colorOption_VertColor_Selected || prevColor_GizmoFFDLine != _editor._colorOption_GizmoFFDLine || prevColor_GizmoFFDInnerLine != _editor._colorOption_GizmoFFDInnerLine) { _editor.SaveEditorPref(); } } break; case TAB.About: { EditorGUILayout.LabelField("About"); GUILayout.Space(20); apEditorUtil.GUI_DelimeterBoxH(width); GUILayout.Space(20); EditorGUILayout.LabelField("[AnyPortrait]"); GUILayout.Space(10); EditorGUILayout.LabelField("Copyright (c) 2017 RainyRizzle. All right reserved."); GUILayout.Space(20); apEditorUtil.GUI_DelimeterBoxH(width); GUILayout.Space(20); EditorGUILayout.LabelField("[PSD File Import Library]"); GUILayout.Space(10); EditorGUILayout.LabelField("Ntreev Photoshop Document Parser for .Net"); GUILayout.Space(10); EditorGUILayout.LabelField("Released under the MIT License."); GUILayout.Space(10); EditorGUILayout.LabelField("Copyright (c) 2015 Ntreev Soft co., Ltd."); GUILayout.Space(10); EditorGUILayout.LabelField("Permission is hereby granted, free of charge,"); EditorGUILayout.LabelField("to any person obtaining a copy of this software"); EditorGUILayout.LabelField("and associated documentation files (the \"Software\"),"); EditorGUILayout.LabelField("to deal in the Software without restriction,"); EditorGUILayout.LabelField("including without limitation the rights "); EditorGUILayout.LabelField("to use, copy, modify, merge, publish, distribute,"); EditorGUILayout.LabelField("sublicense, and/or sell copies of the Software, "); EditorGUILayout.LabelField("and to permit persons to whom the Software is furnished"); EditorGUILayout.LabelField("to do so, subject to the following conditions:"); GUILayout.Space(10); EditorGUILayout.LabelField("The above copyright notice and "); EditorGUILayout.LabelField("this permission notice shall be included"); EditorGUILayout.LabelField("in all copies or substantial portions of the Software."); GUILayout.Space(10); EditorGUILayout.LabelField("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT "); EditorGUILayout.LabelField("WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, "); EditorGUILayout.LabelField("INCLUDING BUT NOT LIMITED TO THE WARRANTIES "); EditorGUILayout.LabelField("OF MERCHANTABILITY, FITNESS FOR A PARTICULAR "); EditorGUILayout.LabelField("PURPOSE AND NONINFRINGEMENT. "); EditorGUILayout.LabelField("IN NO EVENT SHALL THE AUTHORS OR "); EditorGUILayout.LabelField("COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES "); EditorGUILayout.LabelField("OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, "); EditorGUILayout.LabelField("TORT OR OTHERWISE, ARISING FROM, OUT OF OR "); EditorGUILayout.LabelField("IN CONNECTION WITH THE SOFTWARE OR "); EditorGUILayout.LabelField("THE USE OR OTHER DEALINGS IN THE SOFTWARE."); GUILayout.Space(20); apEditorUtil.GUI_DelimeterBoxH(width); GUILayout.Space(20); EditorGUILayout.LabelField("[GIF Export Library]"); GUILayout.Space(10); EditorGUILayout.LabelField("NGif, Animated GIF Encoder for .NET"); GUILayout.Space(10); EditorGUILayout.LabelField("Released under the CPOL 1.02."); GUILayout.Space(10); } break; } GUILayout.Space(height); EditorGUILayout.EndVertical(); EditorGUILayout.EndScrollView(); }
private void ApplyFilters(String[] statuses, TAB activeTab, string colName) { ApplyFilters(statuses, activeTab, colName, true); }
public void selectUpgradeTab() { indexTabSelected = TAB.BUILDINGS; }
protected void goTurno() { bool continuar = true; int lin = 0; int col = -1; while (continuar) { lin = -1; col = -1; Console.WriteLine($"{Vez.Nome} selecione uma peça"); while (!(lin > 0 && lin <= 8)) { Console.WriteLine($"Informe a linha(1-8):"); string res = Console.ReadLine(); if (int.TryParse(res, out lin)) { lin = int.Parse(res); } } lin = 8 - lin; while (!(col >= 0 && col < 8)) { Console.WriteLine($"Informe a linha(A-H):"); char c = Console.ReadKey().KeyChar; c = Char.ToUpper(c); col = TAB.getValorColuna(c); Console.WriteLine(""); } int tp = 0; if (Vez == Branco) { tp = 1; } if (TAB.Tbl[lin, col].Tipo != tp) { Console.WriteLine($"Peça não perce a você!"); continue; } TAB.preparaTurno(); TAB.Tbl[lin, col].mostrarMovimentos(TAB); if (!TAB.validarTurno()) { Console.WriteLine($"Peça sem possibilidade de movimentos!"); continue; } int s = -1; while (s < 0) { Console.WriteLine($"Deseja Confirmar a Seleção [S,N]"); char sc = Console.ReadKey().KeyChar; sc = Char.ToUpper(sc); if (sc == 'S') { s = 1; } else if (sc == 'N') { s = 0; } Console.WriteLine(""); } if (s == 1) { continuar = false; } else { TAB.preparaTurno(); } } goSetTurno(lin, col); TAB.preparaTurno(); }
// GUI //------------------------------------------------------------------ void OnGUI() { int width = (int)position.width; int height = (int)position.height; if (_editor == null || _targetPortrait == null) { //Debug.LogError("Exit - Editor / Portrait is Null"); CloseDialog(); return; } //만약 Portriat가 바뀌었거나 Editor가 리셋되면 닫자 if (_editor != apEditor.CurrentEditor || _targetPortrait != apEditor.CurrentEditor._portrait) { //Debug.LogError("Exit - Editor / Portrait Missmatch"); CloseDialog(); return; } int tabBtnHeight = 25; int tabBtnWidth = ((width - 10) / 3) - 4; EditorGUILayout.BeginHorizontal(GUILayout.Width(width), GUILayout.Height(tabBtnHeight)); GUILayout.Space(5); if (apEditorUtil.ToggledButton(_editor.GetText(TEXT.DLG_Portrait), _tab == TAB.PortriatSetting, tabBtnWidth, tabBtnHeight)) //"Portrait" { _tab = TAB.PortriatSetting; } if (apEditorUtil.ToggledButton(_editor.GetText(TEXT.DLG_Editor), _tab == TAB.EditorSetting, tabBtnWidth, tabBtnHeight)) //"Editor" { _tab = TAB.EditorSetting; } if (apEditorUtil.ToggledButton(_editor.GetText(TEXT.DLG_About), _tab == TAB.About, tabBtnWidth, tabBtnHeight)) //"About" { _tab = TAB.About; } EditorGUILayout.EndHorizontal(); GUILayout.Space(5); int scrollHeight = height - 40; _scroll = EditorGUILayout.BeginScrollView(_scroll, false, true, GUILayout.Width(width), GUILayout.Height(scrollHeight)); width -= 25; GUILayout.BeginVertical(GUILayout.Width(width)); switch (_tab) { case TAB.PortriatSetting: { //Portrait 설정 EditorGUILayout.LabelField(_editor.GetText(TEXT.DLG_PortraitSetting)); //"Portrait Settings" GUILayout.Space(10); string nextName = EditorGUILayout.DelayedTextField(_editor.GetText(TEXT.DLG_Name), _targetPortrait.name); //"Name" if (nextName != _targetPortrait.name) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _targetPortrait.name = nextName; } //"FPS (Important Off)" int nextFPS = EditorGUILayout.DelayedIntField(new GUIContent(_editor.GetText(TEXT.DLG_Setting_FPS), "This setting is used when <Important> is off"), _targetPortrait._FPS); if (_targetPortrait._FPS != nextFPS) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); if (nextFPS < 10) { nextFPS = 10; } _targetPortrait._FPS = nextFPS; } //"Is Important" bool nextImportant = EditorGUILayout.Toggle(new GUIContent(_editor.GetText(TEXT.DLG_Setting_IsImportant), "When this setting is on, it always updates and the physics effect works."), _targetPortrait._isImportant); if (nextImportant != _targetPortrait._isImportant) { apEditorUtil.SetRecord_Portrait(apUndoGroupData.ACTION.Portrait_SettingChanged, _editor, _targetPortrait, null, false); _targetPortrait._isImportant = nextImportant; } GUILayout.Space(10); //수동으로 백업하기 if (GUILayout.Button(_editor.GetText(TEXT.DLG_Setting_ManualBackUp), GUILayout.Height(30))) //"Save Backup (Manual)" { if (_editor.Backup.IsAutoSaveWorking()) { EditorUtility.DisplayDialog(_editor.GetText(TEXT.BackupError_Title), _editor.GetText(TEXT.BackupError_Body), _editor.GetText(TEXT.Okay)); } else { string defaultBackupFileName = _targetPortrait.name + "_backup_" + apBackup.GetCurrentTimeString(); string savePath = EditorUtility.SaveFilePanel("Backup File Path", "", defaultBackupFileName, "bck"); if (string.IsNullOrEmpty(savePath)) { _editor.Notification("Backup Canceled", true, false); } else { _editor.Backup.SaveBackup(savePath, _targetPortrait); _editor.Notification("Backup Saved [" + savePath + "]", false, true); } CloseDialog(); } } } break; case TAB.EditorSetting: { EditorGUILayout.LabelField(_editor.GetText(TEXT.DLG_EditorSetting)); //"Editor Settings" GUILayout.Space(10); apEditor.LANGUAGE prevLanguage = _editor._language; int prevLangIndex = -1; for (int i = 0; i < _validLanguageIndex.Length; i++) { if (_validLanguageIndex[i] == (int)prevLanguage) { prevLangIndex = i; } } if (prevLangIndex < 0) { prevLangIndex = 0; //English 강제 } bool prevGUIFPS = _editor._guiOption_isFPSVisible; bool prevGUIStatistics = _editor._guiOption_isStatisticsVisible; Color prevColor_Background = _editor._colorOption_Background; Color prevColor_GridCenter = _editor._colorOption_GridCenter; Color prevColor_Grid = _editor._colorOption_Grid; Color prevColor_MeshEdge = _editor._colorOption_MeshEdge; Color prevColor_MeshHiddenEdge = _editor._colorOption_MeshHiddenEdge; Color prevColor_Outline = _editor._colorOption_Outline; Color prevColor_TFBorder = _editor._colorOption_TransformBorder; Color prevColor_VertNotSelected = _editor._colorOption_VertColor_NotSelected; Color prevColor_VertSelected = _editor._colorOption_VertColor_Selected; Color prevColor_GizmoFFDLine = _editor._colorOption_GizmoFFDLine; Color prevColor_GizmoFFDInnerLine = _editor._colorOption_GizmoFFDInnerLine; Color prevColor_ToneColor = _editor._colorOption_OnionToneColor; bool prevBackup_IsAutoSave = _editor._backupOption_IsAutoSave; string prevBackup_Path = _editor._backupOption_BaseFolderName; int prevBackup_Time = _editor._backupOption_Minute; string prevBonePose_Path = _editor._bonePose_BaseFolderName; //"Language" //이전 방식은 Enum을 모두 조회 //_editor._language = (apEditor.LANGUAGE)EditorGUILayout.Popup(_editor.GetText(TEXT.DLG_Setting_Language), (int)_editor._language, _strLanguageName); //사용 가능한 Language만 따로 조회 int nextLangIndex = EditorGUILayout.Popup(_editor.GetText(TEXT.DLG_Setting_Language), prevLangIndex, _strLanguageName); _editor._language = (apEditor.LANGUAGE)_validLanguageIndex[nextLangIndex]; GUILayout.Space(10); _editor._guiOption_isFPSVisible = EditorGUILayout.Toggle(_editor.GetText(TEXT.DLG_Setting_ShowFPS), _editor._guiOption_isFPSVisible); //"Show FPS" _editor._guiOption_isStatisticsVisible = EditorGUILayout.Toggle(_editor.GetText(TEXT.DLG_Setting_ShowStatistics), _editor._guiOption_isStatisticsVisible); // "Show Statistics" GUILayout.Space(10); EditorGUILayout.LabelField(_editor.GetText(TEXT.DLG_Setting_AutoBackupSetting)); //"Auto Backup Option" _editor._backupOption_IsAutoSave = EditorGUILayout.Toggle(_editor.GetText(TEXT.DLG_Setting_AutoBackup), _editor._backupOption_IsAutoSave); //"Auto Backup" if (_editor._backupOption_IsAutoSave) { //경로와 시간 //"Time (Min)" _editor._backupOption_Minute = EditorGUILayout.IntField(_editor.GetText(TEXT.DLG_Setting_BackupTime), _editor._backupOption_Minute, GUILayout.Width(width)); EditorGUILayout.BeginHorizontal(GUILayout.Width(width), GUILayout.Height(18)); GUILayout.Space(5); //"Save Path" _editor._backupOption_BaseFolderName = EditorGUILayout.TextField(_editor.GetText(TEXT.DLG_Setting_BackupPath), _editor._backupOption_BaseFolderName, GUILayout.Width(width - 100), GUILayout.Height(18)); if (GUILayout.Button(_editor.GetText(TEXT.DLG_Change), GUILayout.Width(90), GUILayout.Height(18))) //"Change" { string pathResult = EditorUtility.SaveFolderPanel("Set the Backup Folder", _editor._backupOption_BaseFolderName, ""); if (!string.IsNullOrEmpty(pathResult)) { //Debug.Log("백업 폴더 경로 [" + pathResult + "] - " + Application.dataPath); Uri targetUri = new Uri(pathResult); Uri baseUri = new Uri(Application.dataPath); string relativePath = baseUri.MakeRelativeUri(targetUri).ToString(); _editor._backupOption_BaseFolderName = relativePath; //Debug.Log("상대 경로 [" + relativePath + "]"); apEditorUtil.SetEditorDirty(); } } EditorGUILayout.EndHorizontal(); } GUILayout.Space(10); EditorGUILayout.LabelField(_editor.GetText(TEXT.DLG_Setting_PoseSnapshotSetting)); //"Pose Snapshot Option" EditorGUILayout.BeginHorizontal(GUILayout.Width(width), GUILayout.Height(18)); GUILayout.Space(5); //"Save Path" _editor._bonePose_BaseFolderName = EditorGUILayout.TextField(_editor.GetText(TEXT.DLG_Setting_BackupPath), _editor._bonePose_BaseFolderName, GUILayout.Width(width - 100), GUILayout.Height(18)); if (GUILayout.Button(_editor.GetText(TEXT.DLG_Change), GUILayout.Width(90), GUILayout.Height(18))) //"Change" { string pathResult = EditorUtility.SaveFolderPanel("Set the Pose Folder", _editor._bonePose_BaseFolderName, ""); if (!string.IsNullOrEmpty(pathResult)) { Uri targetUri = new Uri(pathResult); Uri baseUri = new Uri(Application.dataPath); string relativePath = baseUri.MakeRelativeUri(targetUri).ToString(); _editor._bonePose_BaseFolderName = relativePath; apEditorUtil.SetEditorDirty(); } } EditorGUILayout.EndHorizontal(); GUILayout.Space(10); try { //int width_Btn = 65; //int width_Color = width - (width_Btn + 8); //int height_Color = 18; EditorGUILayout.LabelField(_editor.GetText(TEXT.DLG_Setting_BackgroundColors)); //"Background Colors" //"Background" _editor._colorOption_Background = ColorUI(_editor.GetText(TEXT.DLG_Setting_Background), _editor._colorOption_Background, width, apEditor.DefaultColor_Background); //"Grid Center" _editor._colorOption_GridCenter = ColorUI(_editor.GetText(TEXT.DLG_Setting_GridCenter), _editor._colorOption_GridCenter, width, apEditor.DefaultColor_GridCenter); //"Grid" _editor._colorOption_Grid = ColorUI(_editor.GetText(TEXT.DLG_Setting_Grid), _editor._colorOption_Grid, width, apEditor.DefaultColor_Grid); //"Atlas Border" _editor._colorOption_AtlasBorder = ColorUI(_editor.GetText(TEXT.DLG_Setting_AtlasBorder), _editor._colorOption_AtlasBorder, width, apEditor.DefaultColor_AtlasBorder); GUILayout.Space(5); EditorGUILayout.LabelField(_editor.GetText(TEXT.DLG_Setting_MeshGUIColors)); //"Mesh GUI Colors" //"Mesh Edge" _editor._colorOption_MeshEdge = ColorUI(_editor.GetText(TEXT.DLG_Setting_MeshEdge), _editor._colorOption_MeshEdge, width, apEditor.DefaultColor_MeshEdge); //"Mesh Hidden Edge" _editor._colorOption_MeshHiddenEdge = ColorUI(_editor.GetText(TEXT.DLG_Setting_MeshHiddenEdge), _editor._colorOption_MeshHiddenEdge, width, apEditor.DefaultColor_MeshHiddenEdge); //"Outline" _editor._colorOption_Outline = ColorUI(_editor.GetText(TEXT.DLG_Setting_Outline), _editor._colorOption_Outline, width, apEditor.DefaultColor_Outline); //"Transform Border" _editor._colorOption_TransformBorder = ColorUI(_editor.GetText(TEXT.DLG_Setting_TransformBorder), _editor._colorOption_TransformBorder, width, apEditor.DefaultColor_TransformBorder); //"Vertex" _editor._colorOption_VertColor_NotSelected = ColorUI(_editor.GetText(TEXT.DLG_Setting_Vertex), _editor._colorOption_VertColor_NotSelected, width, apEditor.DefaultColor_VertNotSelected); //"Selected Vertex" _editor._colorOption_VertColor_Selected = ColorUI(_editor.GetText(TEXT.DLG_Setting_SelectedVertex), _editor._colorOption_VertColor_Selected, width, apEditor.DefaultColor_VertSelected); GUILayout.Space(5); EditorGUILayout.LabelField(_editor.GetText(TEXT.DLG_Setting_GizmoColors)); //"Gizmo Colors" //"FFD Line" _editor._colorOption_GizmoFFDLine = ColorUI(_editor.GetText(TEXT.DLG_Setting_FFDLine), _editor._colorOption_GizmoFFDLine, width, apEditor.DefaultColor_GizmoFFDLine); //"FFD Inner Line" _editor._colorOption_GizmoFFDInnerLine = ColorUI(_editor.GetText(TEXT.DLG_Setting_FFDInnerLine), _editor._colorOption_GizmoFFDInnerLine, width, apEditor.DefaultColor_GizmoFFDInnerLine); GUILayout.Space(5); EditorGUILayout.LabelField(_editor.GetText(TEXT.DLG_Setting_OnionSkinColor)); //"Onion Skin Color" //"Onion Skin (2x)" _editor._colorOption_OnionToneColor = ColorUI(_editor.GetText(TEXT.DLG_Setting_OnionSkinColor2X), _editor._colorOption_OnionToneColor, width, apEditor.DefaultColor_OnionToneColor); } catch (Exception) { } GUILayout.Space(10); bool prevStartupScreen = _editor._startScreenOption_IsShowStartup; EditorGUILayout.BeginHorizontal(GUILayout.Width(width), GUILayout.Height(25)); GUILayout.Space(5); EditorGUILayout.LabelField(_editor.GetText(TEXT.DLG_StartPage_AlawysOn), GUILayout.Width((width - (10 + 30)))); _editor._startScreenOption_IsShowStartup = EditorGUILayout.Toggle(_editor._startScreenOption_IsShowStartup, GUILayout.Width(30)); EditorGUILayout.EndHorizontal(); GUILayout.Space(20); //"Restore Editor Default Setting" if (GUILayout.Button(_editor.GetText(TEXT.DLG_Setting_RestoreDefaultSetting), GUILayout.Height(20))) { _editor.RestoreEditorPref(); } if (prevLanguage != _editor._language || prevGUIFPS != _editor._guiOption_isFPSVisible || prevGUIStatistics != _editor._guiOption_isStatisticsVisible || prevColor_Background != _editor._colorOption_Background || prevColor_GridCenter != _editor._colorOption_GridCenter || prevColor_Grid != _editor._colorOption_Grid || prevColor_MeshEdge != _editor._colorOption_MeshEdge || prevColor_MeshHiddenEdge != _editor._colorOption_MeshHiddenEdge || prevColor_Outline != _editor._colorOption_Outline || prevColor_TFBorder != _editor._colorOption_TransformBorder || prevColor_VertNotSelected != _editor._colorOption_VertColor_NotSelected || prevColor_VertSelected != _editor._colorOption_VertColor_Selected || prevColor_GizmoFFDLine != _editor._colorOption_GizmoFFDLine || prevColor_GizmoFFDInnerLine != _editor._colorOption_GizmoFFDInnerLine || prevColor_ToneColor != _editor._colorOption_OnionToneColor || prevBackup_IsAutoSave != _editor._backupOption_IsAutoSave || !prevBackup_Path.Equals(_editor._backupOption_BaseFolderName) || prevBackup_Time != _editor._backupOption_Minute || !prevBonePose_Path.Equals(_editor._bonePose_BaseFolderName) || prevStartupScreen != _editor._startScreenOption_IsShowStartup ) { bool isLanguageChanged = (prevLanguage != _editor._language); _editor.SaveEditorPref(); apEditorUtil.SetEditorDirty(); apGL.SetToneColor(_editor._colorOption_OnionToneColor); if (isLanguageChanged) { _editor.ResetHierarchyAll(); _editor.RefreshTimelineLayers(true); _editor.RefreshControllerAndHierarchy(); } } } break; case TAB.About: { EditorGUILayout.LabelField(_editor.GetText(TEXT.DLG_About)); //"About" GUILayout.Space(20); apEditorUtil.GUI_DelimeterBoxH(width); GUILayout.Space(20); EditorGUILayout.LabelField("[AnyPortrait]"); EditorGUILayout.LabelField("Build : " + apVersion.I.APP_VERSION_NUMBER_ONLY); GUILayout.Space(20); apEditorUtil.GUI_DelimeterBoxH(width); GUILayout.Space(20); EditorGUILayout.LabelField("[Open Source Library License]"); GUILayout.Space(20); EditorGUILayout.LabelField("[PSD File Import Library]"); GUILayout.Space(10); EditorGUILayout.LabelField("Ntreev Photoshop Document Parser for .Net"); GUILayout.Space(10); EditorGUILayout.LabelField("Released under the MIT License."); GUILayout.Space(10); EditorGUILayout.LabelField("Copyright (c) 2015 Ntreev Soft co., Ltd."); GUILayout.Space(10); EditorGUILayout.LabelField("Permission is hereby granted, free of charge,"); EditorGUILayout.LabelField("to any person obtaining a copy of this software"); EditorGUILayout.LabelField("and associated documentation files (the \"Software\"),"); EditorGUILayout.LabelField("to deal in the Software without restriction,"); EditorGUILayout.LabelField("including without limitation the rights "); EditorGUILayout.LabelField("to use, copy, modify, merge, publish, distribute,"); EditorGUILayout.LabelField("sublicense, and/or sell copies of the Software, "); EditorGUILayout.LabelField("and to permit persons to whom the Software is furnished"); EditorGUILayout.LabelField("to do so, subject to the following conditions:"); GUILayout.Space(10); EditorGUILayout.LabelField("The above copyright notice and "); EditorGUILayout.LabelField("this permission notice shall be included"); EditorGUILayout.LabelField("in all copies or substantial portions of the Software."); GUILayout.Space(10); EditorGUILayout.LabelField("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT "); EditorGUILayout.LabelField("WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, "); EditorGUILayout.LabelField("INCLUDING BUT NOT LIMITED TO THE WARRANTIES "); EditorGUILayout.LabelField("OF MERCHANTABILITY, FITNESS FOR A PARTICULAR "); EditorGUILayout.LabelField("PURPOSE AND NONINFRINGEMENT. "); EditorGUILayout.LabelField("IN NO EVENT SHALL THE AUTHORS OR "); EditorGUILayout.LabelField("COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES "); EditorGUILayout.LabelField("OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, "); EditorGUILayout.LabelField("TORT OR OTHERWISE, ARISING FROM, OUT OF OR "); EditorGUILayout.LabelField("IN CONNECTION WITH THE SOFTWARE OR "); EditorGUILayout.LabelField("THE USE OR OTHER DEALINGS IN THE SOFTWARE."); GUILayout.Space(20); apEditorUtil.GUI_DelimeterBoxH(width); GUILayout.Space(20); EditorGUILayout.LabelField("[GIF Export Library]"); GUILayout.Space(10); EditorGUILayout.LabelField("NGif, Animated GIF Encoder for .NET"); GUILayout.Space(10); EditorGUILayout.LabelField("Released under the CPOL 1.02."); GUILayout.Space(10); } break; } GUILayout.Space(height); EditorGUILayout.EndVertical(); EditorGUILayout.EndScrollView(); }
protected void goSetTurno(int lOld, int cOld) { bool continuar = true; int lin = 0; int col = -1; while (continuar) { lin = -1; col = -1; while (!(lin > 0 && lin <= 8)) { Console.WriteLine($"Informe a linha Destino(1-8):"); string res = Console.ReadLine(); if (int.TryParse(res, out lin)) { lin = int.Parse(res); } } lin = 8 - lin; while (!(col >= 0 && col < 8)) { Console.WriteLine($"Informe a Coluna Destino(A-H):"); char c = Console.ReadKey().KeyChar; c = Char.ToUpper(c); col = TAB.getValorColuna(c); Console.WriteLine(""); } if (TAB.Tbl[lin, col] == null || !(TAB.Tbl[lin, col].Tipo == 3 || TAB.Tbl[lin, col].Atacado)) { Console.WriteLine($"Movimento errado!"); continue; } int s = -1; while (s < 0) { Console.WriteLine($"Deseja Confirmar o Movimento [S,N]"); char sc = Console.ReadKey().KeyChar; sc = Char.ToUpper(sc); if (sc == 'S') { s = 1; } else if (sc == 'N') { s = 0; } Console.WriteLine(""); } if (s == 1) { continuar = false; } } TAB.Tbl[lin, col] = TAB.Tbl[lOld, cOld]; TAB.Tbl[lOld, cOld] = null; TAB.Tbl[lin, col].setPosicao(lin, col); TAB.Tbl[lin, col].Turnos++; }
// GUI //------------------------------------------------------------------------------------------------ private void OnGUI() { int width = (int)position.width; int height = (int)position.height; width -= 10; //만약 이 다이얼로그가 켜진 상태로 뭔가 바뀌었다면 종료 bool isClose = false; bool isMoveAnimKeyframe = false; bool isMoveAnimKeyframeToNext = false; if (_editor == null || _meshGroup == null || _modifier == null || _modMesh == null || _renderUnit == null) { //데이터가 없다. isClose = true; } else if (_editor.Select.SelectionType != _selectionType) { //선택 타입이 바뀌었다. isClose = true; } else { if (!_isAnimEdit) { //1. 일반 모디파이어 편집시 //- 현재 선택된 MeshGroup이 바뀌었다면 //- 현재 선택된 Modifier가 바뀌었다면 //- Modifier 메뉴가 아니라면 //- ExEditingMode가 꺼졌다면 //> 해제 if (_editor.Select.ExEditingMode == apSelection.EX_EDIT.None || _editor.Select.MeshGroup != _meshGroup || _editor.Select.Modifier != _modifier || _editor._meshGroupEditMode != apEditor.MESHGROUP_EDIT_MODE.Modifier) { isClose = true; } } else { //2. 애니메이션 편집 시 //- 현재 선택된 AnimationClip이 바뀌었다면 //- 현재 선택된 MeshGroup이 바뀌었다면 (AnimClip이 있을 때) //- AnimExEditingMode가 꺼졌다면 //- 재생 중이라면 //> 해제 if (_editor.Select.ExAnimEditingMode == apSelection.EX_EDIT.None || _editor.Select.AnimClip != _animClip || _animClip == null || _keyframe == null || _editor.Select.AnimClip._targetMeshGroup != _meshGroup || _editor.Select.IsAnimPlaying) { isClose = true; } } } if (isClose) { CloseDialog(); return; } //------------------------------------------------------------ //1. 선택된 객체 정보 //- RenderUnit 아이콘과 이름 //2. <애니메이션인 경우> //- 현재 키프레임과 키프레임 이동하기 //3. 가중치 //- [일반] Weight CutOut //- [Anim] Prev / Next CutOut // (구분선) //4. Depth //- 아이콘과 Chainging Depth 레이블 //- On / Off 버튼 //- Depth 증감과 리스트 (좌우에 배치) //5. Texture (RenderUnit이 MeshTransform인 경우) //- 현재 텍스쳐 //- 바뀔 텍스쳐 //- 텍스쳐 선택하기 버튼 //1. 선택된 객체 정보 //- RenderUnit 아이콘과 이름 //int iconSize = 25; GUIStyle guiStyle_TargetBox = new GUIStyle(GUI.skin.box); guiStyle_TargetBox.alignment = TextAnchor.MiddleCenter; Color prevColor = GUI.backgroundColor; // RenderUnit 이름 Texture2D iconRenderUnit = null; if (_renderUnit._meshTransform != null) { iconRenderUnit = _editor.ImageSet.Get(apImageSet.PRESET.Hierarchy_Mesh); } else { iconRenderUnit = _editor.ImageSet.Get(apImageSet.PRESET.Hierarchy_MeshGroup); } GUI.backgroundColor = new Color(0.5f, 1.0f, 1.0f, 1.0f); GUILayout.Box(new GUIContent(" " + _renderUnit.Name, iconRenderUnit), guiStyle_TargetBox, GUILayout.Width(width), GUILayout.Height(30)); GUI.backgroundColor = prevColor; GUILayout.Space(5); //"Extra Property ON", "Extra Property OFF" if (apEditorUtil.ToggledButton_2Side(_editor.GetText(TEXT.ExtraOpt_ExtraPropertyOn), _editor.GetText(TEXT.ExtraOpt_ExtraPropertyOff), _modMesh._isExtraValueEnabled, true, width, 25)) { apEditorUtil.SetRecord_Modifier(apUndoGroupData.ACTION.Modifier_SettingChanged, _editor, _modifier, _modMesh._extraValue, false); _modMesh._isExtraValueEnabled = !_modMesh._isExtraValueEnabled; _meshGroup.RefreshModifierLink(); //<<옵션의 형태가 바뀌면 Modifier의 Link를 다시 해야한다. apEditorUtil.ReleaseGUIFocus(); } GUILayout.Space(5); if (_isAnimEdit) { GUILayout.Space(10); //2. <애니메이션인 경우> //- 현재 키프레임과 키프레임 이동하기 //"Target Frame" EditorGUILayout.LabelField(_editor.GetText(TEXT.ExtraOpt_TargetFrame)); int frameBtnSize = 20; int frameCurBtnWidth = 100; int frameMoveBtnWidth = (width - (10 + frameCurBtnWidth)) / 2; EditorGUILayout.BeginHorizontal(GUILayout.Width(width), GUILayout.Height(frameBtnSize)); GUILayout.Space(5); if (GUILayout.Button(_editor.ImageSet.Get(apImageSet.PRESET.Anim_MoveToPrevFrame), GUILayout.Width(frameMoveBtnWidth), GUILayout.Height(frameBtnSize))) { //이전 프레임으로 이동하기 isMoveAnimKeyframe = true; isMoveAnimKeyframeToNext = false; } if (GUILayout.Button(_keyframe._frameIndex.ToString(), GUILayout.Width(frameCurBtnWidth), GUILayout.Height(frameBtnSize))) { _animClip.SetFrame_Editor(_keyframe._frameIndex); _editor.SetRepaint(); } if (GUILayout.Button(_editor.ImageSet.Get(apImageSet.PRESET.Anim_MoveToNextFrame), GUILayout.Width(frameMoveBtnWidth), GUILayout.Height(frameBtnSize))) { //다음 프레임으로 이동하기 isMoveAnimKeyframe = true; isMoveAnimKeyframeToNext = true; } EditorGUILayout.EndHorizontal(); } GUILayout.Space(10); //3. 가중치 //- [일반] Weight CutOut //- [Anim] Prev / Next CutOut EditorGUILayout.LabelField(_editor.GetText(TEXT.ExtraOpt_WeightSettings)); //"Weight Settings" GUILayout.Space(5); if (!_isAnimEdit) { //일반이면 CutOut이 1개 float cutOut = EditorGUILayout.DelayedFloatField(_editor.GetText(TEXT.ExtraOpt_Offset), _modMesh._extraValue._weightCutout); //"Offset (0~1)" if (cutOut != _modMesh._extraValue._weightCutout) { cutOut = Mathf.Clamp01(cutOut); apEditorUtil.SetRecord_Modifier(apUndoGroupData.ACTION.Modifier_SettingChanged, _editor, _modifier, _modMesh._extraValue, false); _modMesh._extraValue._weightCutout = cutOut; apEditorUtil.ReleaseGUIFocus(); } } else { //애니메이션이면 CutOut이 2개 EditorGUILayout.LabelField(_editor.GetText(TEXT.ExtraOpt_Offset)); float animPrevCutOut = EditorGUILayout.DelayedFloatField(_editor.GetText(TEXT.ExtraOpt_OffsetPrevKeyframe), _modMesh._extraValue._weightCutout_AnimPrev); //"Prev Keyframe" float animNextCutOut = EditorGUILayout.DelayedFloatField(_editor.GetText(TEXT.ExtraOpt_OffsetNextKeyframe), _modMesh._extraValue._weightCutout_AnimNext); //"Next Keyframe" if (animPrevCutOut != _modMesh._extraValue._weightCutout_AnimPrev || animNextCutOut != _modMesh._extraValue._weightCutout_AnimNext ) { animPrevCutOut = Mathf.Clamp01(animPrevCutOut); animNextCutOut = Mathf.Clamp01(animNextCutOut); apEditorUtil.SetRecord_Modifier(apUndoGroupData.ACTION.Modifier_SettingChanged, _editor, _modifier, _modMesh._extraValue, false); _modMesh._extraValue._weightCutout_AnimPrev = animPrevCutOut; _modMesh._extraValue._weightCutout_AnimNext = animNextCutOut; apEditorUtil.ReleaseGUIFocus(); } } GUILayout.Space(10); apEditorUtil.GUI_DelimeterBoxH(width); GUILayout.Space(10); int tabBtnWidth = ((width - 10) / 2); int tabBtnHeight = 25; EditorGUILayout.BeginHorizontal(GUILayout.Width(width), GUILayout.Height(tabBtnHeight)); GUILayout.Space(5); if (apEditorUtil.ToggledButton(_editor.GetText(TEXT.ExtraOpt_Tab_Depth), _tab == TAB.Depth, tabBtnWidth, tabBtnHeight)) //"Depth" { _tab = TAB.Depth; } if (apEditorUtil.ToggledButton(_editor.GetText(TEXT.ExtraOpt_Tab_Image), _tab == TAB.Image, tabBtnWidth, tabBtnHeight)) //"Image" { _tab = TAB.Image; } EditorGUILayout.EndHorizontal(); GUILayout.Space(10); if (_tab == TAB.Depth) { //4. Depth //- 아이콘과 Chainging Depth 레이블 //- On / Off 버튼 //- Depth 증감과 리스트 (좌우에 배치) EditorGUILayout.LabelField(_editor.GetText(TEXT.ExtraOpt_ChangingDepth)); //"Changing Depth" GUILayout.Space(5); //"Depth Option ON", "Depth Option OFF" if (apEditorUtil.ToggledButton_2Side(_editor.GetText(TEXT.ExtraOpt_DepthOptOn), _editor.GetText(TEXT.ExtraOpt_DepthOptOff), _modMesh._extraValue._isDepthChanged, _modMesh._isExtraValueEnabled, width, 25)) { apEditorUtil.SetRecord_Modifier(apUndoGroupData.ACTION.Modifier_SettingChanged, _editor, _modifier, _modMesh._extraValue, false); _modMesh._extraValue._isDepthChanged = !_modMesh._extraValue._isDepthChanged; _meshGroup.RefreshModifierLink(); //<<Modifier Link를 다시 해야한다. _editor.SetRepaint(); } GUILayout.Space(5); bool isDepthAvailable = _modMesh._extraValue._isDepthChanged && _modMesh._isExtraValueEnabled; int depthListWidth_Left = 80; int depthListWidth_Right = width - (10 + depthListWidth_Left); int depthListWidth_RightInner = depthListWidth_Right - 20; int depthListHeight = 276; //int depthListHeight_LeftBtn = (depthListHeight - 40) / 2; int depthListHeight_LeftBtn = 40; int depthListHeight_LeftSpace = (depthListHeight - (40 + depthListHeight_LeftBtn * 2)) / 2; int depthListHeight_RightList = 20; //리스트 배경 Rect lastRect = GUILayoutUtility.GetLastRect(); if (!isDepthAvailable) { GUI.backgroundColor = new Color(1.0f, 0.6f, 0.6f, 1.0f); } GUI.Box(new Rect(5 + depthListWidth_Left + 8, lastRect.y + 8, depthListWidth_Right, depthListHeight), ""); if (!isDepthAvailable) { GUI.backgroundColor = prevColor; } EditorGUILayout.BeginHorizontal(GUILayout.Width(width), GUILayout.Height(depthListHeight)); GUILayout.Space(5); EditorGUILayout.BeginVertical(GUILayout.Width(depthListWidth_Left), GUILayout.Height(depthListHeight)); // Depth List의 왼쪽 // Depth 증감 버튼과 값 GUILayout.Space(depthListHeight_LeftSpace); Texture2D img_AddWeight = _editor.ImageSet.Get(apImageSet.PRESET.Rig_AddWeight); Texture2D img_SubtractWeight = _editor.ImageSet.Get(apImageSet.PRESET.Rig_SubtractWeight); //if (GUILayout.Button(, GUILayout.Width(depthListWidth_Left), GUILayout.Height(depthListHeight_LeftBtn))) if (apEditorUtil.ToggledButton(img_AddWeight, false, isDepthAvailable, depthListWidth_Left, depthListHeight_LeftBtn)) { //Depth 증가 apEditorUtil.SetRecord_Modifier(apUndoGroupData.ACTION.Modifier_SettingChanged, _editor, _modifier, _modMesh._extraValue, false); _modMesh._extraValue._deltaDepth++; _editor.SetRepaint(); apEditorUtil.ReleaseGUIFocus(); } //"Delta Depth" EditorGUILayout.LabelField(_editor.GetText(TEXT.ExtraOpt_DeltaDepth), GUILayout.Width(depthListWidth_Left)); int deltaDepth = EditorGUILayout.DelayedIntField(_modMesh._extraValue._deltaDepth, GUILayout.Width(depthListWidth_Left)); if (deltaDepth != _modMesh._extraValue._deltaDepth) { if (isDepthAvailable) { apEditorUtil.SetRecord_Modifier(apUndoGroupData.ACTION.Modifier_SettingChanged, _editor, _modifier, _modMesh._extraValue, false); _modMesh._extraValue._deltaDepth = deltaDepth; _editor.SetRepaint(); apEditorUtil.ReleaseGUIFocus(); } } //if (GUILayout.Button(_editor.ImageSet.Get(apImageSet.PRESET.Rig_SubtractWeight), GUILayout.Width(depthListWidth_Left), GUILayout.Height(depthListHeight_LeftBtn))) if (apEditorUtil.ToggledButton(img_SubtractWeight, false, isDepthAvailable, depthListWidth_Left, depthListHeight_LeftBtn)) { //Depth 감소 apEditorUtil.SetRecord_Modifier(apUndoGroupData.ACTION.Modifier_SettingChanged, _editor, _modifier, _modMesh._extraValue, false); _modMesh._extraValue._deltaDepth--; _editor.SetRepaint(); apEditorUtil.ReleaseGUIFocus(); } EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical(GUILayout.Width(depthListWidth_Right), GUILayout.Height(depthListHeight)); // RenderUnit 리스트와 변환될 Depth 위치 _scrollList = EditorGUILayout.BeginScrollView(_scrollList, false, true, GUILayout.Width(depthListWidth_Right), GUILayout.Height(depthListHeight)); EditorGUILayout.BeginVertical(GUILayout.Width(depthListWidth_RightInner), GUILayout.Height(depthListHeight)); GUILayout.Space(5); SubUnit curSubUnit = null; //int cursorDepth = _renderUnit.GetDepth() + _modMesh._extraValue._deltaDepth; int cursorDepth = _targetDepth + _modMesh._extraValue._deltaDepth; //GUI Content 생성 [11.16 수정] if (_guiContent_DepthMidCursor == null) { _guiContent_DepthMidCursor = apGUIContentWrapper.Make(_img_DepthMidCursor); } if (_guiContent_DepthCursor == null) { _guiContent_DepthCursor = apGUIContentWrapper.Make(_img_DepthCursor); } if (_guiContent_MeshIcon == null) { _guiContent_MeshIcon = apGUIContentWrapper.Make(_img_MeshTF); } if (_guiContent_MeshGroupIcon == null) { _guiContent_MeshGroupIcon = apGUIContentWrapper.Make(_img_MeshGroupTF); } //이전 코드 //GUIContent guiContent_DepthMidCursor = new GUIContent(_img_DepthMidCursor); //GUIContent guiContent_DepthCursor = new GUIContent(_img_DepthCursor); //GUIContent guiContent_MeshIcon = new GUIContent(_img_MeshTF); //GUIContent guiContent_MeshGroupIcon = new GUIContent(_img_MeshGroupTF); int depthCursorSize = depthListHeight_RightList; for (int i = 0; i < _subUnits_All.Count; i++) { curSubUnit = _subUnits_All[i]; if (curSubUnit._isTarget) { //타겟이면 배경색을 그려주자 lastRect = GUILayoutUtility.GetLastRect(); if (EditorGUIUtility.isProSkin) { GUI.backgroundColor = new Color(0.0f, 1.0f, 1.0f, 1.0f); } else { GUI.backgroundColor = new Color(0.4f, 0.8f, 1.0f, 1.0f); } int yOffset = 6; if (i == 0) { yOffset = 7 - depthListHeight_RightList; } GUI.Box(new Rect(lastRect.x, lastRect.y + depthListHeight_RightList + yOffset, depthListWidth_RightInner + 10, depthListHeight_RightList), ""); GUI.backgroundColor = prevColor; } EditorGUILayout.BeginHorizontal(GUILayout.Width(depthListWidth_RightInner), GUILayout.Height(depthListHeight_RightList)); //TODO : Depth 커서 그려주기 //GUILayout.Space(20); DEPTH_CURSOR_TYPE depthCursorType = DEPTH_CURSOR_TYPE.None; if (!curSubUnit._isTarget) { if (cursorDepth != _targetDepth) { if (cursorDepth == curSubUnit._depth) { depthCursorType = DEPTH_CURSOR_TYPE.Target; } else { if (cursorDepth > _targetDepth) { //Depth가 증가했을 때 if (_targetDepth < curSubUnit._depth && curSubUnit._depth < cursorDepth) { depthCursorType = DEPTH_CURSOR_TYPE.Mid; } } else { //Depth가 감소했을 때 if (cursorDepth < curSubUnit._depth && curSubUnit._depth < _targetDepth) { depthCursorType = DEPTH_CURSOR_TYPE.Mid; } } } } } else { if (cursorDepth != _targetDepth) { depthCursorType = DEPTH_CURSOR_TYPE.Mid; } else { depthCursorType = DEPTH_CURSOR_TYPE.Target; } } GUILayout.Space(5); switch (depthCursorType) { case DEPTH_CURSOR_TYPE.None: GUILayout.Space(depthCursorSize + 4); break; case DEPTH_CURSOR_TYPE.Mid: EditorGUILayout.LabelField(_guiContent_DepthMidCursor.Content, GUILayout.Width(depthCursorSize), GUILayout.Height(depthCursorSize)); break; case DEPTH_CURSOR_TYPE.Target: EditorGUILayout.LabelField(_guiContent_DepthCursor.Content, GUILayout.Width(depthCursorSize), GUILayout.Height(depthCursorSize)); break; } EditorGUILayout.LabelField(curSubUnit._isMeshTransform ? _guiContent_MeshIcon.Content : _guiContent_MeshGroupIcon.Content, GUILayout.Width(depthCursorSize), GUILayout.Height(depthCursorSize)); EditorGUILayout.LabelField(curSubUnit._depth.ToString(), GUILayout.Width(20), GUILayout.Height(depthListHeight_RightList)); EditorGUILayout.LabelField(curSubUnit._name, GUILayout.Width(depthListWidth_RightInner - (24 + 5 + depthCursorSize + depthCursorSize + 20 + 8)), GUILayout.Height(depthListHeight_RightList) ); EditorGUILayout.EndHorizontal(); } GUILayout.Space(depthListHeight + 100); EditorGUILayout.EndVertical(); EditorGUILayout.EndScrollView(); EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); } else { //5. Texture (RenderUnit이 MeshTransform인 경우) //- 현재 텍스쳐 //- 바뀔 텍스쳐 //- 텍스쳐 선택하기 버튼 //"Changing Image" EditorGUILayout.LabelField(_editor.GetText(TEXT.ExtraOpt_ChangingImage)); GUILayout.Space(5); //"Image Option ON", "Image Option OFF" if (apEditorUtil.ToggledButton_2Side(_editor.GetText(TEXT.ExtraOpt_ImageOptOn), _editor.GetText(TEXT.ExtraOpt_ImageOptOff), _modMesh._extraValue._isTextureChanged, _isImageChangable && _modMesh._isExtraValueEnabled, width, 25)) { apEditorUtil.SetRecord_Modifier(apUndoGroupData.ACTION.Modifier_SettingChanged, _editor, _modifier, _modMesh._extraValue, false); _modMesh._extraValue._isTextureChanged = !_modMesh._extraValue._isTextureChanged; _meshGroup.RefreshModifierLink(); //<<Modifier Link를 다시 해야한다. _editor.SetRepaint(); } GUILayout.Space(5); bool isTextureAvailable = _modMesh._extraValue._isTextureChanged && _isImageChangable && _modMesh._isExtraValueEnabled; int imageSlotSize = 170; int imageSlotSpaceSize = width - (imageSlotSize * 2 + 6 + 10); int imageSlotHeight = imageSlotSize + 50; Texture2D img_Src = null; Texture2D img_Dst = null; string strSrcName = "< None >"; string strDstName = "< None >"; if (_srcTexureData != null && _srcTexureData._image != null) { img_Src = _srcTexureData._image; strSrcName = _srcTexureData._name; } if (_dstTexureData != null && _dstTexureData._image != null) { img_Dst = _dstTexureData._image; strDstName = _dstTexureData._name; } GUIStyle guiStyle_ImageSlot = new GUIStyle(GUI.skin.box); guiStyle_ImageSlot.alignment = TextAnchor.MiddleCenter; GUIStyle guiStyle_ImageName = new GUIStyle(GUI.skin.label); guiStyle_ImageName.alignment = TextAnchor.MiddleCenter; EditorGUILayout.BeginHorizontal(GUILayout.Width(width), GUILayout.Height(imageSlotHeight)); GUILayout.Space(5); //이미지 슬롯 1 : 원래 이미지 EditorGUILayout.BeginVertical(GUILayout.Width(imageSlotSize), GUILayout.Height(imageSlotHeight)); //"Original" EditorGUILayout.LabelField(_editor.GetText(TEXT.ExtraOpt_SlotOriginal), GUILayout.Width(imageSlotSize)); GUILayout.Box(img_Src, guiStyle_ImageSlot, GUILayout.Width(imageSlotSize), GUILayout.Height(imageSlotSize)); GUILayout.Space(5); EditorGUILayout.LabelField(strSrcName, guiStyle_ImageName, GUILayout.Width(imageSlotSize)); EditorGUILayout.EndVertical(); GUILayout.Space(imageSlotSpaceSize); //이미지 슬롯 1 : 원래 이미지 EditorGUILayout.BeginVertical(GUILayout.Width(imageSlotSize), GUILayout.Height(imageSlotHeight)); //"Changed" EditorGUILayout.LabelField(_editor.GetText(TEXT.ExtraOpt_SlotChanged), GUILayout.Width(imageSlotSize)); GUILayout.Box(img_Dst, guiStyle_ImageSlot, GUILayout.Width(imageSlotSize), GUILayout.Height(imageSlotSize)); GUILayout.Space(5); EditorGUILayout.LabelField(strDstName, guiStyle_ImageName, GUILayout.Width(imageSlotSize)); EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); //"Set Image" if (apEditorUtil.ToggledButton(_editor.GetText(TEXT.ExtraOpt_SelectImage), false, isTextureAvailable, width, 30)) { //이미지 열기 열기 _loadKey_TextureSelect = apDialog_SelectTextureData.ShowDialog(_editor, null, OnTextureDataSelected); } //"Reset Image" if (GUILayout.Button(_editor.GetText(TEXT.ExtraOpt_ResetImage), GUILayout.Width(width), GUILayout.Height(20))) { apEditorUtil.SetRecord_Modifier(apUndoGroupData.ACTION.Modifier_SettingChanged, _editor, _modifier, _modMesh._extraValue, false); _modMesh._extraValue._textureDataID = -1; _modMesh._extraValue._linkedTextureData = null; RefreshImagePreview(); Repaint(); } } GUILayout.Space(10); apEditorUtil.GUI_DelimeterBoxH(width); GUILayout.Space(10); //"Close" if (GUILayout.Button(_editor.GetText(TEXT.Close), GUILayout.Height(30))) { isClose = true; } if (isClose) { CloseDialog(); } if (isMoveAnimKeyframe) { //키프레임 이동의 경우, //타임라인 레이어를 따라서 전,후로 이동한다. //이때 ModMesh가 아예 바뀌기 때문에 여기서 처리해야한다. if (_keyframe != null && _keyframe._parentTimelineLayer != null && _animClip != null) { apAnimKeyframe moveKeyframe = (isMoveAnimKeyframeToNext ? _keyframe._nextLinkedKeyframe : _keyframe._prevLinkedKeyframe); if (moveKeyframe != null && moveKeyframe._linkedModMesh_Editor != null) { _keyframe = moveKeyframe; _modMesh = _keyframe._linkedModMesh_Editor; _animClip.SetFrame_Editor(moveKeyframe._frameIndex); RefreshImagePreview(); apEditorUtil.ReleaseGUIFocus(); Repaint(); _editor.SetRepaint(); } } } }