Custom Dropdown Menu

Yeeted the broken text mesh pro dropdown menu into the sun, replaced it with a fully functional custom solution
This commit is contained in:
hyperion51 2020-06-07 23:40:19 +01:00
commit 9e368796cf
17 changed files with 1079 additions and 1217 deletions

View file

@ -1767,6 +1767,7 @@
<e p="ContextMenuOption.cs" t="Include" />
<e p="CorporationMenuItem.cs" t="Include" />
<e p="DragHandler.cs" t="Include" />
<e p="DropdownMenu.cs" t="Include" />
<e p="EnumField.cs" t="Include" />
<e p="FlatButton.cs" t="Include" />
<e p="FlatFlatButton.cs" t="Include" />

View file

@ -880,6 +880,7 @@
<Compile Include="Assets\Scripts\UI\ContextMenuOption.cs" />
<Compile Include="Assets\Scripts\UI\CorporationMenuItem.cs" />
<Compile Include="Assets\Scripts\UI\DragHandler.cs" />
<Compile Include="Assets\Scripts\UI\DropdownMenu.cs" />
<Compile Include="Assets\Scripts\UI\EnumField.cs" />
<Compile Include="Assets\Scripts\UI\FlatButton.cs" />
<Compile Include="Assets\Scripts\UI\FlatFlatButton.cs" />

View file

@ -218,7 +218,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0.4180913, b: 1, a: 0.15294118}
m_Color: {r: 0, g: 0.1164044, b: 0.28, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -246,13 +246,16 @@ MonoBehaviour:
m_EditorClassIdentifier:
StateDamping: 10
Fill: {fileID: 790814198576895813}
Label: {fileID: 0}
CurrentState: 0
DisableClickWhenSelected: 1
UnselectedColor: {r: 0, g: 0.4180913, b: 1, a: 0.15294118}
UnselectedColor: {r: 0, g: 0.1164044, b: 0.28, a: 1}
SelectedColor: {r: 1, g: 0.44583336, b: 0.050000012, a: 0.65882355}
HoverColor: {r: 0, g: 0.4180913, b: 1, a: 0.5019608}
HoverColor: {r: 0, g: 0.29125005, b: 0.699, a: 1}
ClickColor: {r: 1, g: 0.44583336, b: 0.050000012, a: 1}
DisabledColor: {r: 0, g: 0, b: 0, a: 0}
DisabledColor: {r: 0.14959699, g: 0.21268159, b: 0.301, a: 1}
EnabledTextColor: {r: 0.9, g: 0.9, b: 0.9, a: 1}
DisabledTextColor: {r: 0.6037736, g: 0.6037736, b: 0.6037736, a: 1}
--- !u!114 &226212841
MonoBehaviour:
m_ObjectHideFlags: 0

View file

@ -0,0 +1,379 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4420144871272692257
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4420144871272692262}
- component: {fileID: 8504087492306605903}
- component: {fileID: 6225116401751615693}
- component: {fileID: 4420144871272692256}
- component: {fileID: 3113010463574910911}
m_Layer: 5
m_Name: Dropdown Option
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4420144871272692262
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4420144871272692257}
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:
- {fileID: 5288995275525413887}
- {fileID: 4420144871448733516}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8504087492306605903
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4420144871272692257}
m_CullTransparentMesh: 0
--- !u!114 &6225116401751615693
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4420144871272692257}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fafbcd26aa8d175448880b37b7a41b2e, type: 3}
m_Name:
m_EditorClassIdentifier:
StateDamping: 10
Fill: {fileID: 8643357621123828164}
CurrentState: 0
DisableClickWhenSelected: 1
UnselectedColor: {r: 0, g: 0.4180913, b: 1, a: 0.15294118}
SelectedColor: {r: 1, g: 0.44583336, b: 0.050000012, a: 0.65882355}
HoverColor: {r: 0, g: 0.4180913, b: 1, a: 0.5019608}
ClickColor: {r: 1, g: 0.44583336, b: 0.050000012, a: 1}
DisabledColor: {r: 0, g: 0, b: 0, a: 0}
--- !u!114 &4420144871272692256
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4420144871272692257}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8c0b005aebd0cd947a04034f1a42e838, type: 3}
m_Name:
m_EditorClassIdentifier:
Label: {fileID: 4420144871448733517}
Button: {fileID: 6225116401751615693}
--- !u!114 &3113010463574910911
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4420144871272692257}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -405508275, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 12
m_Right: 4
m_Top: 6
m_Bottom: 6
m_ChildAlignment: 4
m_Spacing: 4
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 1
m_ChildControlHeight: 1
--- !u!1 &4420144871448733519
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4420144871448733516}
- component: {fileID: 4420144871448733506}
- component: {fileID: 4420144871448733517}
- component: {fileID: 3113010463574910849}
m_Layer: 5
m_Name: Name
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4420144871448733516
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4420144871448733519}
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: 4420144871272692262}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4420144871448733506
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4420144871448733519}
m_CullTransparentMesh: 0
--- !u!114 &4420144871448733517
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4420144871448733519}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: This is a button
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 9dcd07b95faae7641a3ff6fccab43c32, type: 2}
m_sharedMaterial: {fileID: 21906973755630180, guid: 9dcd07b95faae7641a3ff6fccab43c32,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_outlineColor:
serializedVersion: 2
rgba: 4278190080
m_fontSize: 20
m_fontSizeBase: 20
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_textAlignment: 513
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_firstOverflowCharacterIndex: -1
m_linkedTextComponent: {fileID: 0}
m_isLinkedTextComponent: 0
m_isTextTruncated: 0
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_ignoreRectMaskCulling: 0
m_ignoreCulling: 1
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_VertexBufferAutoSizeReduction: 1
m_firstVisibleCharacter: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 4420144871448733517}
characterCount: 16
spriteCount: 0
spaceCount: 3
wordCount: 4
linkCount: 0
lineCount: 1
pageCount: 1
materialCount: 1
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
m_hasFontAssetChanged: 0
m_subTextObjects:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &3113010463574910849
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4420144871448733519}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 0
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 0
m_PreferredHeight: -1
m_FlexibleWidth: 2
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!1 &8905398218760630884
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5288995275525413887}
- component: {fileID: 8182717543484249879}
- component: {fileID: 8643357621123828164}
- component: {fileID: 3113010463574910851}
m_Layer: 5
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5288995275525413887
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8905398218760630884}
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: 4420144871272692262}
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, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8182717543484249879
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8905398218760630884}
m_CullTransparentMesh: 0
--- !u!114 &8643357621123828164
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8905398218760630884}
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, g: 0.4180913, b: 1, a: 0.15294118}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!114 &3113010463574910851
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8905398218760630884}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 1
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: -1
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b1fe91487e8589444bd3512bc6696b3b
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load diff

View file

@ -88,6 +88,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8c2bf4a7080061d42a87046c37bf0c60, type: 3}
m_Name:
m_EditorClassIdentifier:
Dropdown: {fileID: 0}
Title: {fileID: 5116519198747529738}
SectionPrefab: {fileID: 1026668114703092140, guid: 3a149ea40b43fbf47b51ec165cb04e5f,
type: 3}
@ -105,13 +106,15 @@ MonoBehaviour:
type: 3}
ProgressField: {fileID: 256436433275418348, guid: e6524d59d9bc67545b0eb1304bfb9d4b,
type: 3}
EnumField: {fileID: 8066691333806154, guid: f19a14cd178d48f49ace9ad217bea2ed, type: 3}
EnumField: {fileID: 1444953514731475975, guid: f19a14cd178d48f49ace9ad217bea2ed,
type: 3}
BoolField: {fileID: 7661950293931311388, guid: 001ad6a15f0d582458d359c0ae4405ed,
type: 3}
PropertyButton: {fileID: 1613450655389604799, guid: 99bde06e2f0ca504bb95f2a4e3429462,
type: 3}
ButtonField: {fileID: 6566784227922820057, guid: 6db1feb4cda7b8c419384cd42c85a5c4,
type: 3}
SelectedChild: {fileID: 0}
--- !u!1 &2378632238144827086
GameObject:
m_ObjectHideFlags: 0

View file

@ -64,7 +64,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: This is a button with a very long name that forces expandddd
m_text: This is a button with a very long name that forces expand
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 9dcd07b95faae7641a3ff6fccab43c32, type: 2}
m_sharedMaterial: {fileID: 21906973755630180, guid: 9dcd07b95faae7641a3ff6fccab43c32,
@ -134,7 +134,7 @@ MonoBehaviour:
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 1613450655044732626}
characterCount: 60
characterCount: 57
spriteCount: 0
spaceCount: 11
wordCount: 12
@ -241,13 +241,16 @@ MonoBehaviour:
m_EditorClassIdentifier:
StateDamping: 10
Fill: {fileID: 6683620520386570331}
Label: {fileID: 0}
CurrentState: 0
DisableClickWhenSelected: 1
UnselectedColor: {r: 0, g: 0.4180913, b: 1, a: 0.15294118}
UnselectedColor: {r: 0, g: 0.1164044, b: 0.28, a: 1}
SelectedColor: {r: 1, g: 0.44583336, b: 0.050000012, a: 0.65882355}
HoverColor: {r: 0, g: 0.4180913, b: 1, a: 0.5019608}
HoverColor: {r: 0, g: 0.29125005, b: 0.699, a: 1}
ClickColor: {r: 1, g: 0.44583336, b: 0.050000012, a: 1}
DisabledColor: {r: 0, g: 0, b: 0, a: 0}
DisabledColor: {r: 0.14959699, g: 0.21268159, b: 0.301, a: 1}
EnabledTextColor: {r: 0.9, g: 0.9, b: 0.9, a: 1}
DisabledTextColor: {r: 0.6037736, g: 0.6037736, b: 0.6037736, a: 1}
--- !u!114 &1613450655389604799
MonoBehaviour:
m_ObjectHideFlags: 0
@ -437,7 +440,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0.4180913, b: 1, a: 0.15294118}
m_Color: {r: 0, g: 0.1164044, b: 0.28, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:

View file

@ -274,6 +274,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 2544c9c8b6358c54ea58c5fb33bb48b7, type: 3}
m_Name:
m_EditorClassIdentifier:
Dropdown: {fileID: 0}
Title: {fileID: 2088721703192714100}
SectionPrefab: {fileID: 1026668114703092140, guid: 3a149ea40b43fbf47b51ec165cb04e5f,
type: 3}
@ -291,13 +292,15 @@ MonoBehaviour:
type: 3}
ProgressField: {fileID: 256436433275418348, guid: e6524d59d9bc67545b0eb1304bfb9d4b,
type: 3}
EnumField: {fileID: 8066691333806154, guid: f19a14cd178d48f49ace9ad217bea2ed, type: 3}
EnumField: {fileID: 1444953514731475975, guid: f19a14cd178d48f49ace9ad217bea2ed,
type: 3}
BoolField: {fileID: 7661950293931311388, guid: 001ad6a15f0d582458d359c0ae4405ed,
type: 3}
PropertyButton: {fileID: 1613450655389604799, guid: 99bde06e2f0ca504bb95f2a4e3429462,
type: 3}
ButtonField: {fileID: 6566784227922820057, guid: 6db1feb4cda7b8c419384cd42c85a5c4,
type: 3}
SelectedChild: {fileID: 0}
FoldoutIcon: {fileID: 6485458701090981364}
FoldoutRotationDamping: 10
Button: {fileID: 5436107563273525140}
@ -318,6 +321,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
StateDamping: 10
Fill: {fileID: 1992060800398866096}
Label: {fileID: 0}
CurrentState: 0
DisableClickWhenSelected: 1
UnselectedColor: {r: 0, g: 0.4180913, b: 1, a: 0.15294118}
@ -325,6 +329,8 @@ MonoBehaviour:
HoverColor: {r: 0, g: 0.4180913, b: 1, a: 0.29803923}
ClickColor: {r: 0, g: 0.4180913, b: 1, a: 0.7490196}
DisabledColor: {r: 0, g: 0, b: 0, a: 0}
EnabledTextColor: {r: 0, g: 0, b: 0, a: 0}
DisabledTextColor: {r: 0, g: 0, b: 0, a: 0}
--- !u!1 &2755672975795187168
GameObject:
m_ObjectHideFlags: 0

View file

@ -274,6 +274,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 2544c9c8b6358c54ea58c5fb33bb48b7, type: 3}
m_Name:
m_EditorClassIdentifier:
Dropdown: {fileID: 0}
Title: {fileID: 2088721703192714100}
SectionPrefab: {fileID: 1026668114703092140, guid: 3a149ea40b43fbf47b51ec165cb04e5f,
type: 3}
@ -291,13 +292,15 @@ MonoBehaviour:
type: 3}
ProgressField: {fileID: 256436433275418348, guid: e6524d59d9bc67545b0eb1304bfb9d4b,
type: 3}
EnumField: {fileID: 8066691333806154, guid: f19a14cd178d48f49ace9ad217bea2ed, type: 3}
EnumField: {fileID: 1444953514731475975, guid: f19a14cd178d48f49ace9ad217bea2ed,
type: 3}
BoolField: {fileID: 7661950293931311388, guid: 001ad6a15f0d582458d359c0ae4405ed,
type: 3}
PropertyButton: {fileID: 1613450655389604799, guid: 99bde06e2f0ca504bb95f2a4e3429462,
type: 3}
ButtonField: {fileID: 6566784227922820057, guid: 6db1feb4cda7b8c419384cd42c85a5c4,
type: 3}
SelectedChild: {fileID: 0}
FoldoutIcon: {fileID: 6485458701090981364}
FoldoutRotationDamping: 10
Button: {fileID: 5436107563273525140}
@ -318,6 +321,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
StateDamping: 10
Fill: {fileID: 1992060800398866096}
Label: {fileID: 0}
CurrentState: 0
DisableClickWhenSelected: 1
UnselectedColor: {r: 0, g: 0.4180913, b: 1, a: 0.15294118}
@ -325,6 +329,8 @@ MonoBehaviour:
HoverColor: {r: 0, g: 0.4180913, b: 1, a: 0.29803923}
ClickColor: {r: 0, g: 0.4180913, b: 1, a: 0.7490196}
DisabledColor: {r: 0, g: 0, b: 0, a: 0}
EnabledTextColor: {r: 0, g: 0, b: 0, a: 0}
DisabledTextColor: {r: 0, g: 0, b: 0, a: 0}
--- !u!1 &2755672975795187168
GameObject:
m_ObjectHideFlags: 0

View file

@ -826,6 +826,99 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 66932364}
m_CullTransparentMesh: 0
--- !u!1 &75581144
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 75581145}
- component: {fileID: 75581148}
- component: {fileID: 75581147}
- component: {fileID: 75581146}
m_Layer: 5
m_Name: Outline
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &75581145
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 75581144}
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: 124694534}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &75581146
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 75581144}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 1
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: -1
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &75581147
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 75581144}
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.8, g: 0.9333333, b: 1, a: 1}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: f86ca8785ddc5524d9f125ad626ffcf8, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 0
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &75581148
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 75581144}
m_CullTransparentMesh: 0
--- !u!1 &105783974
GameObject:
m_ObjectHideFlags: 0
@ -991,6 +1084,103 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 113680651}
m_CullTransparentMesh: 0
--- !u!1 &124694533
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 124694534}
- component: {fileID: 124694537}
- component: {fileID: 124694536}
- component: {fileID: 124694535}
m_Layer: 5
m_Name: Dropdown Menu
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &124694534
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 124694533}
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:
- {fileID: 372519584}
- {fileID: 149736678}
- {fileID: 75581145}
m_Father: {fileID: 784574043}
m_RootOrder: 5
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: 146.2, y: -88.5}
m_SizeDelta: {x: 250, y: 10}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &124694535
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 124694533}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 848ae49aff071f5458dcc0322b8b84eb, type: 3}
m_Name:
m_EditorClassIdentifier:
Canvas: {fileID: 323746066}
CancelClickCatcher: {fileID: 24242565}
OptionPrefab: {fileID: 4420144871272692256, guid: b1fe91487e8589444bd3512bc6696b3b,
type: 3}
ContentRoot: {fileID: 149736678}
OptionHeight: 34
PaddingHeight: 16
--- !u!114 &124694536
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 124694533}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 2
m_Right: 2
m_Top: 2
m_Bottom: 2
m_ChildAlignment: 0
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 1
m_ChildControlHeight: 1
--- !u!114 &124694537
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 124694533}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalFit: 0
m_VerticalFit: 2
--- !u!1 &143833099
GameObject:
m_ObjectHideFlags: 0
@ -1165,6 +1355,80 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4ec4ae0999e1b814cbb86e167df3c039, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &149736677
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 149736678}
- component: {fileID: 149736680}
- component: {fileID: 149736679}
m_Layer: 5
m_Name: Content
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &149736678
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 149736677}
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: 124694534}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 125, y: -5}
m_SizeDelta: {x: 246, y: 6}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &149736679
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 149736677}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalFit: 0
m_VerticalFit: 1
--- !u!114 &149736680
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 149736677}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 0
m_Right: 0
m_Top: 3
m_Bottom: 3
m_ChildAlignment: 0
m_Spacing: 1
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 1
m_ChildControlHeight: 1
--- !u!1 &186929811
GameObject:
m_ObjectHideFlags: 0
@ -1267,10 +1531,9 @@ PrefabInstance:
m_Modifications:
- target: {fileID: 2378632238049155148, guid: 4fca44e21a27a6d48916d2cc4b6e2df0,
type: 3}
propertyPath: InputField
propertyPath: Dropdown
value:
objectReference: {fileID: 4412201880883430374, guid: 5e84952f528d8644ebddaa8320c3edfa,
type: 3}
objectReference: {fileID: 124694535}
- target: {fileID: 2378632238049155248, guid: 4fca44e21a27a6d48916d2cc4b6e2df0,
type: 3}
propertyPath: m_SizeDelta.y
@ -3327,6 +3590,99 @@ MonoBehaviour:
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
m_ChildControlHeight: 1
--- !u!1 &372519583
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 372519584}
- component: {fileID: 372519587}
- component: {fileID: 372519586}
- component: {fileID: 372519585}
m_Layer: 5
m_Name: Fill
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &372519584
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 372519583}
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: 124694534}
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, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &372519585
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 372519583}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 1
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: -1
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &372519586
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 372519583}
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, g: 0.041666675, b: 0.1, a: 0.79607844}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: d43f9691259ed984fa09c853c5cda7f0, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &372519587
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 372519583}
m_CullTransparentMesh: 0
--- !u!1 &391111913
GameObject:
m_ObjectHideFlags: 0
@ -8437,6 +8793,7 @@ RectTransform:
- {fileID: 1059548285}
- {fileID: 24242568}
- {fileID: 831625848}
- {fileID: 124694534}
m_Father: {fileID: 323746067}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -22134,6 +22491,11 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 1059548285}
m_Modifications:
- target: {fileID: 2378632238049155148, guid: 4fca44e21a27a6d48916d2cc4b6e2df0,
type: 3}
propertyPath: Dropdown
value:
objectReference: {fileID: 124694535}
- target: {fileID: 2378632238049155248, guid: 4fca44e21a27a6d48916d2cc4b6e2df0,
type: 3}
propertyPath: m_SizeDelta.y

View file

@ -49,10 +49,13 @@ public class Factory : IBehavior, IPersistentBehavior
if (value != _blueprint)
{
_blueprint = value;
RetoolingTime = ToolingTime;
_retooling = true;
Active = false;
ItemName = Context.Cache.Get<ItemData>(Context.Cache.Get<BlueprintData>(value).Item).Name;
if(value != Guid.Empty)
{
ItemName = Context.Cache.Get<ItemData>(Context.Cache.Get<BlueprintData>(value).Item).Name;
RetoolingTime = ToolingTime;
_retooling = true;
}
Item.Change();
}
}

View file

@ -0,0 +1,73 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class DropdownMenu : MonoBehaviour
{
public Canvas Canvas;
public ClickCatcher CancelClickCatcher;
public PropertyButton OptionPrefab;
public RectTransform ContentRoot;
public float OptionHeight;
public float PaddingHeight;
private List<GameObject> _options = new List<GameObject>();
private void Start()
{
if (CancelClickCatcher != null)
CancelClickCatcher.OnClick += data =>
{
End();
};
}
private void End()
{
CancelClickCatcher.gameObject.SetActive(false);
gameObject.SetActive(false);
}
public void Clear()
{
// Destroy previous options
foreach(var option in _options)
Destroy(option);
_options.Clear();
}
public void AddOption(string text, Action action, bool selected = false, bool enabled = true)
{
var optionButton = Instantiate(OptionPrefab, ContentRoot);
optionButton.Label.text = text;
optionButton.Button.OnClick += data =>
{
action();
End();
};
optionButton.Button.CurrentState = !enabled ? FlatButtonState.Disabled : selected ? FlatButtonState.Selected : FlatButtonState.Unselected;
_options.Add(optionButton.gameObject);
}
public void Show(RectTransform parent)
{
var rect = transform as RectTransform;
var pivot = rect.pivot;
pivot.x = 0;
var scaleFactor = Canvas.scaleFactor;
var corners = new Vector3[4];
parent.GetWorldCorners(corners);
var pivotTop = corners[0].y > (PaddingHeight + _options.Count * OptionHeight) * scaleFactor;
pivot.y = pivotTop ? 1 : 0;
rect.pivot = pivot;
rect.sizeDelta = parent.sizeDelta;
rect.position = pivotTop ? corners[0] : corners[1];
CancelClickCatcher.gameObject.SetActive(true);
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 848ae49aff071f5458dcc0322b8b84eb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -6,5 +6,5 @@ using UnityEngine;
public class EnumField : MonoBehaviour
{
public TextMeshProUGUI Label;
public TMP_Dropdown Dropdown;
public FlatFlatButton Dropdown;
}

View file

@ -12,6 +12,7 @@ public class FlatFlatButton : MonoBehaviour, IPointerEnterHandler, IPointerExitH
public float StateDamping;
// public RectTransform Tab;
public Image Fill;
public TextMeshProUGUI Label;
public FlatButtonState CurrentState = FlatButtonState.Unselected;
public bool DisableClickWhenSelected = true;
@ -20,6 +21,8 @@ public class FlatFlatButton : MonoBehaviour, IPointerEnterHandler, IPointerExitH
public Color HoverColor;
public Color ClickColor;
public Color DisabledColor;
public Color EnabledTextColor;
public Color DisabledTextColor;
public void OnPointerEnter(PointerEventData eventData)
{
@ -67,6 +70,9 @@ public class FlatFlatButton : MonoBehaviour, IPointerEnterHandler, IPointerExitH
break;
}
if (Label != null)
Label.color = Color.Lerp(Label.color,
CurrentState == FlatButtonState.Disabled ? DisabledTextColor : EnabledTextColor, StateDamping * Time.deltaTime);
Fill.color = Color.Lerp(Fill.color, appearance, StateDamping * Time.deltaTime);
}
}

View file

@ -12,6 +12,7 @@ using UnityEngine.UI;
public class PropertiesPanel : MonoBehaviour
{
public DropdownMenu Dropdown;
public TextMeshProUGUI Title;
public RectTransform SectionPrefab;
public PropertiesList ListPrefab;
@ -121,6 +122,7 @@ public class PropertiesPanel : MonoBehaviour
{
var list = Instantiate(ListPrefab, transform);
list.Context = Context;
list.Dropdown = Dropdown;
list.Title.text = name;
// foreach (var element in elements)
// {
@ -266,9 +268,20 @@ public class PropertiesPanel : MonoBehaviour
{
var field = Instantiate(EnumField, transform);
field.Label.text = name;
field.Dropdown.options = enumOptions.Select(s => new TMP_Dropdown.OptionData(s)).ToList();
field.Dropdown.onValueChanged.AddListener(val => write(val));
RefreshPropertyValues += () => field.Dropdown.value = read();
field.Dropdown.OnClick += data =>
{
var selected = read();
Dropdown.gameObject.SetActive(true);
Dropdown.Clear();
for (int i = 0; i < enumOptions.Length; i++)
{
var index = i;
Dropdown.AddOption(enumOptions[i], () => write(index), index == selected);
}
Dropdown.Show((RectTransform) field.Dropdown.transform);
};
RefreshPropertyValues += () => field.Dropdown.Label.text = enumOptions[read()];
Properties.Add(field.gameObject);
OnPropertyAdded?.Invoke(field.gameObject);
}