static private GetUnifiedInstructions ( List |
||
layoutInstructions | List |
|
return | void |
public override void UpdateInstructions() { this.m_InstructionClipView.UpdateInstructions(); this.m_InstructionStyleView.UpdateInstructions(); this.m_InstructionLayoutView.UpdateInstructions(); this.m_Instructions.Clear(); GUIViewDebuggerHelper.GetUnifiedInstructions(this.m_Instructions); }
public override void UpdateInstructions() { m_InstructionClipView.UpdateInstructions(); m_InstructionStyleView.UpdateInstructions(); m_InstructionLayoutView.UpdateInstructions(); m_InstructionPropertyView.UpdateInstructions(); m_InstructionNamedControlView.UpdateInstructions(); /* * This is an expensive operation, it will resolve the callstacks for all instructions. * Currently we marshall all instructions for every GUI Event. * This works okay for windows that doesn't repaint automatically. * We can optmize by only marshalling the visible instructions and caching it. * But I don't really think its needed right now. */ m_Instructions.Clear(); GUIViewDebuggerHelper.GetUnifiedInstructions(m_Instructions); }
/* todo: the following method seems to behave differently for properties representing Arrays, compared to how it behaves for non-array properties. * What happens is that regionRect becomes the "wrong side" of the property in the inspector */ static bool FindAncestorPropertyRegion(string propertyPath, string targetTypeName, List <IMGUIDrawInstruction> drawInstructions, List <IMGUIPropertyInstruction> propertyInstructions, ref Rect regionRect) { while (true) { // Remove last component of property path var lastIndexOfDelimiter = propertyPath.LastIndexOf("."); if (lastIndexOfDelimiter < 1) { // No components left, give up return(false); } propertyPath = propertyPath.Substring(0, lastIndexOfDelimiter); foreach (var instruction in propertyInstructions) { if (instruction.targetTypeName != targetTypeName || instruction.path != propertyPath) { continue; } regionRect = instruction.rect; // The property rect itself does not contain the foldout arrow // Expand region to include all draw instructions for this property var unifiedInstructions = new List <IMGUIInstruction>(128); GUIViewDebuggerHelper.GetUnifiedInstructions(unifiedInstructions); var collectDrawInstructions = false; var propertyBeginLevel = 0; foreach (var unifiedInstruction in unifiedInstructions) { if (collectDrawInstructions) { if (unifiedInstruction.level <= propertyBeginLevel) { break; } if (unifiedInstruction.type != InstructionType.kStyleDraw) { continue; } var drawRect = drawInstructions[unifiedInstruction.typeInstructionIndex].rect; if (drawRect.xMin < regionRect.xMin) { regionRect.xMin = drawRect.xMin; } if (drawRect.yMin < regionRect.yMin) { regionRect.yMin = drawRect.yMin; } if (drawRect.xMax > regionRect.xMax) { regionRect.xMax = drawRect.xMax; } if (drawRect.yMax > regionRect.yMax) { regionRect.yMax = drawRect.yMax; } } else { if (unifiedInstruction.type != InstructionType.kPropertyBegin) { continue; } var propertyInstruction = propertyInstructions[unifiedInstruction.typeInstructionIndex]; if (propertyInstruction.targetTypeName == targetTypeName && propertyInstruction.path == propertyPath) { collectDrawInstructions = true; propertyBeginLevel = unifiedInstruction.level; } } } return(true); } } }