Universal Properties Panel

Properties panel is now shared between tabs
This commit is contained in:
hyperion51 2020-05-05 14:11:26 +01:00
commit 87acc75b96
25 changed files with 11397 additions and 41840 deletions

View file

@ -1742,13 +1742,14 @@
<e p="Icons.cs" t="Include" />
<e p="LoginScreen.cs" t="Include" />
<e p="PropertiesPanel.cs" t="Include" />
<e p="PropertyLabel.cs" t="Include" />
<e p="ReadOnlyPropertiesPanel.cs" t="Include" />
<e p="TabActivator.cs" t="Include" />
<e p="TabButton.cs" t="Include" />
<e p="TabGroup.cs" t="Include" />
<e p="TechArrow.cs" t="Include" />
<e p="TechNode.cs" t="Include" />
<e p="ZoneObject.cs" t="Include" />
<e p="ZonePropertiesResource.cs" t="Include" />
<e p="ZoneRenderer.cs" t="Include" />
<e p="ZoneShip.cs" t="Include" />
</e>

View file

@ -909,13 +909,14 @@
<Compile Include="Assets\Scripts\UI\Icons.cs" />
<Compile Include="Assets\Scripts\UI\LoginScreen.cs" />
<Compile Include="Assets\Scripts\UI\PropertiesPanel.cs" />
<Compile Include="Assets\Scripts\UI\PropertyLabel.cs" />
<Compile Include="Assets\Scripts\UI\ReadOnlyPropertiesPanel.cs" />
<Compile Include="Assets\Scripts\UI\TabActivator.cs" />
<Compile Include="Assets\Scripts\UI\TabButton.cs" />
<Compile Include="Assets\Scripts\UI\TabGroup.cs" />
<Compile Include="Assets\Scripts\UI\TechArrow.cs" />
<Compile Include="Assets\Scripts\UI\TechNode.cs" />
<Compile Include="Assets\Scripts\UI\ZoneObject.cs" />
<Compile Include="Assets\Scripts\UI\ZonePropertiesResource.cs" />
<Compile Include="Assets\Scripts\UI\ZoneRenderer.cs" />
<Compile Include="Assets\Scripts\UI\ZoneShip.cs" />
<Compile Include="Assets\Scripts\UnityExtensions.cs" />

View file

@ -0,0 +1,387 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1632094985843186602
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1632094985843186603}
- component: {fileID: 1632094985843186605}
- component: {fileID: 1632094985843186604}
m_Layer: 5
m_Name: Left Side
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1632094985843186603
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1632094985843186602}
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: 1632094986161186410}
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 &1632094985843186605
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1632094985843186602}
m_CullTransparentMesh: 0
--- !u!114 &1632094985843186604
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1632094985843186602}
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: Mass
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: 24
m_fontSizeBase: 24
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 1
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: 1632094985843186604}
characterCount: 4
spriteCount: 0
spaceCount: 0
wordCount: 1
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!1 &1632094986161186409
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1632094986161186410}
- component: {fileID: 1632094986161186411}
- component: {fileID: 5740982411344804251}
m_Layer: 5
m_Name: Mass
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1632094986161186410
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1632094986161186409}
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: 1632094985843186603}
- {fileID: 1632094987425363090}
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!114 &1632094986161186411
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1632094986161186409}
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: -1
m_PreferredHeight: 32
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &5740982411344804251
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1632094986161186409}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b403db1d8980f544099fedf5735cf364, type: 3}
m_Name:
m_EditorClassIdentifier:
Name: {fileID: 1632094985843186604}
Value: {fileID: 1632094987425363091}
--- !u!1 &1632094987425363089
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1632094987425363090}
- component: {fileID: 1632094987425363092}
- component: {fileID: 1632094987425363091}
m_Layer: 5
m_Name: Right Side
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1632094987425363090
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1632094987425363089}
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: 1632094986161186410}
m_RootOrder: 1
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 &1632094987425363092
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1632094987425363089}
m_CullTransparentMesh: 0
--- !u!114 &1632094987425363091
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1632094987425363089}
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: 95%
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: 24
m_fontSizeBase: 24
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_textAlignment: 516
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: 1632094987425363091}
characterCount: 3
spriteCount: 0
spaceCount: 0
wordCount: 1
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}

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7696b62947035dd4f8f5ef66ef53464b
guid: 01f7b13c5b5bbd749b15faf488e2d746
PrefabImporter:
externalObjects: {}
userData:

View file

@ -10,9 +10,9 @@ GameObject:
m_Component:
- component: {fileID: 5427704876334193401}
- component: {fileID: 5427704876334193403}
- component: {fileID: 3847163166094013926}
- component: {fileID: 7902539716206638097}
m_Layer: 5
m_Name: Resource
m_Name: Property List Property
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -59,7 +59,7 @@ MonoBehaviour:
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &3847163166094013926
--- !u!114 &7902539716206638097
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -68,11 +68,11 @@ MonoBehaviour:
m_GameObject: {fileID: 5427704876334193406}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e422bcc206d214044ab697caaac9fd12, type: 3}
m_Script: {fileID: 11500000, guid: b403db1d8980f544099fedf5735cf364, type: 3}
m_Name:
m_EditorClassIdentifier:
NameLabel: {fileID: 5427704876509448082}
QuantityLabel: {fileID: 7059630196601159823}
Name: {fileID: 5427704876509448082}
Value: {fileID: 7059630196601159823}
--- !u!1 &5427704876509448080
GameObject:
m_ObjectHideFlags: 0
@ -241,7 +241,7 @@ GameObject:
- component: {fileID: 7069940623071928653}
- component: {fileID: 7059630196601159823}
m_Layer: 5
m_Name: Quantity
m_Name: Value
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

View file

@ -1,6 +1,6 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &5359016348329203301
--- !u!1 &1625414104823398761
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -8,50 +8,51 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5359016348329203300}
- component: {fileID: 5359016348329203302}
- component: {fileID: 5359016348329203303}
- component: {fileID: 1625414104823398758}
- component: {fileID: 1625414104823398757}
- component: {fileID: 1625414104823398756}
- component: {fileID: 1625414104823398759}
m_Layer: 5
m_Name: Name
m_Name: Title
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5359016348329203300
--- !u!224 &1625414104823398758
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5359016348329203301}
m_GameObject: {fileID: 1625414104823398761}
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: 5359016349318343761}
m_Father: {fileID: 1625414104842428050}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
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 &5359016348329203302
m_SizeDelta: {x: 0, y: 32}
m_Pivot: {x: 0.5, y: 1}
--- !u!222 &1625414104823398757
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5359016348329203301}
m_GameObject: {fileID: 1625414104823398761}
m_CullTransparentMesh: 0
--- !u!114 &5359016348329203303
--- !u!114 &1625414104823398756
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5359016348329203301}
m_GameObject: {fileID: 1625414104823398761}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
@ -63,7 +64,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Dolor III
m_text: Resources
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 9dcd07b95faae7641a3ff6fccab43c32, type: 2}
m_sharedMaterial: {fileID: 21906973755630180, guid: 9dcd07b95faae7641a3ff6fccab43c32,
@ -98,7 +99,7 @@ MonoBehaviour:
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_fontStyle: 1
m_textAlignment: 513
m_characterSpacing: 0
m_wordSpacing: 0
@ -109,7 +110,7 @@ MonoBehaviour:
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_firstOverflowCharacterIndex: 0
m_firstOverflowCharacterIndex: -1
m_linkedTextComponent: {fileID: 0}
m_isLinkedTextComponent: 0
m_isTextTruncated: 0
@ -132,13 +133,13 @@ MonoBehaviour:
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 5359016348329203303}
textComponent: {fileID: 1625414104823398756}
characterCount: 9
spriteCount: 0
spaceCount: 1
wordCount: 2
spaceCount: 0
wordCount: 1
linkCount: 0
lineCount: 8
lineCount: 1
pageCount: 1
materialCount: 1
m_isUsingLegacyAnimationComponent: 0
@ -156,7 +157,27 @@ MonoBehaviour:
- {fileID: 0}
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &5359016349318343774
--- !u!114 &1625414104823398759
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1625414104823398761}
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!1 &1625414104842428053
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -164,27 +185,28 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5359016349318343761}
- component: {fileID: 5359016349318343763}
- component: {fileID: 1625414104842428050}
- component: {fileID: 1625414104842428048}
- component: {fileID: 1625414104842428051}
m_Layer: 5
m_Name: Descendant
m_Name: Resources
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5359016349318343761
--- !u!224 &1625414104842428050
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5359016349318343774}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_GameObject: {fileID: 1625414104842428053}
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: 5359016348329203300}
- {fileID: 1625414104823398758}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -193,13 +215,13 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &5359016349318343763
--- !u!114 &1625414104842428048
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5359016349318343774}
m_GameObject: {fileID: 1625414104842428053}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3}
@ -209,7 +231,30 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: 32
m_PreferredHeight: -1
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &1625414104842428051
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1625414104842428053}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 32
m_Right: 0
m_Top: 40
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 0
m_ChildControlWidth: 1
m_ChildControlHeight: 1

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f4bfc1e3a8d0b8245bc160ec5b2582f1
guid: 93e63e3a8b352a04897123288d70f04b
PrefabImporter:
externalObjects: {}
userData:

View file

@ -1,6 +1,6 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4772132210525817974
--- !u!1 &1026668113805589149
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -8,85 +8,28 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4772132210525817969}
- component: {fileID: 4772132210525817971}
- component: {fileID: 1026668113805589148}
- component: {fileID: 1026668113805589150}
- component: {fileID: 1026668113805589151}
m_Layer: 5
m_Name: Requirement
m_Name: Label
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4772132210525817969
--- !u!224 &1026668113805589148
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4772132210525817974}
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: 4772132210567876891}
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!114 &4772132210525817971
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4772132210525817974}
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: -1
m_PreferredHeight: 32
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!1 &4772132210567876888
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4772132210567876891}
- component: {fileID: 4772132210567876885}
- component: {fileID: 4772132210567876890}
m_Layer: 5
m_Name: Name
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4772132210567876891
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4772132210567876888}
m_GameObject: {fileID: 1026668113805589149}
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: 4772132210525817969}
m_Father: {fileID: 1026668114703092140}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
@ -94,21 +37,21 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4772132210567876885
--- !u!222 &1026668113805589150
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4772132210567876888}
m_GameObject: {fileID: 1026668113805589149}
m_CullTransparentMesh: 0
--- !u!114 &4772132210567876890
--- !u!114 &1026668113805589151
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4772132210567876888}
m_GameObject: {fileID: 1026668113805589149}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
@ -120,7 +63,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 5 Dolor
m_text: Orbital Colony
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 9dcd07b95faae7641a3ff6fccab43c32, type: 2}
m_sharedMaterial: {fileID: 21906973755630180, guid: 9dcd07b95faae7641a3ff6fccab43c32,
@ -149,8 +92,8 @@ MonoBehaviour:
m_outlineColor:
serializedVersion: 2
rgba: 4278190080
m_fontSize: 24
m_fontSizeBase: 24
m_fontSize: 32
m_fontSizeBase: 32
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
@ -166,7 +109,7 @@ MonoBehaviour:
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_firstOverflowCharacterIndex: 0
m_firstOverflowCharacterIndex: -1
m_linkedTextComponent: {fileID: 0}
m_isLinkedTextComponent: 0
m_isTextTruncated: 0
@ -189,13 +132,13 @@ MonoBehaviour:
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 4772132210567876890}
characterCount: 7
textComponent: {fileID: 1026668113805589151}
characterCount: 14
spriteCount: 0
spaceCount: 1
wordCount: 2
linkCount: 0
lineCount: 6
lineCount: 1
pageCount: 1
materialCount: 1
m_isUsingLegacyAnimationComponent: 0
@ -213,3 +156,60 @@ MonoBehaviour:
- {fileID: 0}
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &1026668114703092141
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1026668114703092140}
- component: {fileID: 1026668114703092143}
m_Layer: 5
m_Name: Name
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1026668114703092140
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1026668114703092141}
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: 1026668113805589148}
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!114 &1026668114703092143
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1026668114703092141}
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: -1
m_PreferredHeight: 96
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1

View file

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

View file

@ -65,7 +65,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: ecea37e1387aed94bb9d985e9aeaf638, type: 3}
m_Sprite: {fileID: 21300000, guid: 95f2fb99a63015245b80380d621574fe, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
@ -132,7 +132,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 16, y: 0}
m_AnchoredPosition: {x: 32, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7103233285868643396
@ -281,7 +281,7 @@ GameObject:
- component: {fileID: 6894815547664563684}
- component: {fileID: 6049092145546415630}
m_Layer: 5
m_Name: Tab Button Bottom
m_Name: Tab Button Primary
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -451,7 +451,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 6c76486130e56d443bbb1ef731a4cb6d, type: 3}
m_Sprite: {fileID: 21300000, guid: cb44e107d81bc9140ac00c28ab8daa41, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1

View file

@ -7,16 +7,46 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1689683968015809418, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1689683968015809418, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1689683968015809418, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1689683968015809418, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1689683968015809418, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1689683968015809418, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3856099931455214244, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_Name
value: Tab Button Top
value: Tab Button Secondary
objectReference: {fileID: 0}
- target: {fileID: 5084245071935710148, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: 95f2fb99a63015245b80380d621574fe,
objectReference: {fileID: 21300000, guid: ecea37e1387aed94bb9d985e9aeaf638,
type: 3}
- target: {fileID: 5318229203699776728, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
@ -123,11 +153,61 @@ PrefabInstance:
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 6493174789768221420, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 32
objectReference: {fileID: 0}
- target: {fileID: 6493174789768221420, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6493174789768221420, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6493174789768221420, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -4
objectReference: {fileID: 0}
- target: {fileID: 6493174789768221420, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6620917632164000384, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: cb44e107d81bc9140ac00c28ab8daa41,
objectReference: {fileID: 21300000, guid: 6c76486130e56d443bbb1ef731a4cb6d,
type: 3}
- target: {fileID: 7200536746924797989, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7200536746924797989, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7200536746924797989, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7200536746924797989, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7200536746924797989, guid: b93e36d73a071274d8e9225e077ce92a,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: b93e36d73a071274d8e9225e077ce92a, type: 3}

File diff suppressed because it is too large Load diff

View file

@ -11,14 +11,8 @@ using static NoiseFbm;
[Inspectable, Serializable, RethinkTable("Galaxy"), MessagePackObject, JsonObject(MemberSerialization.OptIn)]
public class GlobalData : DatabaseEntry
{
[InspectableField, JsonProperty("targetPersistenceDuration"), Key(1)]
public float TargetPersistenceDuration = 3;
[InspectableField, JsonProperty("heatRadiationPower"), Key(2)]
public float HeatRadiationPower = 1;
[InspectableField, JsonProperty("heatRadiationMultiplier"), Key(3)]
public float HeatRadiationMultiplier = 1;
[InspectableField, JsonProperty("galaxyName"), Key(1)]
public string GalaxyName;
[InspectableField, JsonProperty("galaxyArms"), Key(4)]
public int Arms = 4;
@ -116,6 +110,15 @@ public class GlobalData : DatabaseEntry
[InspectableField, JsonProperty("orbitSpeedMultiplier"), Key(34)]
public float OrbitSpeedMultiplier = .25f;
[InspectableField, JsonProperty("targetPersistenceDuration"), Key(35)]
public float TargetPersistenceDuration = 3;
[InspectableField, JsonProperty("heatRadiationPower"), Key(36)]
public float HeatRadiationPower = 1;
[InspectableField, JsonProperty("heatRadiationMultiplier"), Key(37)]
public float HeatRadiationMultiplier = 1;
public float PlanetRadius(float mass)
{
return pow(mass, 1 / RadiusPower);

View file

@ -24,6 +24,7 @@ public class StrategyGameManager : MonoBehaviour
public MeshRenderer ZoneBackground;
public MeshRenderer ZoneBoundary;
public ClickRaycaster ClickRaycaster;
public ReadOnlyPropertiesPanel PropertiesPanel;
[Section("Tab Links")]
public TabGroup PrimaryTabGroup;
@ -56,15 +57,6 @@ public class StrategyGameManager : MonoBehaviour
public int AsteroidSpritesheetWidth = 4;
public int AsteroidSpritesheetHeight = 4;
[Section("Zone Properties Panel")]
public RectTransform ZonePropertiesPanel;
public TextMeshProUGUI ZoneTitle;
public RectTransform[] ZonePlanetProperties;
public TextMeshProUGUI ZonePropertiesName;
public TextMeshProUGUI ZonePropertiesMass;
public Transform ZonePropertiesResourcesParent;
public ZonePropertiesResource ZonePropertiesResourcePrefab;
private DatabaseCache _cache;
private GameContext _context;
// private GalaxyResponseMessage _galaxyResponse;
@ -79,7 +71,6 @@ public class StrategyGameManager : MonoBehaviour
private Dictionary<Guid, AsteroidBelt> _zoneBelts = new Dictionary<Guid, AsteroidBelt>();
private Dictionary<Ship, ZoneShip> _zoneShips = new Dictionary<Ship, ZoneShip>();
private List<ZoneObject> _wormholes = new List<ZoneObject>();
private List<ZonePropertiesResource> _zonePropertiesResources = new List<ZonePropertiesResource>();
private Vector3 _galaxyCameraPos = -Vector3.forward;
private float _galaxyOrthoSize = 50;
private Material _boundaryMaterial;
@ -135,6 +126,9 @@ public class StrategyGameManager : MonoBehaviour
_cache.Add(zone.Zone);
foreach (var entry in zone.Contents) _cache.Add(entry);
if(_currentTab==GalaxyTabButton && _selectedZone == zone.Zone.ID)
PopulateZoneProperties(_selectedZone);
if (_currentTab == ZoneTabButton && _populatedZone != zone.Zone.ID) PopulateZone();
});
}
@ -144,23 +138,29 @@ public class StrategyGameManager : MonoBehaviour
_currentTab = button;
if (_currentTab == GalaxyTabButton)
{
PropertiesPanel.gameObject.SetActive(true);
PopulateGalaxyProperties();
if (!_galaxyPopulated) PopulateGalaxy();
Camera.transform.position = _galaxyCameraPos;
Camera.orthographicSize = _galaxyOrthoSize;
}
if (_currentTab == ZoneTabButton)
else if (_currentTab == ZoneTabButton)
{
PropertiesPanel.gameObject.SetActive(true);
var zone = _cache.Get<ZoneData>(_selectedZone);
if (_populatedZone != _selectedZone && zone != null)
PopulateZone();
PopulateZoneProperties(_populatedZone);
Camera.transform.position = -Vector3.forward;
if (zone != null)
Camera.orthographicSize = zone.Radius * ZoneSizeScale;
}
if (_currentTab == TechTabButton)
else if (_currentTab == TechTabButton)
{
PropertiesPanel.gameObject.SetActive(true);
PopulateTechProperties();
if (!_techLayoutGenerated)
{
TechTree.Initialize();
@ -168,12 +168,46 @@ public class StrategyGameManager : MonoBehaviour
TechTree.GenerateTechs();
}
}
else PropertiesPanel.gameObject.SetActive(false);
};
_boundaryMaterial = ZoneBoundary.material;
_backgroundMaterial = ZoneBackground.material;
ClickRaycaster.OnClickMiss += () => ZonePropertiesPanel.gameObject.SetActive(false);
ClickRaycaster.OnClickMiss += () =>
{
if (_currentTab == GalaxyTabButton) PopulateGalaxyProperties();
else if (_currentTab == ZoneTabButton) PopulateZoneProperties(_populatedZone);
else if (_currentTab == TechTabButton) PopulateTechProperties();
};
}
private void PopulateGalaxyProperties()
{
PropertiesPanel.Clear();
PropertiesPanel.Title.text = _context.GlobalData.GalaxyName;
PropertiesPanel.AddSection("Galaxy");
PropertiesPanel.AddProperty("Sectors", $"{_galaxyResponseZones.Count}");
}
private void PopulateZoneProperties(Guid zone)
{
PropertiesPanel.Clear();
var zoneData = _cache.Get<ZoneData>(zone);
PropertiesPanel.Title.text = zoneData.Name;
PropertiesPanel.AddSection("Sector");
PropertiesPanel.AddProperty("Planets", $"{zoneData.Planets.Length}");
}
private void PopulateTechProperties()
{
PropertiesPanel.Clear();
PropertiesPanel.Title.text = "Technologies";
var count = _context.Cache.GetAll<BlueprintData>().Count();
PropertiesPanel.AddProperty("Discovered Techs", $"{count}");
PropertiesPanel.AddProperty("Available Techs", $"{count}");
PropertiesPanel.AddProperty("Researched Techs", $"{count}");
}
private void Update()
@ -259,6 +293,14 @@ public class StrategyGameManager : MonoBehaviour
_selectedGalaxyZone.Background.material.SetColor("_TintColor", UnselectedColor);
if(_selectedZone != zone.ZoneID)
CultClient.Send(new ZoneRequestMessage{ZoneID = zone.ZoneID});
if (TestMode)
{
if(!_context.Cache.Get<ZoneData>(zone.ZoneID).Visited)
{
GenerateZone(zone.ZoneID);
}
PopulateZoneProperties(zone.ZoneID);
}
_selectedZone = zone.ZoneID;
_selectedGalaxyZone = instanceZone;
_selectedGalaxyZone.Background.material.SetColor("_TintColor", SelectedColor);
@ -278,6 +320,29 @@ public class StrategyGameManager : MonoBehaviour
}
}
void GenerateZone(Guid zone)
{
var zoneData = _cache.Get<ZoneData>(zone);
float2 position;
do
{
position = float2(Random.value, Random.value);
} while (_context.MapLayers["StarDensity"].Evaluate(position, _context.GlobalData) < .1f);
OrbitData[] orbits;
PlanetData[] planets;
ZoneGenerator.GenerateZone(
context: _context,
zone: zoneData,
mapLayers: _context.MapLayers.Values,
resources: _cache.GetAll<SimpleCommodityData>().Where(i=>i.ResourceDensity.Any()),
orbitData: out orbits,
planetsData: out planets);
_cache.AddAll(orbits);
_cache.AddAll(planets);
zoneData.Visited = true;
}
void PopulateZone()
{
// Delete all the existing zone contents
@ -295,30 +360,11 @@ public class StrategyGameManager : MonoBehaviour
_populatedZone = _selectedZone;
ZoneData zoneData = _cache.Get<ZoneData>(_populatedZone);
ZoneTitle.text = zoneData.Name;
var zoneData = _cache.Get<ZoneData>(_populatedZone);
if (TestMode && !zoneData.Visited)
{
float2 position;
do
{
position = float2(Random.value, Random.value);
} while (_context.MapLayers["StarDensity"].Evaluate(position, _context.GlobalData) < .1f);
OrbitData[] orbits;
PlanetData[] planets;
ZoneGenerator.GenerateZone(
context: _context,
zone: zoneData,
mapLayers: _context.MapLayers.Values,
resources: _cache.GetAll<SimpleCommodityData>().Where(i=>i.ResourceDensity.Any()),
orbitData: out orbits,
planetsData: out planets);
_cache.AddAll(orbits);
_cache.AddAll(planets);
zoneData.Visited = true;
GenerateZone(_populatedZone);
}
_context.InitializeZone(_populatedZone);
@ -348,24 +394,18 @@ public class StrategyGameManager : MonoBehaviour
PlanetoidSprite);
planetObject.Icon.GetComponent<ClickableCollider>().OnClick += (collider, data) =>
{
ZonePropertiesPanel.gameObject.SetActive(true);
foreach (var zonePlanetProperty in ZonePlanetProperties)
zonePlanetProperty.gameObject.SetActive(true);
foreach (var zonePropertiesResource in _zonePropertiesResources)
Destroy(zonePropertiesResource.gameObject);
_zonePropertiesResources.Clear();
ZonePropertiesName.text = planetData.Name;
ZonePropertiesMass.text = $"{planetData.Mass}";
foreach (var resource in planetData.Resources)
PropertiesPanel.Clear();
PropertiesPanel.Title.text = planetData.Name;
PropertiesPanel.AddSection(planetData.Mass > _context.GlobalData.SunMass ? "Star" :
planetData.Mass > _context.GlobalData.GasGiantMass ? "Gas Giant" :
planetData.Mass > _context.GlobalData.PlanetMass ? "Planet" :
"Planetoid");
PropertiesPanel.AddProperty("Mass", $"{planetData.Mass}");
PropertiesPanel.AddList("Resources", planetData.Resources.Select(resource =>
{
var itemData = _context.Cache.Get<SimpleCommodityData>(resource.Key);
var resourceInstance = Instantiate(ZonePropertiesResourcePrefab, ZonePropertiesResourcesParent);
resourceInstance.NameLabel.text = itemData.Name;
resourceInstance.QuantityLabel.text = $"{resource.Value:0}";
_zonePropertiesResources.Add(resourceInstance);
}
return new Tuple<string, string>(itemData.Name, $"{resource.Value:0}");
}));
};
}
else
@ -376,24 +416,15 @@ public class StrategyGameManager : MonoBehaviour
_zoneBelts[_cache.Get<OrbitData>(planetData.Orbit).Parent] = belt;
beltObject.GetComponent<ClickableCollider>().OnClick += (_, data) =>
{
ZonePropertiesPanel.gameObject.SetActive(true);
foreach (var zonePlanetProperty in ZonePlanetProperties)
zonePlanetProperty.gameObject.SetActive(true);
foreach (var zonePropertiesResource in _zonePropertiesResources)
Destroy(zonePropertiesResource.gameObject);
_zonePropertiesResources.Clear();
ZonePropertiesName.text = planetData.Name;
ZonePropertiesMass.text = $"{planetData.Mass}";
foreach (var resource in planetData.Resources)
PropertiesPanel.Clear();
PropertiesPanel.Title.text = planetData.Name;
PropertiesPanel.AddSection("Asteroid Belt");
PropertiesPanel.AddProperty("Mass", $"{planetData.Mass}");
PropertiesPanel.AddList("Resources", planetData.Resources.Select(resource =>
{
var itemData = _context.Cache.Get<SimpleCommodityData>(resource.Key);
var resourceInstance = Instantiate(ZonePropertiesResourcePrefab, ZonePropertiesResourcesParent);
resourceInstance.NameLabel.text = itemData.Name;
resourceInstance.QuantityLabel.text = $"{resource.Value:0}";
_zonePropertiesResources.Add(resourceInstance);
}
return new Tuple<string, string>(itemData.Name, $"{resource.Value:0}");
}));
};
}
}

View file

@ -23,19 +23,7 @@ public class TechTreeMsagl : MonoBehaviour
public Prototype Arrow;
[Section("UI Links")]
public RectTransform PropertiesPanel;
public TextMeshProUGUI TechName;
public TextMeshProUGUI Quality;
public TextMeshProUGUI ProductionTime;
public TextMeshProUGUI Produces;
public TextMeshProUGUI ResearchTime;
public RectTransform RequirementParent;
public RectTransform DependencyParent;
public RectTransform DescendantParent;
public RectTransform RequirementPrefab;
public RectTransform DependencyPrefab;
public RectTransform DescendantPrefab;
public ClickRaycaster ClickRaycaster;
public ReadOnlyPropertiesPanel PropertiesPanel;
[Section("Graph Generation")]
public bool TestMode;
@ -86,7 +74,6 @@ public class TechTreeMsagl : MonoBehaviour
private List<Prototype> _linkInstances = new List<Prototype>();
private List<Prototype> _arrowInstances = new List<Prototype>();
private Texture2D[] _icons;
private List<RectTransform> _propertyInstances = new List<RectTransform>();
public BlueprintData[] Blueprints { get; set; }
@ -94,7 +81,6 @@ public class TechTreeMsagl : MonoBehaviour
{
if(TestMode)
Initialize();
ClickRaycaster.OnClickMiss += () => PropertiesPanel.gameObject.SetActive(false);
}
public void Initialize()
@ -344,36 +330,25 @@ public class TechTreeMsagl : MonoBehaviour
if (!TestMode)
tech.Fill.GetComponent<ClickableCollider>().OnClick += (collider, data) =>
{
foreach (var instance in _propertyInstances) Destroy(instance.gameObject);
_propertyInstances.Clear();
PropertiesPanel.Clear();
var blueprint = (BlueprintData) vertex.UserData;
PropertiesPanel.gameObject.SetActive(true);
TechName.text = blueprint.Name;
Quality.text = $"{Mathf.RoundToInt(blueprint.Quality * 100)}%";
ProductionTime.text = $"{blueprint.ProductionTime:0.##} MH";
Produces.text = $"{blueprint.Quantity} {Context.Cache.Get<ItemData>(blueprint.Item).Name}";
ResearchTime.text = $"{blueprint.ResearchTime:0.##} MH";
foreach (var ingredient in blueprint.Ingredients)
PropertiesPanel.Title.text = blueprint.Name;
PropertiesPanel.AddProperty("Research Time", $"{blueprint.ResearchTime:0.##} MH");
PropertiesPanel.AddProperty("Produces", $"{blueprint.Quantity} {Context.Cache.Get<ItemData>(blueprint.Item).Name}");
PropertiesPanel.AddProperty("Production Quality", $"{Mathf.RoundToInt(blueprint.Quality * 100)}%");
PropertiesPanel.AddProperty("Production Time", $"{blueprint.ProductionTime:0.##} MH");
PropertiesPanel.AddList("Ingredients", blueprint.Ingredients.Select(ingredient =>
{
var ingredientData = Context.Cache.Get<ItemData>(ingredient.Key);
var ingredientInstance = Instantiate(RequirementPrefab, RequirementParent);
ingredientInstance.GetComponentInChildren<TextMeshProUGUI>().text = $"{ingredient.Value} {ingredientData.Name}";
_propertyInstances.Add(ingredientInstance);
}
foreach (var dependency in blueprint.Dependencies)
return $"{ingredient.Value} {ingredientData.Name}";
}));
PropertiesPanel.AddList("Dependencies", blueprint.Dependencies.Select(dependency =>
{
var dependencyBlueprint = Context.Cache.Get<BlueprintData>(dependency);
var dependencyInstance = Instantiate(DependencyPrefab, DependencyParent);
dependencyInstance.GetComponentInChildren<TextMeshProUGUI>().text = dependencyBlueprint.Name;
_propertyInstances.Add(dependencyInstance);
}
foreach (var descendant in Blueprints.Where(bp =>
bp.Dependencies.Any(dep => blueprint.ID == dep)))
{
var descendantInstance = Instantiate(DescendantPrefab, DescendantParent);
descendantInstance.GetComponentInChildren<TextMeshProUGUI>().text = descendant.Name;
_propertyInstances.Add(descendantInstance);
}
return $"{dependencyBlueprint.Name}";
}));
PropertiesPanel.AddList("Descendants", Blueprints.Where(bp =>
bp.Dependencies.Any(dep => blueprint.ID == dep)).Select(descendant => $"{descendant.Name}"));
};
_techInstances.Add(tech.GetComponent<Prototype>());
}

View file

@ -0,0 +1,10 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class PropertyLabel : MonoBehaviour
{
public TextMeshProUGUI Name;
public TextMeshProUGUI Value;
}

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e422bcc206d214044ab697caaac9fd12
guid: b403db1d8980f544099fedf5735cf364
MonoImporter:
externalObjects: {}
serializedVersion: 2

View file

@ -0,0 +1,65 @@
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class ReadOnlyPropertiesPanel : MonoBehaviour
{
public TextMeshProUGUI Title;
public RectTransform SectionPrefab;
public RectTransform ListPrefab;
public RectTransform ListItemPrefab;
public PropertyLabel ListPropertyPrefab;
public PropertyLabel PropertyPrefab;
private List<GameObject> _properties = new List<GameObject>();
public void Clear()
{
foreach(var property in _properties)
Destroy(property);
}
public void AddProperty(string name, string value)
{
var property = Instantiate(PropertyPrefab, transform);
property.Name.text = name;
property.Value.text = value;
_properties.Add(property.gameObject);
}
public void AddSection(string name)
{
var section = Instantiate(SectionPrefab, transform);
section.GetComponentInChildren<TextMeshProUGUI>().text = name;
_properties.Add(section.gameObject);
}
public void AddList(string name, IEnumerable<string> elements)
{
var list = Instantiate(ListPrefab, transform);
list.GetComponentInChildren<TextMeshProUGUI>().text = name;
foreach (var element in elements)
{
var item = Instantiate(ListItemPrefab, list);
item.GetComponentInChildren<TextMeshProUGUI>().text = element;
_properties.Add(item.gameObject);
}
_properties.Add(list.gameObject);
}
public void AddList(string name, IEnumerable<Tuple<string, string>> elements)
{
var list = Instantiate(ListPrefab, transform);
list.GetComponentInChildren<TextMeshProUGUI>().text = name;
foreach (var element in elements)
{
var item = Instantiate(ListPropertyPrefab, list);
item.Name.text = element.Item1;
item.Value.text = element.Item2;
_properties.Add(item.gameObject);
}
_properties.Add(list.gameObject);
}
}

View file

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

View file

@ -1,10 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class ZonePropertiesResource : MonoBehaviour
{
public TextMeshProUGUI NameLabel;
public TextMeshProUGUI QuantityLabel;
}