Skip to content

Commit

Permalink
feat: editor update
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Nov 11, 2023
1 parent 5bc7064 commit 1a98bc4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions Packages/src/Editor/CompositeCanvasRendererEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class CompositeCanvasRendererEditor : GraphicEditor
{
private static readonly GUIContent s_ContentNone = new GUIContent("None");
private static readonly GUIContent s_ContentEffect = new GUIContent("Effect");
private static readonly GUIContent s_ContentAttachedEffect = new GUIContent("Attached Effect");
private static readonly Dictionary<Type, GUIContent> s_EffectLabels = new Dictionary<Type, GUIContent>();

private static readonly MethodInfo s_DrawSprite =
Expand Down Expand Up @@ -73,7 +74,6 @@ public override void OnInspectorGUI()
EditorGUILayout.PropertyField(_extends);
EditorGUILayout.PropertyField(_orthographic);
ShowSourceGraphicsControlGUI();
DrawEffectDropdown();

EditorGUILayout.PropertyField(_foreground);
EditorGUILayout.PropertyField(m_Material);
Expand All @@ -93,6 +93,8 @@ public override void OnInspectorGUI()

serializedObject.ApplyModifiedProperties();

DrawEffectDropdown();

if (_current.foreground)
{
var mat = _current.materialForRendering;
Expand Down Expand Up @@ -126,8 +128,11 @@ private void DrawEffectDropdown()
var current = target as CompositeCanvasRenderer;
if (!current) return;

EditorGUILayout.Space(10);
EditorGUILayout.LabelField(s_ContentEffect, EditorStyles.boldLabel);

var rect = EditorGUILayout.GetControlRect(true, 16, EditorStyles.popup);
rect = EditorGUI.PrefixLabel(rect, s_ContentEffect);
rect = EditorGUI.PrefixLabel(rect, s_ContentAttachedEffect);

var currentEffectType = current.GetComponent<CompositeCanvasEffect>()?.GetType();
if (!GUI.Button(rect, GetEffectLabel(currentEffectType), EditorStyles.popup)) return;
Expand Down
8 changes: 4 additions & 4 deletions Packages/src/Runtime/CompositeCanvasRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ public class CompositeCanvasRenderer : MaskableGraphic
private static readonly VertexHelper s_VertexHelper = new VertexHelper();

[SerializeField]
[Header("Settings")]
[Header("Baking")]
private DownSamplingRate m_DownSamplingRate = DownSamplingRate.x1;

[SerializeField]
private bool m_ShowSourceGraphics = true;

[SerializeField]
private bool m_Orthographic;

[SerializeField]
private Vector2 m_Extends;

[Header("Rendering")]
[SerializeField]
private bool m_ShowSourceGraphics = true;

[SerializeField]
private bool m_Foreground;

Expand Down

0 comments on commit 1a98bc4

Please sign in to comment.