Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added inspector multi-editing #50

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
af838a7
Started to introduce static type safety. WIP
D4KU Dec 25, 2021
72ddf5d
Made typesafety work
D4KU Dec 27, 2021
7cc0d5c
Began reimplementing typesafe multiediting. WIP
D4KU Dec 28, 2021
8612e18
Code compiles again
D4KU Dec 29, 2021
9fad679
Multiedit works for most drawers now. Removing components is still br…
D4KU Dec 29, 2021
9887c8d
Freed multiedit of immediately visible bugs
D4KU Dec 29, 2021
ad36483
Documented Refresh() of GameObjectField
D4KU Dec 30, 2021
1b33c37
Made initializing objects work again
D4KU Jan 1, 2022
12b58ce
Fixed default type for naming and text field for texture references
D4KU Jan 1, 2022
e5a0c99
More documentation and better type parameter names
D4KU Jan 2, 2022
d70a086
Replace Linq
D4KU Jan 26, 2022
a85cc19
Fixed inability to set struct members via inspector
D4KU Jan 27, 2022
987a025
Stripped code features not in .NET 4.6
D4KU Jan 30, 2022
8f6f5e7
Removed expression bodies, replaced spaces with tabs
D4KU Jan 30, 2022
c722150
Made field prefabs compatible with Unity 2017
D4KU Jan 31, 2022
aeb6caa
Made inspector run in Unity 5.6
D4KU Feb 8, 2022
d454400
Fixed element type query for List<T> in InspectInternal()
D4KU Mar 9, 2022
059d414
Unified broadcasting code in InspectorField<T>
D4KU Mar 20, 2022
6878d5c
Made some utility functions internal so avoid name collisions with Li…
D4KU Mar 20, 2022
bfdf0e3
Unified GetSingle() for structs and classes
D4KU Mar 4, 2022
3310cd3
Made ObjectField not choose custom editor by type of first bound valu…
D4KU Mar 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ private set
private int pointerId = -98765;

public delegate void OnColorChangedDelegate( Color32 color );
public delegate void OnColorCanceledDelegate();
public event OnColorChangedDelegate OnColorChanged;

private void Awake()
Expand Down Expand Up @@ -204,4 +205,4 @@ private void UpdateSelectors()
SelectorIn.anchoredPosition = new Vector2( innerSquareHalfSize - inner.x * halfSize, innerSquareHalfSize - inner.y * halfSize );
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,23 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1442605026386866
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224791495359974916}
- component: {fileID: 222724314086852112}
- component: {fileID: 114187166180589176}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1598535024382584
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -180,7 +197,7 @@ GameObject:
- component: {fileID: 222369372132554910}
- component: {fileID: 114453996035429050}
m_Layer: 5
m_Name: Text
m_Name: MultiValueText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -257,6 +274,40 @@ MonoBehaviour:
m_PreferredHeight: -1
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &114187166180589176
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1442605026386866}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 12
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
m_MaxSize: 40
m_Alignment: 3
m_AlignByGeometry: 0
m_RichText: 0
m_HorizontalOverflow: 1
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 0
--- !u!114 &114225805896485200
MonoBehaviour:
m_ObjectHideFlags: 1
Expand All @@ -268,6 +319,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 6552c30232f0f104bbd7c08ece928f95, type: 3}
m_Name:
m_EditorClassIdentifier:
multiValueText: {fileID: 114453996035429050}
--- !u!114 &114275421205922078
MonoBehaviour:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -370,7 +422,7 @@ MonoBehaviour:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1945068286606850}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
Expand All @@ -386,7 +438,7 @@ MonoBehaviour:
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 12
m_FontStyle: 0
m_FontStyle: 2
m_BestFit: 0
m_MinSize: 1
m_MaxSize: 40
Expand Down Expand Up @@ -471,7 +523,7 @@ MonoBehaviour:
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 114529708751299698}
m_TextComponent: {fileID: 114453996035429050}
m_TextComponent: {fileID: 114187166180589176}
m_Placeholder: {fileID: 0}
m_ContentType: 2
m_InputType: 0
Expand Down Expand Up @@ -516,6 +568,7 @@ MonoBehaviour:
m_PreferredHeight: 30
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &114720385070111894
MonoBehaviour:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -556,6 +609,7 @@ MonoBehaviour:
m_PreferredHeight: -1
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &114756943421610846
MonoBehaviour:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -653,6 +707,12 @@ CanvasRenderer:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1062827927879770}
--- !u!222 &222724314086852112
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1442605026386866}
--- !u!224 &224176835372005776
RectTransform:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -779,6 +839,7 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224791495359974916}
- {fileID: 224927031305913784}
m_Father: {fileID: 224514342426570322}
m_RootOrder: 2
Expand All @@ -788,6 +849,24 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224791495359974916
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1442605026386866}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224766801875445446}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0.75, y: 0}
m_SizeDelta: {x: -5.5, y: -4}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224877475860292282
RectTransform:
m_ObjectHideFlags: 1
Expand All @@ -812,12 +891,12 @@ RectTransform:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1945068286606850}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224766801875445446}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ GameObject:
- component: {fileID: 222134047083143524}
- component: {fileID: 114035442555116538}
m_Layer: 5
m_Name: Checkmark
m_Name: Multiple Values
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -113,13 +113,30 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1980094496858922
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224153647610241276}
- component: {fileID: 222404792447351432}
- component: {fileID: 114274794239922194}
m_Layer: 5
m_Name: Checkmark
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &114035442555116538
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1141577743683944}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
Expand All @@ -132,9 +149,9 @@ MonoBehaviour:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: f3e870073e8920542bbcc6ed001b6536, type: 3}
m_Sprite: {fileID: 21300000, guid: 796112823cc06244c9a472de097830dd, type: 3}
m_Type: 0
m_PreserveAspect: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
Expand All @@ -158,6 +175,34 @@ MonoBehaviour:
m_PreferredHeight: 30
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &114274794239922194
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1980094496858922}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.2794118, g: 0.2629758, b: 0.2629758, a: 1}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: f3e870073e8920542bbcc6ed001b6536, type: 3}
m_Type: 0
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114392269213132144
MonoBehaviour:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -208,6 +253,7 @@ MonoBehaviour:
visibleArea: {fileID: 114850040097317468}
toggleBackground: {fileID: 114669642334063456}
input: {fileID: 114536213069398136}
multiValueImage: {fileID: 114035442555116538}
--- !u!114 &114536213069398136
MonoBehaviour:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -245,7 +291,7 @@ MonoBehaviour:
m_Interactable: 1
m_TargetGraphic: {fileID: 114669642334063456}
toggleTransition: 0
graphic: {fileID: 114035442555116538}
graphic: {fileID: 114274794239922194}
m_Group: {fileID: 0}
onValueChanged:
m_PersistentCalls:
Expand Down Expand Up @@ -344,12 +390,18 @@ CanvasRenderer:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1141577743683944}
--- !u!224 &224421057578685482
--- !u!222 &222404792447351432
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1980094496858922}
--- !u!224 &224153647610241276
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1141577743683944}
m_GameObject: {fileID: 1980094496858922}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
Expand All @@ -362,6 +414,24 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224421057578685482
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1141577743683944}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224554607098213544}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 8, y: 1}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224445183667736922
RectTransform:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -411,6 +481,7 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224153647610241276}
- {fileID: 224421057578685482}
m_Father: {fileID: 224605210325885518}
m_RootOrder: 0
Expand Down
Loading