private void DrawOverrideDefaultElement(Rect rect, RuleTile.TilingRule originalRule) { float yPos = rect.yMin + 2f; float height = rect.height - k_PaddingBetweenRules; float matrixWidth = k_DefaultElementHeight; Rect inspectorRect = new Rect(rect.xMin, yPos, rect.width - matrixWidth - 10f, height); Rect spriteRect = new Rect(rect.xMax - matrixWidth - 5f, yPos, matrixWidth, k_DefaultElementHeight); RuleOverrideDefaultInspectorOnGUI(inspectorRect, originalRule); if (overrideTile.m_OverrideDefault.m_Enabled) { RuleTileEditor.SpriteOnGUI(spriteRect, overrideTile.m_OverrideDefault.m_TilingRule); } }
public void DrawOriginalRuleElement(Rect rect, RuleTile.TilingRule originalRule, bool isDefault = false) { using (new EditorGUI.DisabledScope(true)) { float yPos = rect.yMin + 2f; float height = rect.height - k_PaddingBetweenRules; float matrixWidth = k_DefaultElementHeight; Rect inspectorRect = new Rect(rect.xMin, yPos, rect.width - matrixWidth * 2f - 20f, height); Rect matrixRect = new Rect(rect.xMax - matrixWidth * 2f - 10f, yPos, matrixWidth, k_DefaultElementHeight); Rect spriteRect = new Rect(rect.xMax - matrixWidth - 5f, yPos, matrixWidth, k_DefaultElementHeight); if (!isDefault) { RuleTileEditor.RuleInspectorOnGUI(inspectorRect, originalRule); } else { RuleOriginalDefaultInspectorOnGUI(inspectorRect, originalRule); } RuleTileEditor.RuleMatrixOnGUI(overrideTile.m_Tile, matrixRect, originalRule); RuleTileEditor.SpriteOnGUI(spriteRect, originalRule); } }