public ResolveStateToCurrentContext ( int currentId, VerticalPaneState, prototype ) : void | ||
currentId | int | |
prototype | VerticalPaneState, | |
Résultat | void |
public static void Begin(VerticalPaneState prototype) { int id = GUIUtility.GetControlID(FocusType.Passive); vState = (VerticalPaneState)GUIUtility.GetStateObject(typeof(VerticalPaneState), id); vState.ResolveStateToCurrentContext(id, prototype); Rect totalArea = EditorGUILayout.BeginVertical(); vState.availableHeight = totalArea.height - vState.splitterHeight; vState.isPaneHeightChanged = false; if(totalArea.height > 0) { if(vState.topPaneHeight < 0) { if(vState.initialTopPaneHeight < 0) vState.topPaneHeight = vState.availableHeight * 0.5f; else vState.topPaneHeight = vState.initialTopPaneHeight; vState.isPaneHeightChanged = true; } if(vState.lastAvailableHeight < 0) vState.lastAvailableHeight = vState.availableHeight; if(vState.lastAvailableHeight != vState.availableHeight) { vState.topPaneHeight = vState.availableHeight * (vState.topPaneHeight / vState.lastAvailableHeight); vState.isPaneHeightChanged = true; } vState.lastAvailableHeight = vState.availableHeight; } GUILayout.BeginVertical(GUILayout.Height(vState.topPaneHeight)); }
public static void Begin(VerticalPaneState prototype) { int id = GUIUtility.GetControlID(FocusType.Passive); vState = (VerticalPaneState)GUIUtility.GetStateObject(typeof(VerticalPaneState), id); vState.ResolveStateToCurrentContext(id, prototype); // *INDENT-OFF* Rect totalArea = EditorGUILayout.BeginVertical(); vState.availableHeight = totalArea.height - VerticalPaneState.SPLITTER_HEIGHT; vState.isPaneHeightChanged = false; if(totalArea.height > 0) { if(vState.topPaneHeight < 0) { if(vState.initialTopPaneHeight < 0) vState.topPaneHeight = vState.availableHeight * 0.5f; else vState.topPaneHeight = vState.initialTopPaneHeight; vState.isPaneHeightChanged = true; } if(vState.lastAvailableHeight < 0) vState.lastAvailableHeight = vState.availableHeight; if(vState.lastAvailableHeight != vState.availableHeight) { vState.topPaneHeight = vState.availableHeight * (vState.topPaneHeight / vState.lastAvailableHeight); vState.isPaneHeightChanged = true; } vState.lastAvailableHeight = vState.availableHeight; } GUILayout.BeginVertical(GUILayout.Height(vState.topPaneHeight)); // *INDENT-ON* }