Heat Pipes

Thermal Layer Removed
Items can be destroyed from inventory menu via drag & drop
Trade menu contains only priced items
Trade menu has filters for commodities
Conductivity can be adjusted along schematic edges
Thermals rebalanced
This commit is contained in:
Reinier Vens 2021-01-17 02:45:52 +00:00
commit ebec68e7f0
28 changed files with 1706 additions and 322 deletions

View file

@ -284,9 +284,6 @@
<Reference Include="UnityEditor.WindowsStandalone.Extensions">
<HintPath>C:/Program Files/Unity/Hub/Editor/2020.2.1f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
</Reference>
<Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
<HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/16.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
</Reference>
<Reference Include="Remotion.Linq">
<HintPath>E:/Projects/Aetheria-Economy/Assets/Plugins/Remotion.Linq.dll</HintPath>
</Reference>

View file

@ -348,9 +348,6 @@
<Reference Include="UnityEditor.WindowsStandalone.Extensions">
<HintPath>C:/Program Files/Unity/Hub/Editor/2020.2.1f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
</Reference>
<Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
<HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/16.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
</Reference>
<Reference Include="Remotion.Linq">
<HintPath>E:/Projects/Aetheria-Economy/Assets/Plugins/Remotion.Linq.dll</HintPath>
</Reference>

View file

@ -130,6 +130,7 @@
<Compile Include="Assets\Scripts\NIH\MSAGL\GraphmapsWithMesh\PlanarGraphUtilities.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Geometry\Curves\LinearSystem2.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Layout\LargeGraphLayout\LgEdgeInfo.cs" />
<Compile Include="Assets\ItemFilter.cs" />
<Compile Include="Assets\Scripts\UI\GalaxyZone.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Layout\Arrowheads.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\Spline\Bundling\BundlingStatus.cs" />
@ -218,6 +219,7 @@
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawerAttributes\ButtonAttribute.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\Spline\ConeSpanner\SweepEvent.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Layout\ProximityOverlapRemoval\ConjugateGradient\LinearSystemSolver.cs" />
<Compile Include="Assets\Scripts\TradeMenu.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\ProjectionSolver\ViolationCache.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\Rectilinear\EventQueue.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Geometry\RTree\RectangleNodeUtils.cs" />
@ -313,6 +315,7 @@
<Compile Include="Assets\Scripts\UI\MapViewDragHandler.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Geometry\Curves\Polyline.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\Rectilinear\HighBendVertexEvent.cs" />
<Compile Include="Assets\Scripts\SizeFilter.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Layout\ProximityOverlapRemoval\StressEnergy\SolvingMethod.cs" />
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawerAttributes\ResizableTextAreaAttribute.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Geometry\Curves\CubicBezierSegment.cs" />
@ -424,6 +427,7 @@
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\Visibility\StemStartPointComparer.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\Shape.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\ProjectionSolver\UniformOneDimensionalSolver.cs" />
<Compile Include="Assets\Scripts\UI\PlaceUIElementWorldspace.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\DataStructures\RBTree\RBColor.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\Spline\Bundling\MetroLine.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Layout\Layered\Ordering\EdgeComparerBySource.cs" />
@ -458,6 +462,7 @@
<Compile Include="Assets\Scripts\NIH\MSAGL\Layout\Initial\InitialLayoutHelpers.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Geometry\MinEnclosingDisc\Disc.cs" />
<Compile Include="Assets\Scripts\NIH\MIConvexHull\ConvexHull\ConvexFace.cs" />
<Compile Include="Assets\Scripts\SpreadsheetRow.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\DebugHelpers\Persistence\CurveStream.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\ConstrainedDelaunayTriangulation\CdtSite.cs" />
<Compile Include="Assets\Scripts\UI\DropdownMenu.cs" />
@ -567,6 +572,7 @@
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\Spline\Bundling\GeneralMetroMapOrdering.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\Rectilinear\ObstacleTree.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\ProjectionSolver\ISolverShell.cs" />
<Compile Include="Assets\Scripts\SpreadsheetColumnHeader.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\Visibility\PointVisibilityCalculator.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Geometry\OverlapRemoval\OverlapRemovalParameters.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\DataStructures\RBTree\RBNode.cs" />
@ -659,6 +665,7 @@
<Compile Include="Assets\Scripts\UI\EnumField.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\Visibility\VisibilityGraph.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Geometry\MultidimensionalScaling.cs" />
<Compile Include="Assets\HoverCursorChange.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Geometry\Curves\LineSegment.cs" />
<Compile Include="Assets\Scripts\Sector Display\WaveScroll.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\GraphAlgorithms\CycleRemoval\NodeInfo.cs" />
@ -699,6 +706,7 @@
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\NodeKind.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\Rectilinear\SsstRectilinearPath.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Layout\Layered\XCoordsWithAlignment.cs" />
<Compile Include="Assets\Scripts\Spreadsheet.cs" />
<Compile Include="Assets\Scripts\CameraPerlinOrbit.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\GraphmapsWithMesh\LocalModifications.cs" />
<Compile Include="Assets\Scripts\HullCollider.cs" />
@ -711,14 +719,6 @@
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Geometry\MinEnclosingDisc\MinimumEnclosingDisc.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\DataStructures\BinaryHeapWithComparer.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Geometry\Direction.cs" />
<Compile Include="Assets\Scripts\UI\PlaceUIElementWorldspace.cs" />
<Compile Include="Assets\Scripts\TradeMenu.cs" />
<Compile Include="Assets\Scripts\SizeFilter.cs" />
<Compile Include="Assets\Scripts\Spreadsheet.cs" />
<Compile Include="Assets\Scripts\SpreadsheetColumnHeader.cs" />
<Compile Include="Assets\Scripts\SpreadsheetRow.cs" />
<Compile Include="Assets\HoverCursorChange.cs" />
<Compile Include="Assets\ItemFilter.cs" />
<None Include="Assets\com.unity.uiextensions\Runtime\Resources\Shaders\UIAdditive.shader" />
<None Include="Assets\TextMesh Pro\Resources\Shaders\TMPro.cginc" />
<None Include="Assets\TextMesh Pro\Resources\Shaders\TMP_SDF-Mobile Overlay.shader" />

View file

@ -86,7 +86,7 @@ Material:
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Scale: 3.2540116
- _Scale: 2.0531235
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1

View file

@ -1,5 +1,206 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1517101022650042043
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5683613523479270443}
- component: {fileID: 646959673176026143}
- component: {fileID: 6018881512285912399}
- component: {fileID: 2058795912543605561}
- component: {fileID: 5512238094018694157}
m_Layer: 5
m_Name: Thermal
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5683613523479270443
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1517101022650042043}
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: 6584545650613466935}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -8}
m_SizeDelta: {x: 84, y: 24}
m_Pivot: {x: 1, y: 1}
--- !u!222 &646959673176026143
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1517101022650042043}
m_CullTransparentMesh: 0
--- !u!114 &6018881512285912399
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1517101022650042043}
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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Thermal
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 53555f7a2d5e745428813f1b1118734f, type: 2}
m_sharedMaterial: {fileID: -2804126062856497447, guid: 53555f7a2d5e745428813f1b1118734f,
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_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 20
m_fontSizeBase: 20
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
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_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 1
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &2058795912543605561
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1517101022650042043}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, 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 &5512238094018694157
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1517101022650042043}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 6018881512285912399}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1 &2279630452357787792
GameObject:
m_ObjectHideFlags: 0
@ -568,6 +769,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
@ -1019,10 +1221,14 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 78aa0b8ec7594a7438f13757228e3500, type: 3}
m_Name:
m_EditorClassIdentifier:
Flip: 0
Settings: {fileID: 0}
GameManager: {fileID: 0}
ContextMenu: {fileID: 0}
Title: {fileID: 2279630453679143108}
Dropdown: {fileID: 8289855250608258092}
Current: {fileID: 3016612072679339612}
Thermal: {fileID: 5512238094018694157}
Grid: {fileID: 2279630453710142156}
NodeBackgroundTextures:
- {fileID: -7421115223572569992, guid: d826c67011a143148bb7f6129549ef38, type: 3}
@ -1794,18 +2000,41 @@ MonoBehaviour:
- {fileID: 6047394896708382521, guid: ef4a863cd35ba454cb1d7e37e6388abe, type: 3}
- {fileID: -3137123266071239926, guid: ef4a863cd35ba454cb1d7e37e6388abe, type: 3}
- {fileID: 6575361018301538774, guid: ef4a863cd35ba454cb1d7e37e6388abe, type: 3}
ThermalTextures:
- {fileID: 3624413539235301459, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: 7631404538767374335, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: -4752754735582442470, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: -2120189714087908947, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: -8507936627233245176, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: -2508138221163281763, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: -9264146362022084, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: -4505807909773429587, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: 1571344320749704877, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: -6624953910322571867, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: -7524521870618806978, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: -551590714208027187, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: -2054774350801148439, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: 2949637312520497048, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: 6572578204425805008, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
- {fileID: -2189814545099003515, guid: a53955671598f6b4a8b23b245fc38605, type: 3}
ThermalToggleRegionSize: 0.2
NodePrototype: {fileID: 2279630454000268455}
TemperatureDisplay: {fileID: 1910900642664402175}
TemperatureColor: {fileID: 2800000, guid: dc6059983b32c9749a1d5975fd00ec48, type: 3}
TemperatureColorCurve:
Exponent: 0.5
Exponent: 1.4
Minimum: 0
Maximum: 1
TemperatureAlphaCurve:
Exponent: 0.15
Exponent: 0.25
Minimum: 0
Maximum: 1
MaxTemperature: 5000
MaxTemperature: 1000
FitToContent: 0
CellHitPulseTime: 0
ToggleEnabledColor: {r: 1, g: 0.44583336, b: 0.050000012, a: 1}
ToggleDisabledColor: {r: 0.638, g: 0.638, b: 0.638, a: 1}
CellBackgroundColor: {r: 0, g: 0, b: 0, a: 0.75}
EmptyCells: []
--- !u!222 &6932930312706461541
CanvasRenderer:
@ -2007,6 +2236,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
@ -2072,6 +2302,8 @@ RectTransform:
- {fileID: 4397116930423727094}
- {fileID: 2279630453679143107}
- {fileID: 2279630453117559409}
- {fileID: 5683613523479270443}
- {fileID: 6462754505713931446}
m_Father: {fileID: 2279630453886260053}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -2218,7 +2450,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 189.995, y: -20}
m_AnchoredPosition: {x: 209.12, y: -20}
m_SizeDelta: {x: 16, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6903091099768520881
@ -2307,6 +2539,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
@ -2429,3 +2662,206 @@ MonoBehaviour:
y: 0
width: 1
height: 1
--- !u!1 &8906074125575078972
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6462754505713931446}
- component: {fileID: 7628389798792906681}
- component: {fileID: 4516939325424632037}
- component: {fileID: 8742083009644556466}
- component: {fileID: 3016612072679339612}
m_Layer: 5
m_Name: Current
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6462754505713931446
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8906074125575078972}
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: 6584545650613466935}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: -8}
m_SizeDelta: {x: 78.1, y: 24}
m_Pivot: {x: 0, y: 1}
--- !u!222 &7628389798792906681
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8906074125575078972}
m_CullTransparentMesh: 0
--- !u!114 &4516939325424632037
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8906074125575078972}
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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 'Current
'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 53555f7a2d5e745428813f1b1118734f, type: 2}
m_sharedMaterial: {fileID: -2804126062856497447, guid: 53555f7a2d5e745428813f1b1118734f,
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_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 20
m_fontSizeBase: 20
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 4
m_VerticalAlignment: 512
m_textAlignment: 65535
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_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 1
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &8742083009644556466
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8906074125575078972}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, 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 &3016612072679339612
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8906074125575078972}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 4516939325424632037}
m_OnClick:
m_PersistentCalls:
m_Calls: []

BIN
Assets/Resources/Settings.asset (Stored with Git LFS)

Binary file not shown.

BIN
Assets/Resources/Sprites/Flat UI/pipes.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: 2328bcc7bc4840b438d5d2500c562a17
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Resources/Sprites/Flat UI/pipes.psd (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,492 @@
fileFormatVersion: 2
guid: a53955671598f6b4a8b23b245fc38605
TextureImporter:
internalIDToNameTable:
- first:
213: 3624413539235301459
second: pipes_0
- first:
213: 7631404538767374335
second: pipes_1
- first:
213: -4752754735582442470
second: pipes_2
- first:
213: -2120189714087908947
second: pipes_3
- first:
213: -8507936627233245176
second: pipes_4
- first:
213: -2508138221163281763
second: pipes_5
- first:
213: -9264146362022084
second: pipes_6
- first:
213: -4505807909773429587
second: pipes_7
- first:
213: 1571344320749704877
second: pipes_8
- first:
213: -6624953910322571867
second: pipes_9
- first:
213: -7524521870618806978
second: pipes_10
- first:
213: -551590714208027187
second: pipes_11
- first:
213: -2054774350801148439
second: pipes_12
- first:
213: 2949637312520497048
second: pipes_13
- first:
213: 6572578204425805008
second: pipes_14
- first:
213: -2189814545099003515
second: pipes_15
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: pipes_0
rect:
serializedVersion: 2
x: 1
y: 103
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 3588c3539e08c4230800000000000000
internalID: 3624413539235301459
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_1
rect:
serializedVersion: 2
x: 35
y: 103
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: ff7788ebef138e960800000000000000
internalID: 7631404538767374335
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_2
rect:
serializedVersion: 2
x: 69
y: 103
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: a1c8d09cfb2da0eb0800000000000000
internalID: -4752754735582442470
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_3
rect:
serializedVersion: 2
x: 103
y: 103
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: da96a5330b29392e0800000000000000
internalID: -2120189714087908947
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_4
rect:
serializedVersion: 2
x: 1
y: 69
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 8083a3ae6bcbde980800000000000000
internalID: -8507936627233245176
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_5
rect:
serializedVersion: 2
x: 35
y: 69
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: d928bf7939d413dd0800000000000000
internalID: -2508138221163281763
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_6
rect:
serializedVersion: 2
x: 69
y: 69
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: c37c1f6de461fdff0800000000000000
internalID: -9264146362022084
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_7
rect:
serializedVersion: 2
x: 103
y: 69
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: da43fcf24972871c0800000000000000
internalID: -4505807909773429587
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_8
rect:
serializedVersion: 2
x: 1
y: 35
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: da61d1a95598ec510800000000000000
internalID: 1571344320749704877
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_9
rect:
serializedVersion: 2
x: 35
y: 35
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 5a553e1e48f6f04a0800000000000000
internalID: -6624953910322571867
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_10
rect:
serializedVersion: 2
x: 69
y: 35
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: e35bb1da937839790800000000000000
internalID: -7524521870618806978
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_11
rect:
serializedVersion: 2
x: 103
y: 35
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: dcdf93afa2b5858f0800000000000000
internalID: -551590714208027187
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_12
rect:
serializedVersion: 2
x: 1
y: 1
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 9e5e9e65d99fb73e0800000000000000
internalID: -2054774350801148439
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_13
rect:
serializedVersion: 2
x: 35
y: 1
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 897a50502873fe820800000000000000
internalID: 2949637312520497048
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_14
rect:
serializedVersion: 2
x: 69
y: 1
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 0dc564dcd0d763b50800000000000000
internalID: 6572578204425805008
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_15
rect:
serializedVersion: 2
x: 103
y: 1
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 589e36bf5473c91e0800000000000000
internalID: -2189814545099003515
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 1
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1830,7 +1830,7 @@ RectTransform:
- {fileID: 1868140981}
- {fileID: 1080776604}
m_Father: {fileID: 761574181}
m_RootOrder: 7
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -4012,7 +4012,7 @@ RectTransform:
- {fileID: 1631662978}
- {fileID: 146394775}
m_Father: {fileID: 761574181}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@ -4612,6 +4612,8 @@ MonoBehaviour:
ContextMenu: {fileID: 1157981993}
Title: {fileID: 0}
Dropdown: {fileID: 0}
Current: {fileID: 0}
Thermal: {fileID: 0}
Grid: {fileID: 1359207440}
NodeBackgroundTextures:
- {fileID: -7421115223572569992, guid: d826c67011a143148bb7f6129549ef38, type: 3}
@ -5383,6 +5385,8 @@ MonoBehaviour:
- {fileID: 6047394896708382521, guid: ef4a863cd35ba454cb1d7e37e6388abe, type: 3}
- {fileID: -3137123266071239926, guid: ef4a863cd35ba454cb1d7e37e6388abe, type: 3}
- {fileID: 6575361018301538774, guid: ef4a863cd35ba454cb1d7e37e6388abe, type: 3}
ThermalTextures: []
ThermalToggleRegionSize: 0.2
NodePrototype: {fileID: 1889622745}
TemperatureDisplay: {fileID: 191729605}
TemperatureColor: {fileID: 2800000, guid: dc6059983b32c9749a1d5975fd00ec48, type: 3}
@ -5397,8 +5401,111 @@ MonoBehaviour:
MaxTemperature: 1000
FitToContent: 1
CellHitPulseTime: 0.5
ToggleEnabledColor: {r: 0, g: 0, b: 0, a: 0}
ToggleDisabledColor: {r: 0, g: 0, b: 0, a: 0}
CellBackgroundColor: {r: 0, g: 0, b: 0, a: 0.75}
EmptyCells: []
--- !u!1 &411347518
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 411347519}
- component: {fileID: 411347523}
- component: {fileID: 411347522}
- component: {fileID: 411347521}
- component: {fileID: 411347520}
m_Layer: 5
m_Name: Menu Background
m_TagString: UIBackground
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &411347519
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 411347518}
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: 761574181}
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!114 &411347520
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 411347518}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9643e74593988274bbed9adf40384e48, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &411347521
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 411347518}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3468b3db8d419c745b12124f6432696b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &411347522
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 411347518}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &411347523
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 411347518}
m_CullTransparentMesh: 0
--- !u!1 &425104907
GameObject:
m_ObjectHideFlags: 0
@ -5928,7 +6035,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 761574181}
m_RootOrder: 8
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -7431,7 +7538,7 @@ RectTransform:
- {fileID: 738229276}
- {fileID: 947321578}
m_Father: {fileID: 761574181}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -9438,6 +9545,7 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1273980439}
- {fileID: 411347519}
- {fileID: 1723136546}
- {fileID: 346000247}
- {fileID: 1726632265}
@ -13693,7 +13801,7 @@ RectTransform:
- {fileID: 1505831357}
- {fileID: 1741914910}
m_Father: {fileID: 761574181}
m_RootOrder: 6
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -15820,7 +15928,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 761574181}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@ -17143,12 +17251,12 @@ PrefabInstance:
- target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
@ -17163,12 +17271,12 @@ PrefabInstance:
- target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 55.675
value: 0
objectReference: {fileID: 0}
- target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -16
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1713457305180270767, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
@ -17999,12 +18107,12 @@ PrefabInstance:
- target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
@ -18019,12 +18127,12 @@ PrefabInstance:
- target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 60.98
value: 0
objectReference: {fileID: 0}
- target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -16
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1713457305180270767, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
@ -19023,7 +19131,7 @@ RectTransform:
m_Children:
- {fileID: 460484049}
m_Father: {fileID: 761574181}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 1}
@ -19156,7 +19264,7 @@ RectTransform:
- {fileID: 522642868}
- {fileID: 1783772015}
m_Father: {fileID: 761574181}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@ -21357,6 +21465,8 @@ MonoBehaviour:
GameManager: {fileID: 1009503729}
DragParent: {fileID: 245842385}
Dialog: {fileID: 620555924}
BackgroundEntered: {fileID: 411347521}
BackgroundExited: {fileID: 411347520}
--- !u!1 &2011788088
GameObject:
m_ObjectHideFlags: 0
@ -22738,6 +22848,11 @@ PrefabInstance:
propertyPath: m_SizeDelta.y
value: -583
objectReference: {fileID: 0}
- target: {fileID: 257019179596293679, guid: 426f9dcb510530d4dbfa678c9f727ec1,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 257019180101986795, guid: 426f9dcb510530d4dbfa678c9f727ec1,
type: 3}
propertyPath: m_AnchorMax.x
@ -23018,6 +23133,11 @@ PrefabInstance:
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2279630452592903581, guid: aac073da6df367d499834c926930dd84,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2279630452912159027, guid: aac073da6df367d499834c926930dd84,
type: 3}
propertyPath: m_AnchorMax.x
@ -23218,21 +23338,6 @@ PrefabInstance:
propertyPath: GameManager
value:
objectReference: {fileID: 1009503729}
- target: {fileID: 2279630453886260054, guid: aac073da6df367d499834c926930dd84,
type: 3}
propertyPath: MaxTemperature
value: 1000
objectReference: {fileID: 0}
- target: {fileID: 2279630453886260054, guid: aac073da6df367d499834c926930dd84,
type: 3}
propertyPath: TemperatureAlphaCurve.Exponent
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 2279630453886260054, guid: aac073da6df367d499834c926930dd84,
type: 3}
propertyPath: TemperatureColorCurve.Exponent
value: 1.4
objectReference: {fileID: 0}
- target: {fileID: 2279630454000268454, guid: aac073da6df367d499834c926930dd84,
type: 3}
propertyPath: m_AnchorMax.y
@ -27635,6 +27740,8 @@ MonoBehaviour:
ContextMenu: {fileID: 1157981993}
Title: {fileID: 0}
Dropdown: {fileID: 0}
Current: {fileID: 0}
Thermal: {fileID: 0}
Grid: {fileID: 7628189704016736660}
NodeBackgroundTextures:
- {fileID: -7421115223572569992, guid: d826c67011a143148bb7f6129549ef38, type: 3}
@ -28406,6 +28513,8 @@ MonoBehaviour:
- {fileID: 6047394896708382521, guid: ef4a863cd35ba454cb1d7e37e6388abe, type: 3}
- {fileID: -3137123266071239926, guid: ef4a863cd35ba454cb1d7e37e6388abe, type: 3}
- {fileID: 6575361018301538774, guid: ef4a863cd35ba454cb1d7e37e6388abe, type: 3}
ThermalTextures: []
ThermalToggleRegionSize: 0.2
NodePrototype: {fileID: 7628189703197605887}
TemperatureDisplay: {fileID: 7852865762198308775}
TemperatureColor: {fileID: 2800000, guid: dc6059983b32c9749a1d5975fd00ec48, type: 3}
@ -28420,6 +28529,8 @@ MonoBehaviour:
MaxTemperature: 1000
FitToContent: 1
CellHitPulseTime: 0.5
ToggleEnabledColor: {r: 0, g: 0, b: 0, a: 0}
ToggleDisabledColor: {r: 0, g: 0, b: 0, a: 0}
CellBackgroundColor: {r: 0, g: 0, b: 0, a: 0.75}
EmptyCells: []
--- !u!114 &7628189704109037583

View file

@ -50,7 +50,6 @@ public class ActionGameManager : MonoBehaviour
private float _time;
private AetheriaInput _input;
private int _zoomLevelIndex;
private Ship _currentShip;
// private ShipInput _shipInput;
private float2 _shipYawPitch;
@ -60,10 +59,7 @@ public class ActionGameManager : MonoBehaviour
public List<Ship> PlayerShips { get; } = new List<Ship>();
public EquippedDockingBay DockingBay { get; private set; }
public Ship CurrentShip
{
get => _currentShip;
}
public Ship CurrentShip { get; set; }
public DatabaseCache ItemData { get; private set; }
public ItemManager ItemManager { get; private set; }
public Zone Zone { get; private set; }
@ -123,12 +119,12 @@ public class ActionGameManager : MonoBehaviour
Cursor.lockState = CursorLockMode.Locked;
_input.Player.Enable();
Menu.gameObject.SetActive(false);
if (_currentShip != null && _currentShip.Parent == null)
if (CurrentShip != null && CurrentShip.Parent == null)
{
GameplayUI.SetActive(true);
SchematicDisplay.ShowShip(_currentShip);
ShipPanel.Display(_currentShip, true);
SchematicDisplay.ShowShip(CurrentShip);
ShipPanel.Display(CurrentShip, true);
}
return;
@ -138,7 +134,7 @@ public class ActionGameManager : MonoBehaviour
_input.Player.Disable();
GameplayUI.SetActive(false);
Menu.ShowTab(MenuTab.Map);
MenuMap.Position = _currentShip.Position.xz;
MenuMap.Position = CurrentShip.Position.xz;
};
_input.Global.Inventory.performed += context =>
@ -148,12 +144,12 @@ public class ActionGameManager : MonoBehaviour
Cursor.lockState = CursorLockMode.Locked;
_input.Player.Enable();
Menu.gameObject.SetActive(false);
if (_currentShip != null && _currentShip.Parent == null)
if (CurrentShip != null && CurrentShip.Parent == null)
{
GameplayUI.SetActive(true);
SchematicDisplay.ShowShip(_currentShip);
ShipPanel.Display(_currentShip, true);
SchematicDisplay.ShowShip(CurrentShip);
ShipPanel.Display(CurrentShip, true);
}
return;
}
@ -162,86 +158,79 @@ public class ActionGameManager : MonoBehaviour
_input.Player.Disable();
Menu.ShowTab(MenuTab.Inventory);
GameplayUI.SetActive(false);
var cargo = _currentShip.CargoBays.FirstOrDefault();
if (cargo != null)
{
Inventory.GetPanel.Display(cargo);
}
else Inventory.GetPanel.Clear();
Inventory.GetPanel.Display(_currentShip);
};
_input.Global.Dock.performed += context =>
{
if (_currentShip.Parent == null) Dock();
if (CurrentShip.Parent == null) Dock();
else Undock();
};
_input.Player.TargetReticle.performed += context =>
{
var underReticle = Zone.Entities.Where(x => x != _currentShip).MaxBy(x => dot(normalize(x.Position - _currentShip.Position), _currentShip.LookDirection));
_currentShip.Target.Value = _currentShip.Target.Value == underReticle ? null : underReticle;
var underReticle = Zone.Entities.Where(x => x != CurrentShip).MaxBy(x => dot(normalize(x.Position - CurrentShip.Position), CurrentShip.LookDirection));
CurrentShip.Target.Value = CurrentShip.Target.Value == underReticle ? null : underReticle;
};
_input.Player.TargetNearest.performed += context =>
{
_currentShip.Target.Value = Zone.Entities.Where(x=>x!=_currentShip).MaxBy(x => length(x.Position - _currentShip.Position));
CurrentShip.Target.Value = Zone.Entities.Where(x=>x!=CurrentShip).MaxBy(x => length(x.Position - CurrentShip.Position));
};
_input.Player.TargetNext.performed += context =>
{
var targets = Zone.Entities.Where(x => x != _currentShip).OrderBy(x => length(x.Position - _currentShip.Position)).ToArray();
var currentTargetIndex = Array.IndexOf(targets, _currentShip.Target.Value);
_currentShip.Target.Value = targets[(currentTargetIndex + 1) % targets.Length];
var targets = Zone.Entities.Where(x => x != CurrentShip).OrderBy(x => length(x.Position - CurrentShip.Position)).ToArray();
var currentTargetIndex = Array.IndexOf(targets, CurrentShip.Target.Value);
CurrentShip.Target.Value = targets[(currentTargetIndex + 1) % targets.Length];
};
_input.Player.TargetPrevious.performed += context =>
{
var targets = Zone.Entities.Where(x => x != _currentShip).OrderBy(x => length(x.Position - _currentShip.Position)).ToArray();
var currentTargetIndex = Array.IndexOf(targets, _currentShip.Target.Value);
_currentShip.Target.Value = targets[(currentTargetIndex + targets.Length - 1) % targets.Length];
var targets = Zone.Entities.Where(x => x != CurrentShip).OrderBy(x => length(x.Position - CurrentShip.Position)).ToArray();
var currentTargetIndex = Array.IndexOf(targets, CurrentShip.Target.Value);
CurrentShip.Target.Value = targets[(currentTargetIndex + targets.Length - 1) % targets.Length];
};
#region Trigger Groups
_input.Player.PreviousWeaponGroup.performed += context =>
{
if (_currentShip.Parent != null) return;
if (CurrentShip.Parent != null) return;
SchematicDisplay.SelectedGroupIndex--;
};
_input.Player.NextWeaponGroup.performed += context =>
{
if (_currentShip.Parent != null) return;
if (CurrentShip.Parent != null) return;
SchematicDisplay.SelectedGroupIndex++;
};
_input.Player.PreviousWeapon.performed += context =>
{
if (_currentShip.Parent != null) return;
if (CurrentShip.Parent != null) return;
SchematicDisplay.SelectedItemIndex--;
};
_input.Player.NextWeapon.performed += context =>
{
if (_currentShip.Parent != null) return;
if (CurrentShip.Parent != null) return;
SchematicDisplay.SelectedItemIndex++;
};
_input.Player.ToggleWeaponGroup.performed += context =>
{
if (_currentShip.Parent != null) return;
if (CurrentShip.Parent != null) return;
var item = SchematicDisplay.SchematicItems[SchematicDisplay.SelectedItemIndex];
if (_currentShip.TriggerGroups[SchematicDisplay.SelectedGroupIndex].Contains(item.Item))
_currentShip.TriggerGroups[SchematicDisplay.SelectedGroupIndex].Remove(item.Item);
else _currentShip.TriggerGroups[SchematicDisplay.SelectedGroupIndex].Add(item.Item);
if (CurrentShip.TriggerGroups[SchematicDisplay.SelectedGroupIndex].Contains(item.Item))
CurrentShip.TriggerGroups[SchematicDisplay.SelectedGroupIndex].Remove(item.Item);
else CurrentShip.TriggerGroups[SchematicDisplay.SelectedGroupIndex].Add(item.Item);
SchematicDisplay.UpdateTriggerGroups();
};
_input.Player.FireGroup1.started += context =>
{
if (_currentShip.Parent != null) return;
foreach (var item in _currentShip.TriggerGroups[0])
if (CurrentShip.Parent != null) return;
foreach (var item in CurrentShip.TriggerGroups[0])
{
foreach (var behaviors in item.BehaviorGroups)
{
@ -254,8 +243,8 @@ public class ActionGameManager : MonoBehaviour
_input.Player.FireGroup1.canceled += context =>
{
if (_currentShip.Parent != null) return;
foreach (var item in _currentShip.TriggerGroups[0])
if (CurrentShip.Parent != null) return;
foreach (var item in CurrentShip.TriggerGroups[0])
{
foreach (var behaviors in item.BehaviorGroups)
{
@ -267,8 +256,8 @@ public class ActionGameManager : MonoBehaviour
_input.Player.FireGroup2.started += context =>
{
if (_currentShip.Parent != null) return;
foreach (var item in _currentShip.TriggerGroups[1])
if (CurrentShip.Parent != null) return;
foreach (var item in CurrentShip.TriggerGroups[1])
{
foreach (var behaviors in item.BehaviorGroups)
{
@ -281,8 +270,8 @@ public class ActionGameManager : MonoBehaviour
_input.Player.FireGroup2.canceled += context =>
{
if (_currentShip.Parent != null) return;
foreach (var item in _currentShip.TriggerGroups[1])
if (CurrentShip.Parent != null) return;
foreach (var item in CurrentShip.TriggerGroups[1])
{
foreach (var behaviors in item.BehaviorGroups)
{
@ -294,8 +283,8 @@ public class ActionGameManager : MonoBehaviour
_input.Player.FireGroup3.started += context =>
{
if (_currentShip.Parent != null) return;
foreach (var item in _currentShip.TriggerGroups[2])
if (CurrentShip.Parent != null) return;
foreach (var item in CurrentShip.TriggerGroups[2])
{
foreach (var behaviors in item.BehaviorGroups)
{
@ -308,8 +297,8 @@ public class ActionGameManager : MonoBehaviour
_input.Player.FireGroup3.canceled += context =>
{
if (_currentShip.Parent != null) return;
foreach (var item in _currentShip.TriggerGroups[2])
if (CurrentShip.Parent != null) return;
foreach (var item in CurrentShip.TriggerGroups[2])
{
foreach (var behaviors in item.BehaviorGroups)
{
@ -321,8 +310,8 @@ public class ActionGameManager : MonoBehaviour
_input.Player.FireGroup4.started += context =>
{
if (_currentShip.Parent != null) return;
foreach (var item in _currentShip.TriggerGroups[3])
if (CurrentShip.Parent != null) return;
foreach (var item in CurrentShip.TriggerGroups[3])
{
foreach (var behaviors in item.BehaviorGroups)
{
@ -335,8 +324,8 @@ public class ActionGameManager : MonoBehaviour
_input.Player.FireGroup4.canceled += context =>
{
if (_currentShip.Parent != null) return;
foreach (var item in _currentShip.TriggerGroups[3])
if (CurrentShip.Parent != null) return;
foreach (var item in CurrentShip.TriggerGroups[3])
{
foreach (var behaviors in item.BehaviorGroups)
{
@ -348,8 +337,8 @@ public class ActionGameManager : MonoBehaviour
_input.Player.FireGroup5.started += context =>
{
if (_currentShip.Parent != null) return;
foreach (var item in _currentShip.TriggerGroups[4])
if (CurrentShip.Parent != null) return;
foreach (var item in CurrentShip.TriggerGroups[4])
{
foreach (var behaviors in item.BehaviorGroups)
{
@ -362,8 +351,8 @@ public class ActionGameManager : MonoBehaviour
_input.Player.FireGroup5.canceled += context =>
{
if (_currentShip.Parent != null) return;
foreach (var item in _currentShip.TriggerGroups[4])
if (CurrentShip.Parent != null) return;
foreach (var item in CurrentShip.TriggerGroups[4])
{
foreach (var behaviors in item.BehaviorGroups)
{
@ -375,8 +364,8 @@ public class ActionGameManager : MonoBehaviour
_input.Player.FireGroup6.started += context =>
{
if (_currentShip.Parent != null) return;
foreach (var item in _currentShip.TriggerGroups[5])
if (CurrentShip.Parent != null) return;
foreach (var item in CurrentShip.TriggerGroups[5])
{
foreach (var behaviors in item.BehaviorGroups)
{
@ -389,8 +378,8 @@ public class ActionGameManager : MonoBehaviour
_input.Player.FireGroup6.canceled += context =>
{
if (_currentShip.Parent != null) return;
foreach (var item in _currentShip.TriggerGroups[5])
if (CurrentShip.Parent != null) return;
foreach (var item in CurrentShip.TriggerGroups[5])
{
foreach (var behaviors in item.BehaviorGroups)
{
@ -454,15 +443,15 @@ public class ActionGameManager : MonoBehaviour
var shipHull = ItemManager.CreateInstance(hullType, 0, 1) as EquippableItem;
var ship = new Ship(ItemManager, Zone, shipHull);
PlayerShips.Add(ship);
_currentShip = ship;
_currentShip.Target.Subscribe(target =>
CurrentShip = ship;
CurrentShip.Target.Subscribe(target =>
{
TargetIndicator.gameObject.SetActive(_currentShip.Target.Value != null);
TargetIndicator.gameObject.SetActive(CurrentShip.Target.Value != null);
TargetShipPanel.gameObject.SetActive(target != null);
if (target != null)
{
TargetShipPanel.Display(target, true);
TargetSchematicDisplay.ShowShip(target, _currentShip);
TargetSchematicDisplay.ShowShip(target, CurrentShip);
}
});
ship.ArmorDamage.Subscribe(hit =>
@ -478,7 +467,7 @@ public class ActionGameManager : MonoBehaviour
var data = ItemManager.GetData(hit.item.EquippableItem);
EventLog.LogMessage(
$"{hit.item.EquippableItem.Name} hit for {hit.damage} damage, currently {((int) (hit.item.EquippableItem.Durability / data.Durability * 100)).ToString()}%",
data.HardpointType == HardpointType.Thermal ? Settings.ThermalHitColor : Settings.GearHitColor);
Settings.GearHitColor);
});
ship.HardpointDamage.Subscribe(hit => EventLog.LogMessage(
$"{Enum.GetName(typeof(HardpointType), hit.hardpoint.Type)} hardpoint hit for {hit.damage} damage, currently {((int) (ship.HardpointArmor[hit.hardpoint] / hit.hardpoint.Armor * 100)).ToString()}%",
@ -524,27 +513,25 @@ public class ActionGameManager : MonoBehaviour
public void Dock()
{
if (_currentShip.Parent != null) return;
if (CurrentShip.Parent != null) return;
foreach (var entity in Zone.Entities.ToArray())
{
if (lengthsq(entity.Position.xz - _currentShip.Position.xz) <
if (lengthsq(entity.Position.xz - CurrentShip.Position.xz) <
Settings.GameplaySettings.DockingDistance * Settings.GameplaySettings.DockingDistance)
{
var bay = entity.TryDock(_currentShip);
var bay = entity.TryDock(CurrentShip);
if (bay != null)
{
DockingBay = bay;
DockCamera.enabled = true;
FollowCamera.enabled = false;
_currentShip.Active = false;
CurrentShip.Active = false;
var orbital = (OrbitalEntity) entity;
DockCamera.Follow = SectorRenderer.EntityInstances[orbital].Transform;
var parentOrbit = Zone.Orbits[orbital.OrbitData].Data.Parent;
var parentPlanet = SectorRenderer.Planets[Zone.Planets.FirstOrDefault(p => p.Value.Orbit == parentOrbit).Key];
DockCamera.LookAt = parentPlanet.Body.transform;
Menu.ShowTab(MenuTab.Inventory);
Inventory.GetPanel.Display(bay);
Inventory.GetPanel.Display(_currentShip);
Cursor.lockState = CursorLockMode.None;
_input.Player.Disable();
GameplayUI.SetActive(false);
@ -557,44 +544,44 @@ public class ActionGameManager : MonoBehaviour
public void Undock()
{
if (_currentShip.Parent == null) return;
if (_currentShip.GetBehavior<Cockpit>() == null)
if (CurrentShip.Parent == null) return;
if (CurrentShip.GetBehavior<Cockpit>() == null)
{
ConfirmationDialog.Clear();
ConfirmationDialog.Title.text = "Can't undock. Missing cockpit component!";
ConfirmationDialog.Show();
}
else if (_currentShip.GetBehavior<Thruster>() == null)
else if (CurrentShip.GetBehavior<Thruster>() == null)
{
ConfirmationDialog.Clear();
ConfirmationDialog.Title.text = "Can't undock. Missing thruster component!";
ConfirmationDialog.Show();
}
else if (_currentShip.GetBehavior<Reactor>() == null)
else if (CurrentShip.GetBehavior<Reactor>() == null)
{
ConfirmationDialog.Clear();
ConfirmationDialog.Title.text = "Can't undock. Missing reactor component!";
ConfirmationDialog.Show();
}
else if (_currentShip.Parent.TryUndock(_currentShip))
else if (CurrentShip.Parent.TryUndock(CurrentShip))
{
Menu.gameObject.SetActive(false);
DockingBay = null;
_currentShip.Active = true;
CurrentShip.Active = true;
//_shipInput = new ShipInput(_input.Player, _currentShip);
DockCamera.enabled = false;
FollowCamera.enabled = true;
FollowCamera.LookAt = SectorRenderer.EntityInstances[_currentShip].LookAtPoint;
FollowCamera.Follow = SectorRenderer.EntityInstances[_currentShip].Transform;
ArticulationGroups = _currentShip.Equipment
FollowCamera.LookAt = SectorRenderer.EntityInstances[CurrentShip].LookAtPoint;
FollowCamera.Follow = SectorRenderer.EntityInstances[CurrentShip].Transform;
ArticulationGroups = CurrentShip.Equipment
.Where(item => item.Behaviors.Any(x => x.Data is WeaponData && !(x.Data is LauncherData)))
.GroupBy(item => SectorRenderer.EntityInstances[_currentShip]
.GetBarrel(_currentShip.Hardpoints[item.Position.x, item.Position.y])
.GroupBy(item => SectorRenderer.EntityInstances[CurrentShip]
.GetBarrel(CurrentShip.Hardpoints[item.Position.x, item.Position.y])
.GetComponentInParent<ArticulationPoint>()?.Group ?? -1)
.Select((group, index) => {
return (
group.Select(item => _currentShip.Hardpoints[item.Position.x, item.Position.y]).ToArray(),
group.Select(item => SectorRenderer.EntityInstances[_currentShip].GetBarrel(_currentShip.Hardpoints[item.Position.x, item.Position.y])).ToArray(),
group.Select(item => CurrentShip.Hardpoints[item.Position.x, item.Position.y]).ToArray(),
group.Select(item => SectorRenderer.EntityInstances[CurrentShip].GetBarrel(CurrentShip.Hardpoints[item.Position.x, item.Position.y])).ToArray(),
Crosshairs[index]
);
}).ToArray();
@ -604,7 +591,7 @@ public class ActionGameManager : MonoBehaviour
foreach (var group in ArticulationGroups)
group.crosshair.gameObject.SetActive(true);
LockingIndicators = _currentShip.GetBehaviors<TargetLock>().Select(x =>
LockingIndicators = CurrentShip.GetBehaviors<TargetLock>().Select(x =>
{
var i = LockIndicator.Instantiate<PlaceUIElementWorldspace>();
return (x, i, i.GetComponent<Rotate>());
@ -614,8 +601,8 @@ public class ActionGameManager : MonoBehaviour
Cursor.lockState = CursorLockMode.Locked;
GameplayUI.SetActive(true);
_input.Player.Enable();
ShipPanel.Display(_currentShip, true);
SchematicDisplay.ShowShip(_currentShip);
ShipPanel.Display(CurrentShip, true);
SchematicDisplay.ShowShip(CurrentShip);
}
else
{
@ -636,9 +623,9 @@ public class ActionGameManager : MonoBehaviour
public IEnumerable<EquippedCargoBay> AvailableCargoBays()
{
if (_currentShip.Parent != null)
if (CurrentShip.Parent != null)
{
foreach (var bay in _currentShip.Parent.DockingBays)
foreach (var bay in CurrentShip.Parent.DockingBays)
{
if (PlayerShips.Contains(bay.DockedShip)) yield return bay;
}
@ -647,15 +634,15 @@ public class ActionGameManager : MonoBehaviour
public IEnumerable<Ship> AvailableShips()
{
if (_currentShip.Parent != null)
if (CurrentShip.Parent != null)
{
foreach (var ship in PlayerShips)
{
if (_currentShip.Parent.Children.Contains(ship)) yield return ship;
if (CurrentShip.Parent.Children.Contains(ship)) yield return ship;
}
}
else
yield return _currentShip;
yield return CurrentShip;
}
void Update()
@ -664,13 +651,13 @@ public class ActionGameManager : MonoBehaviour
{
_time += Time.deltaTime;
ItemManager.Time = Time.time;
if(_currentShip.Parent==null)
if(CurrentShip.Parent==null)
{
var look = _input.Player.Look.ReadValue<Vector2>();
_shipYawPitch = float2(_shipYawPitch.x + look.x * Sensitivity.x, clamp(_shipYawPitch.y + look.y * Sensitivity.y, -.45f * PI, .45f * PI));
_viewDirection = mul(float3(0, 0, 1), Unity.Mathematics.float3x3.Euler(float3(_shipYawPitch.yx, 0), RotationOrder.YXZ));
_currentShip.LookDirection = _viewDirection;
_currentShip.MovementDirection = _input.Player.Move.ReadValue<Vector2>();
CurrentShip.LookDirection = _viewDirection;
CurrentShip.MovementDirection = _input.Player.Move.ReadValue<Vector2>();
}
}
Zone.Update(_time, Time.deltaTime);
@ -684,12 +671,12 @@ public class ActionGameManager : MonoBehaviour
private void UpdateTargetIndicators()
{
if (_currentShip == null || _currentShip.Parent != null) return;
if (CurrentShip == null || CurrentShip.Parent != null) return;
ViewDot.Target = SectorRenderer.EntityInstances[_currentShip].LookAtPoint.position;
if (_currentShip.Target.Value != null)
TargetIndicator.Target = _currentShip.Target.Value.Position;
var distance = length((float3)ViewDot.Target - _currentShip.Position);
ViewDot.Target = SectorRenderer.EntityInstances[CurrentShip].LookAtPoint.position;
if (CurrentShip.Target.Value != null)
TargetIndicator.Target = CurrentShip.Target.Value.Position;
var distance = length((float3)ViewDot.Target - CurrentShip.Position);
foreach (var (_, barrels, crosshair) in ArticulationGroups)
{
var averagePosition = Vector3.zero;
@ -700,10 +687,10 @@ public class ActionGameManager : MonoBehaviour
}
foreach (var (targetLock, indicator, spin) in LockingIndicators)
{
var showLockingIndicator = targetLock.Lock > .01f && _currentShip.Target.Value != null;
var showLockingIndicator = targetLock.Lock > .01f && CurrentShip.Target.Value != null;
indicator.gameObject.SetActive(showLockingIndicator);
if(showLockingIndicator)
indicator.Target = _currentShip.Target.Value.Position;
indicator.Target = CurrentShip.Target.Value.Position;
indicator.NoiseAmplitude = Settings.GameplaySettings.LockIndicatorNoiseAmplitude * (1 - targetLock.Lock);
indicator.NoiseFrequency = Settings.GameplaySettings.LockIndicatorFrequency.Evaluate(targetLock.Lock);
spin.Speed = Settings.GameplaySettings.LockSpinSpeed.Evaluate(targetLock.Lock);

View file

@ -4,7 +4,7 @@ MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
executionOrder: -10
icon: {instanceID: 0}
userData:
assetBundleName:

View file

@ -28,7 +28,6 @@ public class GameSettings : ScriptableObject
public Color ArmorHitColor;
public Color HardpointHitColor;
public Color GearHitColor;
public Color ThermalHitColor;
public Gradient ArmorGradient;
public Gradient DurabilityGradient;
[HideInInspector] public Sprite[] ItemIcons;

View file

@ -19,6 +19,8 @@ public class InventoryMenu : MonoBehaviour
public ActionGameManager GameManager;
public RectTransform DragParent;
public ConfirmationDialog Dialog;
public ObservablePointerEnterTrigger BackgroundEntered;
public ObservablePointerExitTrigger BackgroundExited;
private int _currentPanel = -1;
@ -41,9 +43,31 @@ public class InventoryMenu : MonoBehaviour
private int2 _dragTargetPosition;
private int2 _lastDragPosition;
private bool _dragTargetValid;
private bool _destroyItem;
private void OnEnable()
{
BackgroundEntered.gameObject.SetActive(true);
BackgroundEntered.OnPointerEnterAsObservable().Subscribe(enter =>
{
_destroyItem = true;
});
BackgroundExited.OnPointerExitAsObservable().Subscribe(enter =>
{
_destroyItem = false;
});
var cargo = GameManager.DockingBay ?? GameManager.CurrentShip.CargoBays.FirstOrDefault();
if (cargo!=null)
InventoryPanels[0].Display(cargo);
InventoryPanels[1].Display(GameManager.CurrentShip);
}
private void OnDisable()
{
BackgroundEntered.gameObject.SetActive(false);
}
public InventoryPanel GetPanel => InventoryPanels[_currentPanel = (_currentPanel + 1) % InventoryPanels.Length];
void Start()
{
PropertiesPanel.Context = GameManager.ItemManager;
@ -150,6 +174,25 @@ public class InventoryMenu : MonoBehaviour
{
_dragItem.Rotation = _originalRotation;
}
if (_destroyItem)
{
if (data is InventoryCargoEventData cargoEvent)
{
cargoEvent.CargoBay.Remove(_dragItem);
}
else if (data is InventoryEntityEventData entityEvent)
{
if (entityEvent.Entity.Unequip(_originalEquippedItem) == null)
{
Dialog.Clear();
Dialog.Title.text = "Unable to destroy item!";
Dialog.AddProperty("Verify that cargo bays are empty before un-equipping them.");
Dialog.Show();
}
}
}
panel.IgnoreOccupancy = null;
panel.RefreshCells();
if(_dragTargetPanel!=panel)

View file

@ -5,6 +5,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UniRx.Triggers;
using UnityEngine;
public class MenuPanel : MonoBehaviour
@ -50,7 +51,7 @@ public class MenuPanel : MonoBehaviour
}
}
void Awake()
private void Awake()
{
foreach (var tabButton in TabButtons.GetComponentsInChildren<MenuTabButton>())
{
@ -59,8 +60,12 @@ public class MenuPanel : MonoBehaviour
_tabs.Add(tabButton.Tab, tabButton);
tabButton.Button.onClick.AddListener(() => ShowTab(tabButton.Tab));
}
ShowTab(MenuTab.Inventory);
}
// void Start()
// {
// ShowTab(MenuTab.Inventory);
// }
}
public enum MenuTab

View file

@ -269,30 +269,14 @@ public class SectorRenderer : MonoBehaviour
}
}
// Search all cells occupied by target cells for any thermal equipment
var equippedThermals = new List<EquippedItem>();
foreach (var hullCoord in hitShape.Coordinates)
{
if (entity.ThermalOccupancy[hullCoord.x, hullCoord.y] != null)
{
equippedThermals.Add(entity.ThermalOccupancy[hullCoord.x, hullCoord.y]);
}
}
float remainder = 0;
// Direct damage is divided between gear and thermal equipment (if present)
if (equippedGear != null && equippedThermals.Count > 0)
if (equippedGear != null)
{
remainder = max(directDamage / 2 - equippedGear.EquippableItem.Durability, 0);
equippedGear.EquippableItem.Durability = max(equippedGear.EquippableItem.Durability - directDamage / 2, 0);
entity.ItemDamage.OnNext((equippedGear, directDamage / 2));
foreach (var t in equippedThermals)
{
remainder += max(directDamage / (2 * equippedThermals.Count) - t.EquippableItem.Durability, 0);
t.EquippableItem.Durability = max(equippedGear.EquippableItem.Durability - directDamage / (2 * equippedThermals.Count), 0);
entity.ItemDamage.OnNext((t, directDamage / (2 * equippedThermals.Count)));
}
}
else if (equippedGear != null)
{
@ -300,15 +284,6 @@ public class SectorRenderer : MonoBehaviour
equippedGear.EquippableItem.Durability = max(equippedGear.EquippableItem.Durability - directDamage, 0);
entity.ItemDamage.OnNext((equippedGear, directDamage));
}
else if (equippedThermals.Count > 0)
{
foreach (var t in equippedThermals)
{
remainder += max(directDamage / (equippedThermals.Count) - t.EquippableItem.Durability, 0);
t.EquippableItem.Durability = max(equippedGear.EquippableItem.Durability - directDamage / equippedThermals.Count, 0);
entity.ItemDamage.OnNext((t, directDamage / equippedThermals.Count));
}
}
else remainder = directDamage;
// Direct damage remaining after all items are destroyed damages the hull
@ -331,8 +306,6 @@ public class SectorRenderer : MonoBehaviour
{
if (entity.GearOccupancy[hullCoord.x, hullCoord.y] != null)
surroundingEquipment.Add(entity.GearOccupancy[hullCoord.x, hullCoord.y]);
if (entity.ThermalOccupancy[hullCoord.x, hullCoord.y] != null)
surroundingEquipment.Add(entity.ThermalOccupancy[hullCoord.x, hullCoord.y]);
}
// Divide spread damage among all surrounding cells
@ -402,8 +375,7 @@ public class SectorRenderer : MonoBehaviour
var penetrationPoint = float2(hitCell);
var penetrationCell = hitCell;
while (hullData.Shape[penetrationCell] &&
entity.GearOccupancy[penetrationCell.x, penetrationCell.y] == null &&
entity.ThermalOccupancy[penetrationCell.x, penetrationCell.y] == null)
entity.GearOccupancy[penetrationCell.x, penetrationCell.y] == null)
{
penetrationPoint += penetrationVector * .5f;
penetrationCell = int2(penetrationPoint);

View file

@ -28,7 +28,7 @@ public abstract class Entity
public float2 Velocity;
public float[,] Temperature;
public float4[,] Conductivity;
public bool2[,] HullConductivity;
public float[,] ThermalMass;
public float Energy;
@ -58,7 +58,6 @@ public abstract class Entity
public List<IPopulationAssignment> PopulationAssignments = new List<IPopulationAssignment>();
public EquippedItem[,] GearOccupancy;
public EquippedItem[,] ThermalOccupancy;
public HardpointData[,] Hardpoints;
public float[,] Armor;
@ -123,7 +122,7 @@ public abstract class Entity
Equipment.Add(new EquippedItem(ItemManager, Hull, int2.zero, this));
Mass = hullData.Mass;
Temperature = new float[hullData.Shape.Width, hullData.Shape.Height];
Conductivity = new float4[hullData.Shape.Width, hullData.Shape.Height];
HullConductivity = new bool2[hullData.Shape.Width,hullData.Shape.Height];
ThermalMass = new float[hullData.Shape.Width, hullData.Shape.Height];
Armor = new float[hullData.Shape.Width, hullData.Shape.Height];
var cellCount = hullData.Shape.Coordinates.Length;
@ -132,11 +131,9 @@ public abstract class Entity
if (!hullData.InteriorCells[v])
Armor[v.x, v.y] = hullData.Armor;
Temperature[v.x, v.y] = 280;
Conductivity[v.x, v.y] = hullData.Conductivity;
ThermalMass[v.x, v.y] = hullData.Mass * hullData.SpecificHeat / cellCount;
}
GearOccupancy = new EquippedItem[hullData.Shape.Width, hullData.Shape.Height];
ThermalOccupancy = new EquippedItem[hullData.Shape.Width, hullData.Shape.Height];
Hardpoints = new HardpointData[hullData.Shape.Width, hullData.Shape.Height];
foreach (var hardpoint in hullData.Hardpoints)
{
@ -232,13 +229,11 @@ public abstract class Entity
var hullData = ItemManager.GetData(Hull) as HullData;
var itemData = ItemManager.GetData(item.EquippableItem);
var itemLayer = (itemData.HardpointType == HardpointType.Thermal ? ThermalOccupancy : GearOccupancy);
foreach (var i in hullData.Shape.Coordinates)
if (itemLayer[i.x, i.y] == item)
if (GearOccupancy[i.x, i.y] == item)
{
ThermalMass[i.x, i.y] -= ItemManager.GetThermalMass(item.EquippableItem) / itemData.Shape.Coordinates.Length;
Conductivity[i.x, i.y] /= itemData.Conductivity;
itemLayer[i.x, i.y] = null;
GearOccupancy[i.x, i.y] = null;
}
Mass -= itemData.Mass;
@ -252,7 +247,7 @@ public abstract class Entity
if (!hullData.Shape[hullCoord]) return false;
// Items without specific hardpoints on the ship can be freely rotated and placed anywhere
if (itemData.HardpointType == HardpointType.Tool || itemData.HardpointType == HardpointType.Thermal)
if (itemData.HardpointType == HardpointType.Tool)
{
// Check every cell of the item's shape
foreach (var i in itemData.Shape.Coordinates)
@ -261,7 +256,10 @@ public abstract class Entity
// If there's a hardpoint there, it won't fit
// Thermal items have their own layer and do not collide with gear
var itemCoord = hullCoord + itemData.Shape.Rotate(i, item.Rotation);
if (!hullData.InteriorCells[itemCoord] || (itemData.HardpointType == HardpointType.Tool && Hardpoints[itemCoord.x, itemCoord.y] != null) || (itemData.HardpointType == HardpointType.Thermal ? ThermalOccupancy : GearOccupancy)[itemCoord.x, itemCoord.y] != null) return false;
if (!hullData.InteriorCells[itemCoord] ||
itemData.HardpointType == HardpointType.Tool && Hardpoints[itemCoord.x, itemCoord.y] != null ||
GearOccupancy[itemCoord.x, itemCoord.y] != null)
return false;
}
}
else
@ -315,7 +313,7 @@ public abstract class Entity
// Tools and thermal equipment can be installed anywhere on the ship
// Search the whole ship for somewhere the item will fit
if (itemData.HardpointType == HardpointType.Tool || itemData.HardpointType == HardpointType.Thermal)
if (itemData.HardpointType == HardpointType.Tool)
{
foreach (var hullCoord2 in hullData.InteriorCells.Coordinates)
{
@ -364,7 +362,7 @@ public abstract class Entity
if (!ItemFits(itemData, hullData, item, hullCoord)) return false;
EquippedItem equippedItem;
if (itemData.HardpointType == HardpointType.Tool || itemData.HardpointType == HardpointType.Thermal)
if (itemData.HardpointType == HardpointType.Tool)
{
if(itemData is CargoBayData)
{
@ -396,8 +394,7 @@ public abstract class Entity
var occupiedCoord = hullCoord + itemData.Shape.Rotate(i, item.Rotation);
// TODO: Track thermal mass of cargo bay contents as reactive property
ThermalMass[occupiedCoord.x, occupiedCoord.y] += ItemManager.GetThermalMass(item) / itemData.Shape.Coordinates.Length;
Conductivity[occupiedCoord.x, occupiedCoord.y] *= itemData.Conductivity;
(itemData.HardpointType == HardpointType.Thermal ? ThermalOccupancy : GearOccupancy)[occupiedCoord.x, occupiedCoord.y] = equippedItem;
GearOccupancy[occupiedCoord.x, occupiedCoord.y] = equippedItem;
}
Mass += itemData.Mass;
@ -437,13 +434,13 @@ public abstract class Entity
return true;
}
public void AddChild(Entity entity)
private void AddChild(Entity entity)
{
Mass += entity.Mass;
Children.Add(entity);
}
public void RemoveChild(Entity entity)
private void RemoveChild(Entity entity)
{
Mass -= entity.Mass;
Children.Remove(entity);
@ -521,28 +518,43 @@ public abstract class Entity
var temp = Temperature[v.x, v.y];
var heatTransfer = 0f;
if (v.x > 0)
heatTransfer += (Temperature[v.x - 1, v.y] - temp) * Conductivity[v.x, v.y].y * Conductivity[v.x - 1, v.y].w;
if (hullData.Shape[int2(v.x - 1, v.y)])
heatTransfer += (Temperature[v.x - 1, v.y] - temp) *
(GearOccupancy[v.x, v.y]?.Conductivity ?? 1) *
(GearOccupancy[v.x - 1, v.y]?.Conductivity ?? 1) *
(HullConductivity[v.x - 1, v.y].x ? hullData.Conductivity : 1 / hullData.Conductivity);
if (hullData.Shape[int2(v.x + 1, v.y)])
heatTransfer += (Temperature[v.x + 1, v.y] - temp) *
(GearOccupancy[v.x, v.y]?.Conductivity ?? 1) *
(GearOccupancy[v.x + 1, v.y]?.Conductivity ?? 1) *
(HullConductivity[v.x, v.y].x ? hullData.Conductivity : 1 / hullData.Conductivity);
if (v.x < hullData.Shape.Width - 1)
heatTransfer += (Temperature[v.x + 1, v.y] - temp) * Conductivity[v.x, v.y].w * Conductivity[v.x + 1, v.y].y;
if (hullData.Shape[int2(v.x, v.y - 1)])
heatTransfer += (Temperature[v.x, v.y - 1] - temp) *
(GearOccupancy[v.x, v.y]?.Conductivity ?? 1) *
(GearOccupancy[v.x, v.y - 1]?.Conductivity ?? 1) *
(HullConductivity[v.x, v.y - 1].y ? hullData.Conductivity : 1 / hullData.Conductivity);
if (v.y > 0)
heatTransfer += (Temperature[v.x, v.y - 1] - temp) * Conductivity[v.x, v.y].z * Conductivity[v.x, v.y - 1].x;
if (v.y < hullData.Shape.Height - 1)
heatTransfer += (Temperature[v.x, v.y + 1] - temp) * Conductivity[v.x, v.y].x * Conductivity[v.x, v.y + 1].z;
if (hullData.Shape[int2(v.x, v.y + 1)])
heatTransfer += (Temperature[v.x, v.y + 1] - temp) *
(GearOccupancy[v.x, v.y]?.Conductivity ?? 1) *
(GearOccupancy[v.x, v.y + 1]?.Conductivity ?? 1) *
(HullConductivity[v.x, v.y].y ? hullData.Conductivity : 1 / hullData.Conductivity);
newTemp[v.x, v.y] = Temperature[v.x, v.y] + heatTransfer * min(ItemManager.GameplaySettings.HeatConductionMultiplier * delta,1) / ThermalMass[v.x,v.y];
// For all cells on the border of the entity, radiate some heat into space, increasing the visibility of the ship
if (!hullData.InteriorCells[v])
if (Parent==null && !hullData.InteriorCells[v])
{
var rad = pow(newTemp[v.x, v.y], ItemManager.GameplaySettings.HeatRadiationExponent) *
ItemManager.GameplaySettings.HeatRadiationMultiplier;
newTemp[v.x, v.y] -= rad * delta;
radiation += rad;
}
if(float.IsNaN(newTemp[v.x, v.y]) || newTemp[v.x, v.y] < 0)
ItemManager.Log("HOUSTON, WE HAVE A PROBLEM!");
}
VisibilitySources[this] = radiation;
@ -608,19 +620,18 @@ public abstract class Entity
// }
}
[MessagePackObject, JsonObject(MemberSerialization.OptIn)]
public class EquippedItem
{
[JsonProperty("item"), Key(0)] public EquippableItem EquippableItem;
public EquippableItem EquippableItem;
[JsonProperty("position"), Key(1)] public int2 Position;
public int2 Position;
[IgnoreMember]
public IBehavior[] Behaviors;
[IgnoreMember]
public BehaviorGroup[] BehaviorGroups;
public float Conductivity { get; }
public Shape InsetShape { get; }
public int SortPosition;
@ -648,6 +659,7 @@ public class EquippedItem
_entity = entity;
EquippableItem = item;
Position = position;
Conductivity = _data.Conductivity;
var hullData = itemManager.GetData(entity.Hull);
InsetShape = hullData.Shape.Inset(_data.Shape, position, item.Rotation);
@ -689,8 +701,8 @@ public class EquippedItem
EquippableItem.Durability -= delta;
}
foreach (var behavior in Behaviors.Where(b => b is IAlwaysUpdatedBehavior).Cast<IAlwaysUpdatedBehavior>())
behavior.Update(delta);
foreach (var behavior in Behaviors)//.Where(b => b is IAlwaysUpdatedBehavior).Cast<IAlwaysUpdatedBehavior>())
if(behavior is IAlwaysUpdatedBehavior alwaysUpdatedBehavior) alwaysUpdatedBehavior.Update(delta);
if (Online)
{

View file

@ -83,21 +83,21 @@ public enum MegaPlacementType
public enum SimpleCommodityCategory
{
Minerals,
Metals,
Alloys,
Compounds,
Organics,
Ammo,
Consumer
Minerals = 0,
Metals = 1,
Alloys = 2,
Compounds = 3,
Organics = 4,
Ammo = 5,
Consumer = 6
}
public enum CompoundCommodityCategory
{
Wearables,
Consumables,
Luxuries,
Tools,
Manufacturing,
Assemblies
Wearables = 0,
Consumables = 1,
Luxuries = 2,
Tools = 3,
Manufacturing = 4,
Assemblies = 5
}

View file

@ -192,20 +192,26 @@ public abstract class ItemData : DatabaseEntry, INamedEntry
[InspectableText, JsonProperty("description"), Key(2)]
public string Description;
[InspectableText, JsonProperty("manufacturer"), Key(3)]
public string Manufacturer;
[InspectableField, JsonProperty("mass"), Key(3)]
[InspectableField, JsonProperty("mass"), Key(4)]
public float Mass;
[InspectableField, JsonProperty("shape"), Key(4)]
[InspectableField, JsonProperty("shape"), Key(5)]
public Shape Shape;
// Heat needed to change temperature of 1 gram by 1 degree
[InspectableField, JsonProperty("specificHeat"), Key(5)]
[InspectableField, JsonProperty("specificHeat"), Key(6)]
public float SpecificHeat = 1;
[InspectableField, JsonProperty("conductivity"), Key(6)]
[InspectableField, JsonProperty("conductivity"), Key(7)]
public float Conductivity = 1;
[InspectableField, JsonProperty("price"), Key(8)]
public int Price = 0;
[IgnoreMember] public string EntryName
{
get => Name;
@ -233,10 +239,10 @@ public class SimpleCommodityData : ItemData
// [InspectableField, JsonProperty("floor"), Key(11)]
// public float Floor = 5f;
[InspectableField, JsonProperty("maxStackSize"), Key(7)]
[InspectableField, JsonProperty("maxStackSize"), Key(9)]
public int MaxStack = 10;
[InspectableField, JsonProperty("category"), Key(8)]
[InspectableField, JsonProperty("category"), Key(10)]
public SimpleCommodityCategory Category;
}
@ -248,17 +254,17 @@ public class SimpleCommodityData : ItemData
JsonConverter(typeof(JsonKnownTypesConverter<CraftedItemData>))]
public abstract class CraftedItemData : ItemData
{
[InspectableField, JsonProperty("ingredientQualityWeight"), Key(7)]
[InspectableField, JsonProperty("ingredientQualityWeight"), Key(9)]
public float IngredientQualityWeight = .5f;
}
[RethinkTable("Items"), Inspectable, MessagePackObject]
public class CompoundCommodityData : CraftedItemData
{
[InspectableDatabaseLink(typeof(PersonalityAttribute)), JsonProperty("demandProfile"), Key(8)]
[InspectableDatabaseLink(typeof(PersonalityAttribute)), JsonProperty("demandProfile"), Key(10)]
public Dictionary<Guid, float> DemandProfile = new Dictionary<Guid, float>();
[InspectableField, JsonProperty("category"), Key(9)]
[InspectableField, JsonProperty("category"), Key(11)]
public CompoundCommodityCategory Category;
}
@ -267,22 +273,22 @@ public class CompoundCommodityData : CraftedItemData
JsonObject(MemberSerialization.OptIn), JsonConverter(typeof(JsonKnownTypesConverter<EquippableItemData>))]
public abstract class EquippableItemData : CraftedItemData
{
[InspectableTexture, JsonProperty("schematic"), Key(8)]
[InspectableTexture, JsonProperty("schematic"), Key(10)]
public string Schematic;
[InspectableField, JsonProperty("behaviors"), Key(9)]
[InspectableField, JsonProperty("behaviors"), Key(11)]
public List<BehaviorData> Behaviors = new List<BehaviorData>();
[InspectableField, JsonProperty("durability"), Key(10)]
[InspectableField, JsonProperty("durability"), Key(12)]
public float Durability;
[TemperatureInspectable, JsonProperty("minTemp"), Key(11)]
[TemperatureInspectable, JsonProperty("minTemp"), Key(13)]
public float MinimumTemperature;
[TemperatureInspectable, JsonProperty("maxTemp"), Key(12)]
[TemperatureInspectable, JsonProperty("maxTemp"), Key(14)]
public float MaximumTemperature;
[InspectableField, JsonProperty("durabilityExponent"), Key(13), SimplePerformanceStat]
[InspectableField, JsonProperty("durabilityExponent"), Key(15), SimplePerformanceStat]
public PerformanceStat DurabilityExponent = new PerformanceStat();
[IgnoreMember]
@ -296,7 +302,7 @@ public abstract class EquippableItemData : CraftedItemData
[RethinkTable("Items"), Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
public class GearData : EquippableItemData
{
[InspectableField, JsonProperty("hardpointType"), Key(14)]
[InspectableField, JsonProperty("hardpointType"), Key(16)]
public HardpointType Hardpoint;
[IgnoreMember] public override HardpointType HardpointType => Hardpoint;
@ -305,7 +311,7 @@ public class GearData : EquippableItemData
[RethinkTable("Items"), Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
public class CargoBayData : EquippableItemData
{
[InspectableField, JsonProperty("interiorShape"), Key(14)]
[InspectableField, JsonProperty("interiorShape"), Key(16)]
public Shape InteriorShape;
[IgnoreMember] public override HardpointType HardpointType => HardpointType.Tool;
}
@ -313,7 +319,7 @@ public class CargoBayData : EquippableItemData
[RethinkTable("Items"), Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
public class DockingBayData : CargoBayData
{
[InspectableField, JsonProperty("maxSize"), Key(15)]
[InspectableField, JsonProperty("maxSize"), Key(17)]
public int2 MaxSize;
[IgnoreMember] public override HardpointType HardpointType => HardpointType.Tool;
}
@ -321,19 +327,19 @@ public class DockingBayData : CargoBayData
[RethinkTable("Items"), Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
public class HullData : EquippableItemData
{
[InspectableField, JsonProperty("hardpoints"), Key(14)]
[InspectableField, JsonProperty("hardpoints"), Key(16)]
public List<HardpointData> Hardpoints = new List<HardpointData>();
[InspectablePrefab, JsonProperty("prefab"), Key(15)]
[InspectablePrefab, JsonProperty("prefab"), Key(17)]
public string Prefab;
[InspectableField, JsonProperty("hullType"), Key(16)]
[InspectableField, JsonProperty("hullType"), Key(18)]
public HullType HullType;
[InspectableField, JsonProperty("gridOffset"), Key(17)]
[InspectableField, JsonProperty("gridOffset"), Key(19)]
public float GridOffset;
[InspectableField, JsonProperty("armor"), Key(18)]
[InspectableField, JsonProperty("armor"), Key(20)]
public float Armor;
[IgnoreMember]

View file

@ -213,10 +213,15 @@ public class ItemManager
return ItemQuality[item];
}
private readonly Dictionary<(PerformanceStat stat, EquippableItem item), float> StatQuality = new Dictionary<(PerformanceStat stat, EquippableItem item), float>();
// Determine quality of either the item itself or the specific ingredient this stat depends on
public float Quality(PerformanceStat stat, EquippableItem item)
{
if (StatQuality.ContainsKey((stat, item)))
return StatQuality[(stat, item)];
var itemData = GetData(item);
var blueprint = ItemData.Get<BlueprintData>(item.Blueprint);
var activeEffects = blueprint.StatEffects.Where(x => GetAffectedStat(blueprint, x) == stat).ToArray();
@ -244,6 +249,7 @@ public class ItemManager
quality = sum / ingredients.Length;
}
StatQuality[(stat, item)] = quality;
return quality;
}
@ -268,11 +274,13 @@ public class ItemManager
//var heat = !stat.HeatDependent ? 1 : pow(itemData.Performance(entity.Temperature), Evaluate(itemData.HeatExponent,item));
var durability = !stat.DurabilityDependent ? 1 : pow(item.Durability / itemData.Durability, Evaluate(itemData.DurabilityExponent,item));
var quality = pow(Quality(stat, item), stat.QualityExponent);
var scaleModifier = stat.GetScaleModifiers(entity).Values.Aggregate(1.0f, (current, mod) => current * mod);
var constantModifier = stat.GetConstantModifiers(entity).Values.Sum();
var scaleModifier = 1.0f;
foreach (var value in stat.GetScaleModifiers(entity).Values) scaleModifier = scaleModifier * value;
float constantModifier = 0;
foreach (var value in stat.GetConstantModifiers(entity).Values) constantModifier += value;
var result = lerp(stat.Min, stat.Max, durability * quality) * scaleModifier + constantModifier;
if (float.IsNaN(result))
return stat.Min;

View file

@ -23,6 +23,8 @@ public class TradeMenu : MonoBehaviour
private EquippedCargoBay _targetCargo;
private (ItemFilter filter, HardpointType type) _hardpointFilter;
private (ItemFilter filter, SimpleCommodityCategory type) _commodityFilter;
private (ItemFilter filter, CompoundCommodityCategory type) _compoundCommodityFilter;
private List<(ItemFilter filter, Type type)> _behaviorFilters = new List<(ItemFilter filter, Type type)>();
private void OnEnable()
@ -40,7 +42,16 @@ public class TradeMenu : MonoBehaviour
IEnumerable<HardpointType> hardpointTypes = (HardpointType[]) Enum.GetValues(typeof(HardpointType));
if (_hardpointFilter.filter != null)
hardpointTypes = hardpointTypes.Where(x => x != _hardpointFilter.type);
ContextMenu.AddDropdown("Item Type", hardpointTypes
IEnumerable<SimpleCommodityCategory> commodityTypes = (SimpleCommodityCategory[]) Enum.GetValues(typeof(SimpleCommodityCategory));
if (_commodityFilter.filter != null)
commodityTypes = commodityTypes.Where(x => x != _commodityFilter.type);
IEnumerable<CompoundCommodityCategory> compoundCommodityTypes = (CompoundCommodityCategory[]) Enum.GetValues(typeof(CompoundCommodityCategory));
if (_compoundCommodityFilter.filter != null)
compoundCommodityTypes = compoundCommodityTypes.Where(x => x != _compoundCommodityFilter.type);
ContextMenu.AddDropdown("Gear Type", hardpointTypes
.Select<HardpointType, (string, Action, bool)>(x => (Enum.GetName(typeof(HardpointType), x), () =>
{
if (_hardpointFilter.filter == null)
@ -52,11 +63,75 @@ public class TradeMenu : MonoBehaviour
Populate();
};
}
if(_commodityFilter.filter != null)
{
_commodityFilter.filter.GetComponent<Prototype>().ReturnToPool();
_commodityFilter.filter = null;
}
if(_compoundCommodityFilter.filter != null)
{
_compoundCommodityFilter.filter.GetComponent<Prototype>().ReturnToPool();
_compoundCommodityFilter.filter = null;
}
_hardpointFilter.filter.Label.text = $"Hardpoint: {Enum.GetName(typeof(HardpointType), x)}";
_hardpointFilter.type = x;
Populate();
}, true)));
ContextMenu.AddDropdown("Simple Commodity", commodityTypes
.Select<SimpleCommodityCategory, (string, Action, bool)>(x => (Enum.GetName(typeof(SimpleCommodityCategory), x), () =>
{
if (_commodityFilter.filter == null)
{
_commodityFilter.filter = FilterPrototype.Instantiate<ItemFilter>();
_commodityFilter.filter.OnDisable += () =>
{
_commodityFilter.filter = null;
Populate();
};
}
if(_hardpointFilter.filter != null)
{
_hardpointFilter.filter.GetComponent<Prototype>().ReturnToPool();
_hardpointFilter.filter = null;
}
if(_compoundCommodityFilter.filter != null)
{
_compoundCommodityFilter.filter.GetComponent<Prototype>().ReturnToPool();
_compoundCommodityFilter.filter = null;
}
_commodityFilter.filter.Label.text = $"Hardpoint: {Enum.GetName(typeof(SimpleCommodityCategory), x)}";
_commodityFilter.type = x;
Populate();
}, true)));
ContextMenu.AddDropdown("Compound Commodity", compoundCommodityTypes
.Select<CompoundCommodityCategory, (string, Action, bool)>(x => (Enum.GetName(typeof(CompoundCommodityCategory), x), () =>
{
if (_compoundCommodityFilter.filter == null)
{
_compoundCommodityFilter.filter = FilterPrototype.Instantiate<ItemFilter>();
_compoundCommodityFilter.filter.OnDisable += () =>
{
_compoundCommodityFilter.filter = null;
Populate();
};
}
if(_hardpointFilter.filter != null)
{
_hardpointFilter.filter.GetComponent<Prototype>().ReturnToPool();
_hardpointFilter.filter = null;
}
if(_commodityFilter.filter != null)
{
_commodityFilter.filter.GetComponent<Prototype>().ReturnToPool();
_commodityFilter.filter = null;
}
_compoundCommodityFilter.filter.Label.text = $"Hardpoint: {Enum.GetName(typeof(CompoundCommodityCategory), x)}";
_compoundCommodityFilter.type = x;
Populate();
}, true)));
ContextMenu.AddDropdown("Item Behavior", typeof(BehaviorData).GetAllChildClasses()
.Where(x=> x.GetCustomAttribute<RuntimeInspectable>() != null && _behaviorFilters.All(f => f.type != x))
.Select<Type, (string, Action, bool)>(x=> (x.Name.FormatTypeName(), () =>
@ -94,23 +169,46 @@ public class TradeMenu : MonoBehaviour
void Populate()
{
var columns = new List<(string name, int size, Func<EquippableItemData, Func<string>> output, Func<EquippableItemData, IComparable> sortKey)>();
var columns = new List<(string name, int size, Func<ItemData, Func<string>> output, Func<ItemData, IComparable> sortKey)>();
columns.Add(("Name", 3,
data => () => data.Name,
data => data.Name));
if(_hardpointFilter.filter==null)
columns.Add(("Type", 2,
data => () => Enum.GetName(typeof(HardpointType), data.HardpointType),
data => data.HardpointType));
data => () =>
{
if (data is SimpleCommodityData s)
return Enum.GetName(typeof(SimpleCommodityCategory), s.Category);
if(data is CompoundCommodityData c)
return Enum.GetName(typeof(CompoundCommodityCategory), c.Category);
if(data is EquippableItemData e)
return Enum.GetName(typeof(HardpointType), e.HardpointType);
return "None";
},
data =>
{
if (data is SimpleCommodityData s)
return (int) s.Category;
var offset = Enum.GetValues(typeof(SimpleCommodityCategory)).Length;
if(data is CompoundCommodityData c)
return (int) c.Category + offset;
offset += Enum.GetValues(typeof(CompoundCommodityCategory)).Length;
if(data is EquippableItemData e)
return (int) e.HardpointType + offset;
return 0;
}));
columns.Add(("Mass", 1,
data => () => data.Mass.SignificantDigits(3),
data => data.Mass));
columns.Add(("Price", 1,
data => () => data.Price.ToString(),
data => data.Price));
columns.Add(("Size", 1,
data => () => $"{data.Shape.Width}x{data.Shape.Height}",
data => data.Shape.Width*data.Shape.Height));
var items = GameManager.ItemManager.ItemData.GetAll<EquippableItemData>();
var items = GameManager.ItemManager.ItemData.GetAll<ItemData>().Where(i=>i.Price!=0);
if (MinimumSizeFilter.gameObject.activeSelf)
items = items.Where(i =>
@ -122,12 +220,18 @@ public class TradeMenu : MonoBehaviour
!(MaximumSizeFilter.Width.text.Length > 0 && i.Shape.Width > int.Parse(MaximumSizeFilter.Width.text) ||
MaximumSizeFilter.Height.text.Length > 0 && i.Shape.Height > int.Parse(MaximumSizeFilter.Height.text)));
if(_commodityFilter.filter != null)
items = items.Where(i => i is SimpleCommodityData s && s.Category == _commodityFilter.type);
if(_compoundCommodityFilter.filter != null)
items = items.Where(i => i is CompoundCommodityData c && c.Category == _compoundCommodityFilter.type);
if (_hardpointFilter.filter != null)
items = items.Where(i => i.HardpointType == _hardpointFilter.type);
items = items.Where(i => i is EquippableItemData e && e.HardpointType == _hardpointFilter.type);
foreach (var (_, type) in _behaviorFilters)
{
items = items.Where(i => i.Behaviors.Any(b => type.IsInstanceOfType(b)));
items = items.Where(i => i is EquippableItemData e && e.Behaviors.Any(b => type.IsInstanceOfType(b)));
foreach (var field in type.GetFields().Where(f => f.GetCustomAttribute<RuntimeInspectable>() != null))
{
@ -135,32 +239,32 @@ public class TradeMenu : MonoBehaviour
if (fieldType == typeof(float))
columns.Add((field.Name, 1, data =>
{
var behavior = data.Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b));
var behavior = ((EquippableItemData) data).Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b));
return () => ((float) field.GetValue(behavior)).SignificantDigits(3);
}, data =>
{
var behavior = data.Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b));
var behavior = ((EquippableItemData) data).Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b));
return (float) field.GetValue(behavior);
}));
else if (fieldType == typeof(int))
columns.Add((field.Name, 1, data =>
{
var behavior = data.Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b));
var behavior = ((EquippableItemData) data).Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b));
return () => ((int) field.GetValue(behavior)).ToString();
}, data =>
{
var behavior = data.Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b));
var behavior = ((EquippableItemData) data).Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b));
return (int) field.GetValue(behavior);
}));
else if (fieldType == typeof(PerformanceStat))
{
columns.Add((field.Name, 1, data =>
{
var behavior = data.Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b));
var behavior = ((EquippableItemData) data).Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b));
return () => ((PerformanceStat) field.GetValue(behavior)).Max.SignificantDigits(3);
}, data =>
{
var behavior = data.Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b));
var behavior = ((EquippableItemData) data).Behaviors.FirstOrDefault(b => type.IsInstanceOfType(b));
return ((PerformanceStat) field.GetValue(behavior)).Max;
}));
}
@ -168,8 +272,22 @@ public class TradeMenu : MonoBehaviour
}
columns.Add(("Owned", 1,
data => () => (_targetCargo.ItemsOfType.ContainsKey(data.ID) ? _targetCargo.ItemsOfType[data.ID].Count : 0).ToString(),
data => _targetCargo.ItemsOfType.ContainsKey(data.ID) ? _targetCargo.ItemsOfType[data.ID].Count : 0));
data => () =>
{
if (data is HullData)
return GameManager.PlayerShips.Count(s => s.Hull.Data == data.ID && s.Parent == GameManager.CurrentShip.Parent).ToString();
if(data is SimpleCommodityData)
return (_targetCargo.ItemsOfType.ContainsKey(data.ID) ? _targetCargo.ItemsOfType[data.ID].Cast<SimpleCommodity>().Sum(s=>s.Quantity) : 0).ToString();
return (_targetCargo.ItemsOfType.ContainsKey(data.ID) ? _targetCargo.ItemsOfType[data.ID].Count : 0).ToString();
},
data =>
{
if (data is HullData)
return GameManager.PlayerShips.Count(s => s.Hull.Data == data.ID && s.Parent == GameManager.CurrentShip.Parent);
if(data is SimpleCommodityData)
return _targetCargo.ItemsOfType.ContainsKey(data.ID) ? _targetCargo.ItemsOfType[data.ID].Cast<SimpleCommodity>().Sum(s=>s.Quantity) : 0;
return _targetCargo.ItemsOfType.ContainsKey(data.ID) ? _targetCargo.ItemsOfType[data.ID].Count : 0;
}));
Spreadsheet.ShowData(
columns.Select(x => x.name).ToArray(),
@ -188,7 +306,16 @@ public class TradeMenu : MonoBehaviour
},
OnDoubleClick = () =>
{
_targetCargo.TryStore(GameManager.ItemManager.CreateInstance(i, .1f, 1));
if (i is HullData h)
{
var ship = new Ship(GameManager.ItemManager, GameManager.Zone, GameManager.ItemManager.CreateInstance(h, .1f, 1) as EquippableItem);
ship.SetParent(GameManager.CurrentShip.Parent);
GameManager.PlayerShips.Add(ship);
}
else if(i is CraftedItemData c)
_targetCargo.TryStore(GameManager.ItemManager.CreateInstance(c, .1f, 1));
else if(i is SimpleCommodityData s)
_targetCargo.TryStore(GameManager.ItemManager.CreateInstance(s, 1));
Populate();
}
}));

View file

@ -25,9 +25,13 @@ public class InventoryPanel : MonoBehaviour
public ContextMenu ContextMenu;
public TextMeshProUGUI Title;
public Button Dropdown;
public Button Current;
public Button Thermal;
public GridLayoutGroup Grid;
public Sprite[] NodeBackgroundTextures;
public Sprite[] NodeTextures;
public Sprite[] ThermalTextures;
public float ThermalToggleRegionSize = .2f;
public Prototype NodePrototype;
public RawImage TemperatureDisplay;
public Texture2D TemperatureColor;
@ -36,6 +40,8 @@ public class InventoryPanel : MonoBehaviour
public float MaxTemperature;
public bool FitToContent;
public float CellHitPulseTime;
public Color ToggleEnabledColor;
public Color ToggleDisabledColor;
public Color CellBackgroundColor = new Color(0, 0, 0, .75f);
Subject<InventoryEventData> _onBeginDrag;
@ -60,6 +66,7 @@ public class InventoryPanel : MonoBehaviour
private List<IDisposable> _subscriptions = new List<IDisposable>();
private Dictionary<int2, int> _cellAnimationSequence = new Dictionary<int2, int>();
private int _hitSequence = 0;
private bool _thermal = false;
private bool _hud;
@ -76,6 +83,26 @@ public class InventoryPanel : MonoBehaviour
private void Start()
{
if (Thermal)
{
Thermal.onClick.AddListener(() =>
{
Display(_displayedEntity, false, !_thermal);
});
}
if (Current)
{
Current.onClick.AddListener(() =>
{
if (_displayedEntity != GameManager.CurrentShip)
{
GameManager.CurrentShip = (Ship) _displayedEntity;
GameManager.DockingBay.DockedShip = (Ship) _displayedEntity;
Current.targetGraphic.color = ToggleEnabledColor;
}
});
}
if(Dropdown)
{
Dropdown.onClick.AddListener(() =>
@ -85,16 +112,17 @@ public class InventoryPanel : MonoBehaviour
{
if (ship.CargoBays.Any())
{
ContextMenu.AddDropdown(ship.Name,
ship.CargoBays
.Select<EquippedCargoBay, (string text, Action action, bool enabled)>((bay, index) =>
($"Bay {index}", () => Display(bay), true))
.Prepend(("Equipment", () => Display(ship), true)));
var options = ship.CargoBays
.Where(bay => bay != _displayedCargo)
.Select<EquippedCargoBay, (string text, Action action, bool enabled)>((bay, index) =>
($"Bay {index}", () => Display(bay), true));
if(ship != _displayedEntity) options = options.Prepend(("Equipment", () => Display(ship), true));
ContextMenu.AddDropdown(ship.Name, options);
}
else ContextMenu.AddOption(ship.Name, () => Display(ship));
else if(ship != _displayedEntity) ContextMenu.AddOption(ship.Name, () => Display(ship));
}
if(GameManager.DockingBay!=null)
if(GameManager.DockingBay!=null && _displayedCargo!=GameManager.DockingBay)
ContextMenu.AddOption(GameManager.DockingBay.Name, () => Display(GameManager.DockingBay));
ContextMenu.Show();
@ -131,6 +159,7 @@ public class InventoryPanel : MonoBehaviour
{
Clear();
}
public void Clear()
{
@ -150,28 +179,34 @@ public class InventoryPanel : MonoBehaviour
_subscriptions.Clear();
TemperatureDisplay.gameObject.SetActive(false);
if(Title)
Title.text = "None";
}
public void Display(Entity entity, bool hud = false)
public void Display(Entity entity, bool hud = false, bool thermal = false)
{
Clear();
_thermal = thermal;
_hud = hud;
_displayedEntity = entity;
_displayedCargo = null;
_firstRect = null;
if(Title)
Title.text = entity.Name;
var hullData = GameManager.ItemManager.GetData(entity.Hull) as HullData;
if (FitToContent)
{
var gridRect = Grid.GetComponent<RectTransform>();
var rect = gridRect.rect;
Grid.cellSize = Vector2.one * (int) min(rect.width / (hullData.Shape.Width + 1), rect.height / (hullData.Shape.Height + 1));
}
_temperatureTexture = new Texture2D(
hullData.Shape.Width+2,
hullData.Shape.Height+2,
@ -181,9 +216,18 @@ public class InventoryPanel : MonoBehaviour
TemperatureDisplay.texture = _temperatureTexture;
var tempRect = TemperatureDisplay.rectTransform;
tempRect.sizeDelta = Grid.cellSize * new Vector2(hullData.Shape.Width + 2, hullData.Shape.Height + 2);
//tempRect.anchoredPosition =
//FakeOccupancy = new Shape(hullData.Shape.Width, hullData.Shape.Height);
//IgnoreOccupancy = new Shape(hullData.Shape.Width, hullData.Shape.Height);
if (Current)
{
Current.gameObject.SetActive(true);
Current.targetGraphic.color = entity == GameManager.CurrentShip ? ToggleEnabledColor : ToggleDisabledColor;
}
if (Thermal)
{
Thermal.gameObject.SetActive(true);
Thermal.targetGraphic.color = thermal ? ToggleEnabledColor : ToggleDisabledColor;
}
Grid.constraintCount = hullData.Shape.Width;
foreach (var v in hullData.Shape.AllCoordinates)
{
@ -201,18 +245,50 @@ public class InventoryPanel : MonoBehaviour
cell.Background.color = CellBackgroundColor;
if (!_firstRect)
_firstRect = cell.GetComponent<RectTransform>();
cell.PointerClickTrigger.OnPointerClickAsObservable()
.Subscribe(data => _onClick?.OnNext(new InventoryEntityEventData(data, v, entity)));
cell.BeginDragTrigger.OnBeginDragAsObservable()
.Subscribe(data => _onBeginDrag?.OnNext(new InventoryEntityEventData(data, v, entity)));
cell.DragTrigger.OnDragAsObservable()
.Subscribe(data => _onDrag?.OnNext(new InventoryEntityEventData(data, v, entity)));
cell.EndDragTrigger.OnEndDragAsObservable()
.Subscribe(data => _onEndDrag?.OnNext(new InventoryEntityEventData(data, v, entity)));
cell.PointerEnterTrigger.OnPointerEnterAsObservable()
.Subscribe(data => _onPointerEnter?.OnNext(new InventoryEntityEventData(data, v, entity)));
cell.PointerExitTrigger.OnPointerExitAsObservable()
.Subscribe(data => _onPointerExit?.OnNext(new InventoryEntityEventData(data, v, entity)));
if (!thermal)
{
cell.PointerClickTrigger.OnPointerClickAsObservable()
.Subscribe(data => _onClick?.OnNext(new InventoryEntityEventData(data, v, entity)));
cell.BeginDragTrigger.OnBeginDragAsObservable()
.Subscribe(data => _onBeginDrag?.OnNext(new InventoryEntityEventData(data, v, entity)));
cell.DragTrigger.OnDragAsObservable()
.Subscribe(data => _onDrag?.OnNext(new InventoryEntityEventData(data, v, entity)));
cell.EndDragTrigger.OnEndDragAsObservable()
.Subscribe(data => _onEndDrag?.OnNext(new InventoryEntityEventData(data, v, entity)));
cell.PointerEnterTrigger.OnPointerEnterAsObservable()
.Subscribe(data => _onPointerEnter?.OnNext(new InventoryEntityEventData(data, v, entity)));
cell.PointerExitTrigger.OnPointerExitAsObservable()
.Subscribe(data => _onPointerExit?.OnNext(new InventoryEntityEventData(data, v, entity)));
}
else
{
cell.PointerClickTrigger.OnPointerClickAsObservable().Subscribe(data =>
{
var rect = cell.GetComponent<RectTransform>();
var point = Rect.PointToNormalized(rect.rect, rect.InverseTransformPoint(data.position));
Debug.Log($"Clicked at pos {data.position}, normalized {point}");
if (hullData.Shape[int2(v.x - 1, v.y)] && point.x < ThermalToggleRegionSize)
{
entity.HullConductivity[v.x - 1, v.y].x = !entity.HullConductivity[v.x - 1, v.y].x;
RefreshCells(new []{v,int2(v.x - 1, v.y)});
}
if (hullData.Shape[int2(v.x + 1, v.y)] && point.x > 1 - ThermalToggleRegionSize)
{
entity.HullConductivity[v.x, v.y].x = !entity.HullConductivity[v.x, v.y].x;
RefreshCells(new []{v,int2(v.x + 1, v.y)});
}
if (hullData.Shape[int2(v.x, v.y - 1)] && point.y < ThermalToggleRegionSize)
{
entity.HullConductivity[v.x, v.y - 1].y = !entity.HullConductivity[v.x, v.y - 1].y;
RefreshCells(new []{v,int2(v.x, v.y - 1)});
}
if (hullData.Shape[int2(v.x, v.y + 1)] && point.y > 1 - ThermalToggleRegionSize)
{
entity.HullConductivity[v.x, v.y].y = !entity.HullConductivity[v.x, v.y].y;
RefreshCells(new []{v,int2(v.x, v.y + 1)});
}
});
}
CellInstances.Add(v, cell);
}
}
@ -255,7 +331,6 @@ public class InventoryPanel : MonoBehaviour
HitType.Armor => Settings.ArmorHitColor,
HitType.Hardpoint => Settings.HardpointHitColor,
HitType.Gear => Settings.GearHitColor,
HitType.Thermal => Settings.ThermalHitColor,
_ => Color.white
};
float startTime = Time.time;
@ -276,7 +351,13 @@ public class InventoryPanel : MonoBehaviour
Clear();
_displayedCargo = cargo;
_displayedEntity = null;
TemperatureDisplay.gameObject.SetActive(false);
if (Current)
Current.gameObject.SetActive(false);
if (Thermal)
Thermal.gameObject.SetActive(false);
if(Title)
Title.text = cargo.Name;
@ -372,9 +453,30 @@ public class InventoryPanel : MonoBehaviour
if (item != null)
spriteIndex += 1 << 8;
if (_thermal)
{
bool ThermalMatch(int2 offset)
{
if (!hullData.Shape[v + offset]) return false;
var i = (offset.x, offset.y);
return i switch
{
(1, 0) => _displayedEntity.HullConductivity[v.x, v.y].x,
(-1, 0) => _displayedEntity.HullConductivity[v.x-1, v.y].x,
(0, 1) => _displayedEntity.HullConductivity[v.x, v.y].y,
(0, -1) => _displayedEntity.HullConductivity[v.x, v.y-1].y,
_ => false
};
}
spriteIndex = 0;
for(int i = 0; i < 4; i++)
if (ThermalMatch(_offsets[i]))
spriteIndex += 1 << i;
}
CellInstances[v].Background.sprite = NodeBackgroundTextures[bgSpriteIndex];
CellInstances[v].Icon.sprite = NodeTextures[spriteIndex];
CellInstances[v].Icon.sprite = _thermal ? ThermalTextures[spriteIndex] : NodeTextures[spriteIndex];
CellInstances[v].Icon.color = GetColor(v);
}
}

View file

@ -90,6 +90,7 @@
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Net\Cursor.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Net\Crypto.cs" />
<Compile Include="Assets\Scripts\ServerShared\ExponentialCurve.cs" />
<Compile Include="Assets\Scripts\ServerShared\Noise1D.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\JsonKnownTypes\JsonDiscriminatorSettings.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Generated\Ast\Upcase.cs" />
<Compile Include="Assets\Scripts\ServerShared\JsonConverters.cs" />
@ -149,6 +150,7 @@
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Utils\CancellableTask.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver.Linq\WhereClauseParsers\BaseIndexParser.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Net\Clustering\EpsilonValueCalculator.cs" />
<Compile Include="Assets\Scripts\ServerShared\EntitySerializer.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Utils\StringHelper.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Net\JsonConverters\ReqlGroupingConverter.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Generated\Ast\January.cs" />
@ -313,6 +315,7 @@
<Compile Include="Assets\Scripts\ServerShared\Behaviors\StatModifier.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Generated\Ast\Friday.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Generated\Ast\Nth.cs" />
<Compile Include="Assets\Scripts\ServerShared\Behaviors\TargetLock.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Net\Clustering\IPoolingStrategy.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Generated\ReqlClientError.cs" />
<Compile Include="Assets\Scripts\ServerShared\Behaviors\EnergyDraw.cs" />
@ -516,9 +519,6 @@
<Compile Include="Assets\Scripts\ServerShared\NIH\LinqFaster\SequenceEqual.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\LinqFaster\Skip.cs" />
<Compile Include="Assets\Scripts\ServerShared\ItemManager.cs" />
<Compile Include="Assets\Scripts\ServerShared\Noise1D.cs" />
<Compile Include="Assets\Scripts\ServerShared\Behaviors\TargetLock.cs" />
<Compile Include="Assets\Scripts\ServerShared\EntitySerializer.cs" />
<None Include="Assets\Scripts\ServerShared\NIH\LinqFaster\readme.txt" />
<None Include="Assets\Scripts\ServerShared\Economy.Shared.Unity.asmdef" />
<Reference Include="Remotion.Linq">

View file

@ -378,9 +378,6 @@
<Reference Include="UnityEditor.WindowsStandalone.Extensions">
<HintPath>C:/Program Files/Unity/Hub/Editor/2020.2.1f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
</Reference>
<Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
<HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/16.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
</Reference>
<Reference Include="Remotion.Linq">
<HintPath>E:/Projects/Aetheria-Economy/Assets/Plugins/Remotion.Linq.dll</HintPath>
</Reference>

View file

@ -282,9 +282,6 @@
<Reference Include="UnityEditor.WindowsStandalone.Extensions">
<HintPath>C:/Program Files/Unity/Hub/Editor/2020.2.1f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
</Reference>
<Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
<HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/16.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
</Reference>
<Reference Include="Remotion.Linq">
<HintPath>E:/Projects/Aetheria-Economy/Assets/Plugins/Remotion.Linq.dll</HintPath>
</Reference>

View file

@ -282,9 +282,6 @@
<Reference Include="UnityEditor.WindowsStandalone.Extensions">
<HintPath>C:/Program Files/Unity/Hub/Editor/2020.2.1f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
</Reference>
<Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
<HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/16.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
</Reference>
<Reference Include="Remotion.Linq">
<HintPath>E:/Projects/Aetheria-Economy/Assets/Plugins/Remotion.Linq.dll</HintPath>
</Reference>

View file

@ -521,9 +521,6 @@
<Reference Include="UnityEditor.WindowsStandalone.Extensions">
<HintPath>C:/Program Files/Unity/Hub/Editor/2020.2.1f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
</Reference>
<Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
<HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/16.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
</Reference>
<Reference Include="Remotion.Linq">
<HintPath>E:/Projects/Aetheria-Economy/Assets/Plugins/Remotion.Linq.dll</HintPath>
</Reference>