finsihed tech tree and started working on new resource manager, working on per day resources

This commit is contained in:
SHOUTING_PIRATE
2025-07-08 17:16:46 +01:00
parent 1c91215efd
commit 9e18aebe37
326 changed files with 22422 additions and 546303 deletions

View File

@@ -59,6 +59,7 @@
<Compile Include="Assets\GUIPackCartoon\Demo\Scripts\BackgroundMusic.cs" />
<Compile Include="Assets\GUIPackCartoon\Demo\Scripts\AnimatedButton.cs" />
<Compile Include="Assets\Scripts\TechTreeUI.cs" />
<Compile Include="Assets\Scripts\TechTooltip.cs" />
<Compile Include="Assets\GUIPackCartoon\Demo\Scripts\PopupOpener.cs" />
<Compile Include="Assets\Scripts\Objectives.cs" />
<Compile Include="Assets\Scripts\StateMachine.cs" />
@@ -71,12 +72,13 @@
<Compile Include="Assets\Scripts\Technology.cs" />
<Compile Include="Assets\GUIPackCartoon\Demo\Scripts\ColorSwapper.cs" />
<Compile Include="Assets\Scripts\City.cs" />
<Compile Include="Assets\Scripts\BuildingButtonHandler.cs" />
<Compile Include="Assets\Scripts\CitizenAI.cs" />
<Compile Include="Assets\TutorialInfo\Scripts\Readme.cs" />
<Compile Include="Assets\Scripts\Resources.cs" />
<Compile Include="Assets\Scripts\BuildingPlacement.cs" />
<Compile Include="Assets\GUIPackCartoon\Demo\Scripts\SpinWheel.cs" />
<Compile Include="Assets\GUIPackCartoon\Demo\Scripts\Popup.cs" />
<Compile Include="Assets\Scripts\ResourceManager.cs" />
<Compile Include="Assets\GUIPackCartoon\Demo\Scripts\PlayPopupOpener.cs" />
<Compile Include="Assets\GUIPackCartoon\Demo\Scripts\SpriteSwapper.cs" />
<Compile Include="Assets\GUIPackCartoon\Demo\Scripts\Transition.cs" />
@@ -85,6 +87,7 @@
<Compile Include="Assets\Scripts\State.cs" />
<Compile Include="Assets\GUIPackCartoon\Demo\Scripts\TintedButton.cs" />
<Compile Include="Assets\GUIPackCartoon\Demo\Scripts\SceneTransition.cs" />
<Compile Include="Assets\Scripts\TechNodeConnector.cs" />
<Compile Include="Assets\GUIPackCartoon\Demo\Scripts\SoundButton.cs" />
<Compile Include="Assets\Scripts\CameraController.cs" />
</ItemGroup>

View File

@@ -17,5 +17,9 @@ MonoBehaviour:
prefab: {fileID: 3768851932668961422, guid: 5507900792395674cafb819aac22118b, type: 3}
population: 0
jobs: 20
food: 15
buildingType: 2
food: -15
water: 0
steel: 10
faith: 0
wood: 0
buildingType: 12

View File

@@ -12,10 +12,14 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 46edd56f52a49944ca46162bdabfb3bf, type: 3}
m_Name: Farm
m_EditorClassIdentifier:
cost: 50
cost: -50
costPerTurn: 25
prefab: {fileID: 5065278095059473762, guid: c59455903a67a0140a8ed521a67fd488, type: 3}
population: 0
jobs: 5
food: 50
water: -10
steel: 0
faith: 0
wood: 0
buildingType: 2

View File

@@ -12,9 +12,14 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 46edd56f52a49944ca46162bdabfb3bf, type: 3}
m_Name: House
m_EditorClassIdentifier:
cost: 10
cost: -10
costPerTurn: 5
prefab: {fileID: 2179184635254283085, guid: fe2011d4ae2eada46bfdc6ee507f4da6, type: 3}
population: 10
jobs: 0
food: 0
food: -2
water: -2
steel: 0
faith: 0
wood: 0
buildingType: 0

View File

@@ -1,207 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1487214480234748508
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3837636961552424559}
- component: {fileID: 6285457439644908028}
- component: {fileID: 8145424867600378410}
- component: {fileID: 4988862143195119597}
m_Layer: 5
m_Name: TechColumn
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3837636961552424559
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1487214480234748508}
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3910211149262650417}
m_Father: {fileID: 0}
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: -120}
m_SizeDelta: {x: 500, y: 700}
m_Pivot: {x: 0, y: 1}
--- !u!222 &6285457439644908028
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1487214480234748508}
m_CullTransparentMesh: 1
--- !u!114 &8145424867600378410
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1487214480234748508}
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!114 &4988862143195119597
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1487214480234748508}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 10
m_Right: 10
m_Top: 10
m_Bottom: 10
m_ChildAlignment: 4
m_Spacing: 5
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 1
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!1001 &4351025445333317191
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 3837636961552424559}
m_Modifications:
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_SizeDelta.y
value: 246.4144
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2088154411022447791, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
propertyPath: m_Name
value: TechNode
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
--- !u!224 &3910211149262650417 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 730197510166235766, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
m_PrefabInstance: {fileID: 4351025445333317191}
m_PrefabAsset: {fileID: 0}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9df20ce86549e5c4ca3ec417064a2751
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,90 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3318892414756945549
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7141594400996335196}
- component: {fileID: 5696791842458614149}
- component: {fileID: 8276450360505042745}
- component: {fileID: 2264866156801349296}
m_Layer: 5
m_Name: Connector
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7141594400996335196
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3318892414756945549}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5696791842458614149
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3318892414756945549}
m_CullTransparentMesh: 1
--- !u!114 &8276450360505042745
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3318892414756945549}
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: 1}
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!114 &2264866156801349296
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3318892414756945549}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7554ecf4667c65b4ba007999cd76c9e7, type: 3}
m_Name:
m_EditorClassIdentifier:

View File

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

View File

@@ -0,0 +1,47 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3604054948624179634
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 92034311220277696}
- component: {fileID: 8691643166379893752}
m_Layer: 0
m_Name: Database 1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &92034311220277696
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3604054948624179634}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1027.3999, y: 613.55054, z: 5.9871492}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8691643166379893752
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3604054948624179634}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: daa8c3514f37f2440ab4c2303c0af990, type: 3}
m_Name:
m_EditorClassIdentifier:
techGroups: []

View File

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

View File

@@ -0,0 +1,47 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8651328025806423875
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8746696933736187003}
- component: {fileID: 7519374622778807798}
m_Layer: 0
m_Name: Resources 1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8746696933736187003
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8651328025806423875}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1027.3999, y: 613.55054, z: 5.9871492}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7519374622778807798
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8651328025806423875}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cdd6435cece787f40832679e1be6c6c2, type: 3}
m_Name:
m_EditorClassIdentifier:
resourceAmounts: []

View File

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

View File

@@ -0,0 +1,104 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1487214480234748508
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3837636961552424559}
- component: {fileID: 6285457439644908028}
- component: {fileID: 8145424867600378410}
- component: {fileID: 4988862143195119597}
m_Layer: 5
m_Name: TechColumn
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3837636961552424559
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1487214480234748508}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
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: -120}
m_SizeDelta: {x: 500, y: 700}
m_Pivot: {x: 0, y: 1}
--- !u!222 &6285457439644908028
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1487214480234748508}
m_CullTransparentMesh: 1
--- !u!114 &8145424867600378410
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1487214480234748508}
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!114 &4988862143195119597
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1487214480234748508}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 10
m_Right: 10
m_Top: 10
m_Bottom: 10
m_ChildAlignment: 4
m_Spacing: 5
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0

View File

@@ -13,6 +13,7 @@ GameObject:
- component: {fileID: 5196581417222935243}
- component: {fileID: 4581525535379480756}
- component: {fileID: 2259804339062908791}
- component: {fileID: 5661334640627325968}
m_Layer: 5
m_Name: TechNode
m_TagString: Untagged
@@ -34,12 +35,13 @@ RectTransform:
m_Children:
- {fileID: 2487585073407233440}
- {fileID: 8816033586092371476}
- {fileID: 7599977180321496189}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -80.32129}
m_SizeDelta: {x: 200, y: 239.3574}
m_AnchoredPosition: {x: -51.8073, y: -39.3575}
m_SizeDelta: {x: 303.6144, y: 321.285}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &111805378875009012
CanvasRenderer:
@@ -62,14 +64,14 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.9339623, g: 0.20705767, b: 0.20705767, a: 1}
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_Sprite: {fileID: 0}
m_Sprite: {fileID: 21300000, guid: b3993b50fd4d84d8ab7678819adcb083, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
@@ -92,16 +94,26 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
techImage: {fileID: 6901669090262731949}
techStatusImage: {fileID: 2149737177119617409}
techStatusLocked: {fileID: 21300000, guid: 2950c7a2bb5da41e08efde7e1e71e171, type: 3}
techStatusUnlocked: {fileID: 21300000, guid: 5a2b3b3f71a38431c8a130fca86375c8, type: 3}
techStatusResearching: {fileID: 21300000, guid: a9ad0ecb8bc3c4c0bbc2d32743b33323, type: 3}
techStatusCompleted: {fileID: 21300000, guid: 20a3d357f43e64b1a9a855f7a1aaf450, type: 3}
techTitleText: {fileID: 3237412204784009464}
technology:
availabilityState: 0
techName:
availabilityState: 0
techDescription:
techImage: {fileID: 0}
resourceCosts: []
techRequirements: []
techModifiers: []
researchedTurns: 0
requiredResearchTurns: 0
techUIColor: {r: 0, g: 0, b: 0, a: 0}
nodeImage: {fileID: 5196581417222935243}
connector: {fileID: 2264866156801349296, guid: a4d9e7eac1e199046ba5289a50d98541, type: 3}
outline: {fileID: 5661334640627325968}
--- !u!114 &2259804339062908791
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -146,6 +158,21 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!114 &5661334640627325968
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2088154411022447791}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5}
m_EffectDistance: {x: 3, y: -3}
m_UseGraphicAlpha: 1
--- !u!1 &4840859237133704514
GameObject:
m_ObjectHideFlags: 0
@@ -180,8 +207,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -0.1968, y: -10}
m_SizeDelta: {x: 191.6064, y: 200}
m_AnchoredPosition: {x: 3.4176, y: -25.2611}
m_SizeDelta: {x: 153.8553, y: 156.6265}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8926780816716359208
CanvasRenderer:
@@ -221,6 +248,81 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &7394882777843033759
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7599977180321496189}
- component: {fileID: 4580376650395878712}
- component: {fileID: 2149737177119617409}
m_Layer: 5
m_Name: Status
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7599977180321496189
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7394882777843033759}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 730197510166235766}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 105}
m_SizeDelta: {x: 25, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4580376650395878712
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7394882777843033759}
m_CullTransparentMesh: 1
--- !u!114 &2149737177119617409
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7394882777843033759}
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: 1}
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!1 &8913311585746182097
GameObject:
m_ObjectHideFlags: 0
@@ -255,7 +357,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: -82}
m_SizeDelta: {x: 200, y: 32.7355}
m_Pivot: {x: 0.5, y: 1}
--- !u!222 &4226033253707352712

View File

@@ -0,0 +1,232 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7883127148892776870
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7293486280552375151}
- component: {fileID: 8127182725389155015}
m_Layer: 5
m_Name: TechWindow
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7293486280552375151
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7883127148892776870}
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4805051134259484173}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &8127182725389155015
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7883127148892776870}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cc4df5657f24f9048a6cee68df18a5b8, type: 3}
m_Name:
m_EditorClassIdentifier:
panelToToggle: {fileID: 2079823740487284103}
keyToToggle: 102
--- !u!1001 &2558842276409971396
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 7293486280552375151}
m_Modifications:
- target: {fileID: 2073363510331156147, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 8127182725389155015}
- target: {fileID: 2189113196669917196, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2189113196669917196, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4428374358683115746, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: techNode
value:
objectReference: {fileID: 4581525535379480756, guid: 43ef4c4a0a86f0b4b8f5bde185d01629, type: 3}
- target: {fileID: 4428374358683115746, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: techPanel
value:
objectReference: {fileID: 8551058652432766805}
- target: {fileID: 4566599247427807043, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_Name
value: TechPanel
objectReference: {fileID: 0}
- target: {fileID: 4566599247427807043, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6136616251983791505, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6136616251983791505, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_SizeDelta.y
value: 792.5464
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_SizeDelta.x
value: 1820
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_SizeDelta.y
value: 780
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects:
- {fileID: 9087752481356244856, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 3534996694625853993, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
insertIndex: -1
addedObject: {fileID: 6381517572470915426}
m_SourcePrefab: {fileID: 100100000, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
--- !u!1 &1336445102845964525 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 3534996694625853993, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
m_PrefabInstance: {fileID: 2558842276409971396}
m_PrefabAsset: {fileID: 0}
--- !u!114 &6381517572470915426
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1336445102845964525}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 30
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!1 &2079823740487284103 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4566599247427807043, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
m_PrefabInstance: {fileID: 2558842276409971396}
m_PrefabAsset: {fileID: 0}
--- !u!224 &4805051134259484173 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 7002022039547856073, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
m_PrefabInstance: {fileID: 2558842276409971396}
m_PrefabAsset: {fileID: 0}
--- !u!224 &8551058652432766805 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 6136616251983791505, guid: caba7991f4cf5fc479d2fcd29e973157, type: 3}
m_PrefabInstance: {fileID: 2558842276409971396}
m_PrefabAsset: {fileID: 0}

View File

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

View File

@@ -0,0 +1,546 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1540740621080542100
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6895960645071645738}
- component: {fileID: 112619304547174548}
- component: {fileID: 8064122245696361823}
m_Layer: 5
m_Name: Description
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6895960645071645738
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1540740621080542100}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5252969080537395222}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 390, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!222 &112619304547174548
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1540740621080542100}
m_CullTransparentMesh: 1
--- !u!114 &8064122245696361823
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1540740621080542100}
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: New Text
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, 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: 18
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 12
m_fontSizeMax: 18
m_fontStyle: 1
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 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: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 5, y: 5, z: 5, w: 5}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &4903981023514464309
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5252969080537395222}
- component: {fileID: 3077465998240621022}
- component: {fileID: 5420423371718075687}
- component: {fileID: 222412779030388179}
- component: {fileID: 9012863870583988072}
- component: {fileID: -491917111353923023}
m_Layer: 5
m_Name: Tooltip
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5252969080537395222
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4903981023514464309}
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6895960645071645738}
- {fileID: 7365983033848102783}
- {fileID: 8364462058388355552}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 80.566284}
m_SizeDelta: {x: 400, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3077465998240621022
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4903981023514464309}
m_CullTransparentMesh: 1
--- !u!114 &5420423371718075687
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4903981023514464309}
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: 1}
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: 21300000, guid: b0eb9c535328048ca85e8a9f5088e776, type: 3}
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!114 &222412779030388179
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4903981023514464309}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 10
m_Right: 10
m_Top: 10
m_Bottom: 10
m_ChildAlignment: 0
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
m_ChildControlHeight: 1
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!114 &9012863870583988072
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4903981023514464309}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalFit: 0
m_VerticalFit: 2
--- !u!114 &-491917111353923023
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4903981023514464309}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3767383ff1186104f8155d759c4d97a7, type: 3}
m_Name:
m_EditorClassIdentifier:
techCostText: {fileID: 3385714104577012300}
techDescriptionText: {fileID: 8064122245696361823}
techModText: {fileID: 3110017704042887298}
--- !u!1 &6016304033209219933
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8364462058388355552}
- component: {fileID: 9043700566856291521}
- component: {fileID: 3385714104577012300}
m_Layer: 5
m_Name: Values2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8364462058388355552
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6016304033209219933}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5252969080537395222}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 369.247, y: 0}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &9043700566856291521
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6016304033209219933}
m_CullTransparentMesh: 1
--- !u!114 &3385714104577012300
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6016304033209219933}
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: New Text
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, 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: 18
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 12
m_fontSizeMax: 18
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 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: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 5, y: 5, z: 5, w: 5}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &8739971362171440240
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7365983033848102783}
- component: {fileID: 5123953077202421746}
- component: {fileID: 3110017704042887298}
m_Layer: 5
m_Name: Values
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7365983033848102783
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8739971362171440240}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5252969080537395222}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 369.247, y: 0}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &5123953077202421746
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8739971362171440240}
m_CullTransparentMesh: 1
--- !u!114 &3110017704042887298
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8739971362171440240}
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: New Text
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, 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: 18
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 12
m_fontSizeMax: 18
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 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: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 5, y: 5, z: 5, w: 5}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}

View File

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

File diff suppressed because it is too large Load Diff

View File

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: cf3a5be4b2662c74c85b8a51d513a9ff

View File

@@ -99,7 +99,7 @@ public class BuildingPlacement : MonoBehaviour
}
rightClickMenu.SetActive(true); // Hide the right-click menu if it was open
// Check if the player has enough money
if (City.Instance.money < preset.cost)
if (ResourceManager.Instance.GetResourceAmount(ResourceManager.ResourceTypes.Money).resourceAmount < preset.cost)
{
return;
}
@@ -147,20 +147,20 @@ public class BuildingPlacement : MonoBehaviour
//places down the currently selected building
void PlaceBuilding()
{
//check if the player is trying to place a building on top of another building
// Check if the player is trying to place a building on top of another building
if (City.Instance.buildings.Exists(x => x.transform.position == curIndicatorPos))
{
Debug.Log("Cannot place building on top of another building!");
return;
}
// Check if the player has enough money before placing
if (ResourceManager.Instance.GetResourceAmount(ResourceManager.ResourceTypes.Money).resourceAmount < curBuildingPreset.cost)
{
Debug.Log("Not enough money to place this building!");
return;
}
GameObject buildingObj = Instantiate(curBuildingPreset.prefab, curIndicatorPos, curIndicatorRotation);
City.Instance.OnPlaceBuilding(buildingObj.GetComponent<Building>());
/*if (placementPrefab != null)
{
Destroy(placementPrefab);
placementPrefab = null;
}*/
//currentlyPlacing = false;
}
//deletes the currently selected building

View File

@@ -10,6 +10,11 @@ public class BuildingPreset : ScriptableObject
public int population;
public int jobs;
public int food;
public int water;
public int steel;
public int faith;
public int wood;
public enum BuildingType
{
Residential,
@@ -19,7 +24,15 @@ public class BuildingPreset : ScriptableObject
School,
Hospital,
PoliceStation,
FireStation
FireStation,
Church,
Road,
PowerPlant,
WaterPlant,
Factory,
Farm,
Mine,
Sawmill
}
public BuildingType buildingType;
}

View File

@@ -35,19 +35,16 @@ public class City : MonoBehaviour
[SerializeField]
private Light sunlight; // Reference to the sunlight light source
[SerializeField] private GameObject sunTarget; // Reference to the sun target object for rotation
public int money;
//public int day;
public int curPopulation;
public int curJobs;
public int curFood;
public int maxPopulation;
public int maxJobs;
public int incomePerJob;
// Removed legacy fields: maxPopulation, maxJobs, incomePerJob, faithPerChurch
public TextMeshProUGUI moneyTxt;
public TextMeshProUGUI dayText;
public TextMeshProUGUI populationTxt;
public TextMeshProUGUI jobsTxt;
public TextMeshProUGUI foodTxt;
public TextMeshProUGUI woodTxt;
public TextMeshProUGUI steelTxt;
public TextMeshProUGUI faithTxt;
public TextMeshProUGUI waterTxt;
public List<Building> buildings = new List<Building>();
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
@@ -73,46 +70,75 @@ public class City : MonoBehaviour
//called when placing a building
public void OnPlaceBuilding(Building building)
{
//apply the building preset stats
money -= building.preset.cost;
maxPopulation += building.preset.population;
maxJobs += building.preset.jobs;
//add the building to the list of buildings
// Apply the building preset stats
buildings.Add(building);
//update the stats text
var preset = building.preset;
// Loop through all resource types and add if value is not zero
foreach (ResourceManager.ResourceTypes type in Enum.GetValues(typeof(ResourceManager.ResourceTypes)))
{
int value = GetResourceValueFromPreset(preset, type);
if (value != 0)
{
ResourceManager.Instance.AddResource(type, value);
}
}
UpdateStats();
}
// Helper method to get the value for a resource type from the preset
private int GetResourceValueFromPreset(BuildingPreset preset, ResourceManager.ResourceTypes type)
{
switch (type)
{
case ResourceManager.ResourceTypes.Population: return preset.population;
case ResourceManager.ResourceTypes.Jobs: return preset.jobs;
case ResourceManager.ResourceTypes.Faith: return preset.faith;
case ResourceManager.ResourceTypes.Food: return preset.food;
case ResourceManager.ResourceTypes.Wood: return preset.wood;
case ResourceManager.ResourceTypes.Steel: return preset.steel;
case ResourceManager.ResourceTypes.Water: return preset.water;
case ResourceManager.ResourceTypes.Money: return preset.cost;
// Add more as needed
default: return 0;
}
}
//called when bulldozing a building
public void OnRemoveBuilding(Building building)
{
//apply the building preset stats
maxPopulation -= building.preset.population;
maxJobs -= building.preset.jobs;
//remove the building from the list of buildings
// Subtract the building preset stats from resources
var preset = building.preset;
foreach (ResourceManager.ResourceTypes type in Enum.GetValues(typeof(ResourceManager.ResourceTypes)))
{
int value = GetResourceValueFromPreset(preset, type);
if (value != 0)
{
ResourceManager.Instance.AddResource(type, -value);
}
}
// Remove the building from the list and destroy it
buildings.Remove(building);
//destroy the building game object
Destroy(building.gameObject);
//update the stats text
UpdateStats();
}
//update the stats text
void UpdateStats()
{
moneyTxt.text = "$" + money;
populationTxt.text = curPopulation + " / " + maxPopulation;
jobsTxt.text = curJobs + " / " + maxJobs;
foodTxt.text = curFood.ToString();
moneyTxt.text = "$" + ResourceManager.Instance.GetResourceAmount(ResourceManager.ResourceTypes.Money).resourceAmount;
populationTxt.text = ResourceManager.Instance.GetResourceAmount(ResourceManager.ResourceTypes.Population).resourceAmount.ToString();
jobsTxt.text = ResourceManager.Instance.GetResourceAmount(ResourceManager.ResourceTypes.Jobs).resourceAmount.ToString();
foodTxt.text = ResourceManager.Instance.GetResourceAmount(ResourceManager.ResourceTypes.Food).resourceAmount.ToString();
woodTxt.text = ResourceManager.Instance.GetResourceAmount(ResourceManager.ResourceTypes.Wood).resourceAmount.ToString();
steelTxt.text = ResourceManager.Instance.GetResourceAmount(ResourceManager.ResourceTypes.Steel).resourceAmount.ToString();
faithTxt.text = ResourceManager.Instance.GetResourceAmount(ResourceManager.ResourceTypes.Faith).resourceAmount.ToString();
waterTxt.text = ResourceManager.Instance.GetResourceAmount(ResourceManager.ResourceTypes.Water).resourceAmount.ToString();
}
//called when clicking "End Turn" button
public void EndDay()
{
//calculate the updated stats
CalculateMoney();
CalculatePopulation();
CalculateJobs();
CalculateFood();
// Apply all per-day resource changes using ResourceManager
ResourceManager.Instance.ApplyDailyResourceChanges();
UpdateStats();
UpdateWeekDay(); // Update the current day of the week
}
@@ -131,38 +157,6 @@ public class City : MonoBehaviour
}
}
void CalculateMoney()
{
money += curJobs * incomePerJob;
foreach (Building building in buildings)
{
money -= building.preset.costPerTurn;
}
}
void CalculatePopulation()
{
if (curFood >= curPopulation && curPopulation < maxPopulation)
{
curFood -= curPopulation / 4;
curPopulation = Mathf.Min(curPopulation + (curFood / 4), maxPopulation);
}
else if (curFood < curPopulation)
{
curPopulation = curFood;
}
}
void CalculateJobs()
{
curJobs = Mathf.Min(curPopulation, maxJobs);
}
void CalculateFood()
{
curFood = 0;
foreach (Building building in buildings)
{
curFood += building.preset.food;
}
}
private float UpdateCurrentTime()
{
// Always use the current timeMultiplier based on timeSpeedUp
@@ -202,9 +196,6 @@ public class City : MonoBehaviour
float t = (curTime - sunriseTime) / (noonTime - sunriseTime);
intensity = Mathf.Lerp(minIntensity, maxIntensity, t);
sunPosition = Vector3.Lerp(sunriseTarget.transform.position, noonTarget.transform.position, t);
#if UNITY_EDITOR
Debug.Log($"Sunrise period - Time: {curTime:F0}, Intensity: {intensity:F2}");
#endif
}
else
{
@@ -212,9 +203,6 @@ public class City : MonoBehaviour
float t = (curTime - noonTime) / (sunsetTime - noonTime);
intensity = Mathf.Lerp(maxIntensity, minIntensity, t);
sunPosition = Vector3.Lerp(noonTarget.transform.position, sunsetTarget.transform.position, t);
#if UNITY_EDITOR
Debug.Log($"Sunset period - Time: {curTime:F0}, Intensity: {intensity:F2}");
#endif
}
}
else
@@ -223,9 +211,6 @@ public class City : MonoBehaviour
intensity = minIntensity;
// During night, keep the sun at sunset position (sun is "below horizon")
sunPosition = sunsetTarget.transform.position;
#if UNITY_EDITOR
Debug.Log($"Night cycle active - Time: {curTime:F0}, Intensity: {intensity:F2}");
#endif
}
// Move the sun target and apply light intensity

View File

@@ -1,33 +1,29 @@
using UnityEngine;
public class PanelToggle : MonoBehaviour
{
void Awake()
{
// there is only 1 child so this is a quick way to get a reference
panelToToggle = transform.GetChild(0).gameObject;
currentToggle = panelToToggle.activeSelf; // sync var to panels state
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PanelToggle : MonoBehaviour
{
[SerializeField]
private GameObject panelToToggle;
[SerializeField]
private bool currentToggle;
[SerializeField]
private KeyCode keyToToggle;
private bool currentToggle; // true if panel on
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
// Start is called before the first frame update
void Awake()
{
panelToToggle = transform.GetChild(0).gameObject;
currentToggle = panelToToggle.activeSelf;
}
// Update is called once per frame
void Update()
{
if(Input.GetKeyDown(keyToToggle))
if (Input.GetKeyDown(keyToToggle))
{
Toggle();
}
}
public void Toggle()
public void Toggle()
{
currentToggle = !currentToggle;
panelToToggle.SetActive(currentToggle);

View File

@@ -0,0 +1,85 @@
using System.Collections.Generic;
using UnityEngine;
public class ResourceManager : MonoBehaviour
{
public enum ResourceTypes { Steel, Wood, Water, Population, Food, Faith, Money, Jobs, maxPopulation, faithPerDay, moneyPerDay, woodPerDay, steelPerDay, waterPerDay, foodPerDay, populationPerDay }
public List<ResourceAmount> resourceAmounts;
public static ResourceManager Instance { get; private set; }
private void Awake()
{
if (Instance != null && Instance != this)
{
Destroy(this.gameObject);
}
else
{
Instance = this;
}
}
public ResourceAmount GetResourceAmount(ResourceTypes resource)
{
var found = resourceAmounts.Find(r => r.resourceType == resource);
if (found == null)
{
Debug.LogWarning($"Resource {resource} not found!");
return new ResourceAmount { resourceType = resource, resourceAmount = 0 };
}
return found;
}
public void AddResource(ResourceTypes type, int amount)
{
var res = GetResourceAmount(type);
res.resourceAmount += amount;
ClampResource(type);
}
// Clamp resource to prevent negative values for certain types
private void ClampResource(ResourceTypes type)
{
// Only clamp for resources that should not go negative
switch (type)
{
case ResourceTypes.Food:
case ResourceTypes.Money:
case ResourceTypes.Wood:
case ResourceTypes.Steel:
case ResourceTypes.Water:
case ResourceTypes.Faith:
case ResourceTypes.Population:
var res = GetResourceAmount(type);
if (res.resourceAmount < 0)
res.resourceAmount = 0;
break;
default:
break;
}
}
public void SetResource(ResourceTypes type, int amount)
{
var res = GetResourceAmount(type);
res.resourceAmount = amount;
}
public void ApplyDailyResourceChanges()
{
// For each resource type that has a corresponding per-day value, add it to the main resource
AddResource(ResourceTypes.Faith, GetResourceAmount(ResourceTypes.faithPerDay).resourceAmount);
AddResource(ResourceTypes.Money, GetResourceAmount(ResourceTypes.moneyPerDay).resourceAmount);
AddResource(ResourceTypes.Wood, GetResourceAmount(ResourceTypes.woodPerDay).resourceAmount);
AddResource(ResourceTypes.Steel, GetResourceAmount(ResourceTypes.steelPerDay).resourceAmount);
AddResource(ResourceTypes.Water, GetResourceAmount(ResourceTypes.waterPerDay).resourceAmount);
AddResource(ResourceTypes.Food, GetResourceAmount(ResourceTypes.foodPerDay).resourceAmount);
AddResource(ResourceTypes.Population, GetResourceAmount(ResourceTypes.populationPerDay).resourceAmount);
}
}
[System.Serializable]
public class ResourceAmount
{
public ResourceManager.ResourceTypes resourceType;
public int resourceAmount;
}

View File

@@ -1,48 +0,0 @@
using UnityEngine;
using System.Collections.Generic;
public class Resources : MonoBehaviour
{
private void Awake()
{
// if Instance is not null, but has a value that is not this
// version of the object, destroy this version because only
// one is allowed to exist.
// otherwise assign this version to Instance.
if(Instance != null && Instance != this)
{
Destroy(this.gameObject);
}
else
{
Instance = this;
}
}
// note that the setter is private, meaning that no other class can set this property
public static Resources Instance { get; private set; }
public enum ResourceTypes { Gold, Steel, Wood, Water };
public List<ResourceAmount> resourceAmounts;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public ResourceAmount GetResourceAmount(ResourceTypes resource)
{
// 'r' holds the current ResourceAmount element from our list as we iterate through it...
return resourceAmounts.Find(r => r.resourceType == resource);
}
}
[System.Serializable]
public class ResourceAmount
{
public Resources.ResourceTypes resourceType;
public int resourceAmount;
}

View File

@@ -1,27 +1,27 @@
using UnityEngine;
using System.Collections.Generic;
public class TechDatabase : MonoBehaviour
{
public List<TechGroup> techGroups;
[System.Serializable]
public class TechGroup
{
public List<Technology> technologies;
}
private void Update()
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TechDatabase : MonoBehaviour
{
if(Input.GetKeyDown(KeyCode.O))
public List<TechGroup> techGroups;
private void Update()
{
techGroups[0].technologies[0].StartResearching();
}
if (Input.GetKeyDown(KeyCode.P))
{
techGroups[1].technologies[0].StartResearching();
}
if (Input.GetKeyDown(KeyCode.Space))
{
TechEvents.TurnPassed(null); // Trigger the turn passed event
if (Input.GetKeyDown(KeyCode.A))
{
techGroups[0].technologies[0].StartResearching();
}
if (Input.GetKeyDown(KeyCode.S))
{
techGroups[1].technologies[0].StartResearching();
}
if (Input.GetKeyDown(KeyCode.Space))
{
TechEvents.TurnPassed();
}
}
}
}
[System.Serializable]
public class TechGroup
{
public List<Technology> technologies;
}

View File

@@ -1,37 +1,27 @@
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public class TechEvents : MonoBehaviour
{
public class TechEvents : MonoBehaviour
{
public static Action<Technology> OnTechResearchStarted;
public static Action<Technology> OnTechResearchCompleted;
public static Action<Technology> OnTechUnlocked;
public static Action OnTurnPassed; // takes no parameter passed in
public static Action OnTurnPassed;
public static void TechResearchStarted(Technology tech)
{
// note the use of the null check operator (?) below
// this translates into: "if this object is not null, call this method on it"
OnTechResearchStarted?.Invoke(tech);
}
public static void TechResearchCompleted(Technology tech)
{
// note the use of the null check operator (?) below
// this translates into: "if this object is not null, call this method on it"
OnTechResearchCompleted?.Invoke(tech);
}
public static void TechUnlocked(Technology tech)
{
// note the use of the null check operator (?) below
// this translates into: "if this object is not null, call this method on it"
OnTechUnlocked?.Invoke(tech);
}
public static void TurnPassed(Technology tech)
public static void TurnPassed()
{
// note the use of the null check operator (?) below
// this translates into: "if this object is not null, call this method on it"
OnTurnPassed?.Invoke();
}
}
}

View File

@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TechNodeConnector : MonoBehaviour
{
private UnityEngine.UI.Image image;
// Start is called before the first frame update
void Awake()
{
image = GetComponent<UnityEngine.UI.Image>();
}
public void MakeConnections(Vector3 fromPoint, Vector3 toPoint, Color color)
{
image.color = color;
Vector3 centerPosition = (fromPoint + toPoint) / 2;
Vector3 direction = Vector3.Normalize(fromPoint - toPoint);
transform.right = direction;
transform.position = centerPosition;
transform.localScale = new Vector3(Vector3.Distance(fromPoint, toPoint) / 10, 1, 1);
transform.SetAsFirstSibling();
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 7554ecf4667c65b4ba007999cd76c9e7

View File

@@ -1,44 +1,85 @@
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class TechNodeUI : MonoBehaviour
{
using UnityEngine.EventSystems;
public class TechNodeUI : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
[SerializeField]
private Image techImage;
[SerializeField] Image techStatusImage;
[SerializeField] Sprite techStatusLocked;
[SerializeField] Sprite techStatusUnlocked;
[SerializeField] Sprite techStatusResearching;
[SerializeField] Sprite techStatusCompleted;
[SerializeField]
private TextMeshProUGUI techTitleText;
[HideInInspector]
public Technology technology; // the technology this node represents
public Technology technology;
[SerializeField]
private Image nodeImage;
[SerializeField]
private TechNodeConnector connector;
[SerializeField]
private Outline outline;
public void Initialize(Technology tech)
{
technology = tech;
techTitleText.text = tech.techName;
techImage.sprite = tech.techImage;
outline.effectColor = tech.techUIColor;
if (tech.availabilityState == Technology.AvailabilityState.Locked)
{
nodeImage.color = Color.gray; // gray out the node if locked
nodeImage.color = Color.gray;
techStatusImage.sprite = techStatusLocked;
techStatusImage.color = Color.black;
TechEvents.OnTechUnlocked += UnlockedTechnology;
}
GetComponent<Button>().onClick.AddListener(StartResearching);
}
public void StartResearching()
{
if (technology.availabilityState == Technology.AvailabilityState.Unlocked &&
technology.StartResearching())
if (technology.availabilityState == Technology.AvailabilityState.Unlocked && technology.StartResearching())
{
nodeImage.color = Color.blue; // indicate being researched
nodeImage.color = Color.blue;
techStatusImage.color = Color.black;
techStatusImage.sprite = techStatusResearching;
TechEvents.OnTechResearchCompleted += CompletedResearch;
}
}
public void CompletedResearch(Technology tech)
{
// complete only for this technology
if (!tech.Equals(technology))
return;
nodeImage.color = Color.green;
TechEvents.OnTechResearchCompleted -= CompletedResearch;
}
}
public void Connect(List<TechNodeUI> nodes, Transform parent)
{
foreach (RequiredTech tech in technology.techRequirements)
{
TechNodeUI connectedNode = nodes.Find(t=>t.technology.techName == tech.techName);
TechNodeConnector nodeConnector = Instantiate(connector, parent);
nodeConnector.MakeConnections(transform.position, connectedNode.transform.position, connectedNode.technology.techUIColor);
}
}
public void CompletedResearch(Technology tech)
{
nodeImage.color = Color.green;
techStatusImage.sprite = techStatusCompleted;
techStatusImage.color = Color.black;
TechEvents.OnTechResearchCompleted -= CompletedResearch;
}
public void UnlockedTechnology(Technology tech)
{
if (tech == technology)
{
nodeImage.color = Color.yellow;
techStatusImage.sprite = techStatusUnlocked;
techStatusImage.color = Color.black;
TechEvents.OnTechUnlocked -= UnlockedTechnology;
}
}
public void OnPointerEnter(PointerEventData eventData)
{
TechTooltip.Instance.Show(this.technology);
}
public void OnPointerExit(PointerEventData eventData)
{
TechTooltip.Instance.Hide();
}
}

View File

@@ -0,0 +1,41 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
using TMPro;
public class TechTooltip : MonoBehaviour
{
public static TechTooltip Instance { get; private set; }
[SerializeField]
private TextMeshProUGUI techCostText, techDescriptionText, techModText;
private void LateUpdate()
{
transform.position = Input.mousePosition;
}
public void Show(Technology tech)
{
gameObject.SetActive(true);
string cost = string.Join("\n", tech.resourceCosts.Select(c => string.Format("-{0} {1}", c.resourceAmount, c.resourceType)));
string mods = string.Join("\n", tech.techModifiers.Select(m => string.Format("+{0} {1}", m.amount, m.modifier)));
techCostText.text = cost;
techModText.text = mods;
techDescriptionText.text = tech.techDescription;
}
public void Hide()
{
gameObject.SetActive(false);
}
// Start is called before the first frame update
void Awake()
{
gameObject.SetActive(false);
if (Instance != null && Instance != this)
{
Destroy(this.gameObject);
}
else
{
Instance = this;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3767383ff1186104f8155d759c4d97a7

View File

@@ -1,22 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TechTreeUI : MonoBehaviour
{
private List<TechDatabase.TechGroup> techGroups;
using System.Collections.Generic;
using UnityEngine;
public class TechTreeUI : MonoBehaviour
{
private List<TechGroup> techGroups;
[SerializeField]
private GameObject techColumn;
[SerializeField]
private TechNodeUI techNode;
[SerializeField]
private Transform techPanel;
private List<TechNodeUI> techNodes = new List<TechNodeUI>();
// Start is called before the first frame update
void Start()
{
techGroups = FindFirstObjectByType<TechDatabase>().techGroups;
BuildTree();
techGroups = FindAnyObjectByType<TechDatabase>().techGroups;
StartCoroutine(BuildTree());
}
void BuildTree()
IEnumerator BuildTree()
{
for (int i = 0; i < techGroups.Count; i++)
{
@@ -24,8 +25,14 @@ public class TechTreeUI : MonoBehaviour
for (int j = 0; j < techGroups[i].technologies.Count; j++)
{
TechNodeUI node = Instantiate(techNode, col);
techNodes.Add(node);
node.Initialize(techGroups[i].technologies[j]);
}
}
yield return 0;
for (int i = 0; i < techNodes.Count; i++)
{
techNodes[i].Connect(techNodes, techPanel);
}
}
}
}

View File

@@ -2,19 +2,21 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
[System.Serializable]
public class Technology
{
public enum AvailabilityState { Locked, Unlocked, Researching, Learned };
public AvailabilityState availabilityState;
[System.Serializable]
public class Technology
{
public string techName;
public enum AvailabilityState { Locked, Unlocked, Researching, Learned }
public AvailabilityState availabilityState;
public string techDescription;
public Sprite techImage;
public List<ResourceAmount> resourceCosts;
public List<RequiredTech> techRequirements;
public List<TechModifiers> techModifiers;
[SerializeField]
private int researchedTurns;
public int requiredResearchTurns;
public Color techUIColor;
public Technology()
{
if (availabilityState == AvailabilityState.Locked)
@@ -25,14 +27,14 @@ public class Technology
public void Unlock()
{
availabilityState = AvailabilityState.Unlocked;
TechEvents.OnTechResearchCompleted -= CheckRequirements; // add this line
Debug.Log("Tech was unlocked: " + this.techName);
TechEvents.TechUnlocked(this);
TechEvents.OnTechResearchCompleted -= CheckRequirements;
Debug.Log("Tech was unlocked:" + this.techName);
}
public void Learn()
{
TechEvents.TechResearchCompleted(this);
// stop listening for turns passing...
TechEvents.OnTurnPassed -= NewTurn; // add this line
TechEvents.OnTurnPassed -= NewTurn;
availabilityState = AvailabilityState.Learned;
Debug.Log("Tech was learned: " + this.techName);
}
@@ -49,23 +51,14 @@ public class Technology
}
private void CheckRequirements(Technology tech)
{
// only do the check if this tech is locked
if (availabilityState == AvailabilityState.Locked)
{
/* go through the techRequirements list and see if the newly available te
ch (the parameter
* that was passed into this function) was one of this tech's requirement
s.
*/
RequiredTech requireTech = techRequirements.FirstOrDefault(rt => rt.techName == tech.techName);
// if there is a requiredTech and it is not complete, perform these steps
RequiredTech requireTech = techRequirements.FirstOrDefault(rt=>rt.techName == tech.techName);
if (requireTech != null && !requireTech.completed)
{
requireTech.completed = true; // mark the requirement as complete
// check if all requirements are complete...
if (!techRequirements.Any(t => t.completed == false))
requireTech.completed = true;
if (!techRequirements.Any(t=>t.completed == false))
{
// ...if so, this tech is now unlocked and available
Unlock();
}
}
@@ -74,44 +67,40 @@ public class Technology
public bool StartResearching()
{
bool hasEnoughResources = false;
// keep track of how many resources you have the required amount of...
List<ResourceAmount> resourceAmounts = new List<ResourceAmount>();
// loop through each of the required resources
for (int i = 0; i < resourceCosts.Count; i++)
{
// find out how much of a type (wood, etc.) you currently have
ResourceAmount currentAmount = Resources.Instance.GetResourceAmount(resourceCosts[i].resourceType);
// find out how much is required. Cache the cost
ResourceAmount currentAmount = ResourceManager.Instance.GetResourceAmount(resourceCosts[i].resourceType);
ResourceAmount cost = resourceCosts[i];
// only add to list if you have enough of resource type...
if (currentAmount.resourceAmount >= cost.resourceAmount)
{
resourceAmounts.Add(currentAmount);
}
}
// if the number of resources you can fulfill is equal to the number
// required by the technology, then you can start researching
if (resourceAmounts.Count >= resourceCosts.Count)
{
hasEnoughResources = true;
for (int i = 0; i < resourceCosts.Count; i++)
{
// go ahead and subtract all the resource costs from the player...
resourceAmounts[i].resourceAmount -= resourceCosts[i].resourceAmount;
resourceAmounts[i].resourceAmount -= resourceCosts[i].resourceAmount;
}
availabilityState = AvailabilityState.Researching;
// fire off a TechResearchStarted event, specifying which kind of tech...
TechEvents.TechResearchStarted(this); // add this line
// start listening for turns to pass by subscribing to turn event.
// Have NewTurn() method handle the events...
TechEvents.OnTurnPassed += NewTurn; // add this line
TechEvents.TechResearchStarted(this);
TechEvents.OnTurnPassed += NewTurn;
}
return hasEnoughResources;
}
}
}
[System.Serializable]
public class RequiredTech
{
public class RequiredTech
{
public string techName;
public bool completed;
}
}
[System.Serializable]
public class TechModifiers
{
public enum ModifierType { Gold, Steel, Wood, Water, Population, Food }
public ModifierType modifier;
public float amount;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More