From 4e43c9824cd85b9010b46d36bca0a162f41cb930 Mon Sep 17 00:00:00 2001 From: laurids Date: Fri, 11 Feb 2022 23:24:52 +0100 Subject: [PATCH] Time Scale in der Debug UI --- Assets/GWConquest/Prefabs/Formation.prefab | 1 - Assets/GWConquest/Scenes/GalaxyMap.unity | 470 ++++++++++++++++++- Assets/GWConquest/Scripts/DistrictFactory.cs | 9 +- Assets/GWConquest/Scripts/Formation.cs | 2 +- Assets/GWConquest/Scripts/GameManager.cs | 53 ++- Assets/GWConquest/Scripts/UI/DebugUI.cs | 12 + 6 files changed, 518 insertions(+), 29 deletions(-) diff --git a/Assets/GWConquest/Prefabs/Formation.prefab b/Assets/GWConquest/Prefabs/Formation.prefab index dddd4cd..7a58cd1 100644 --- a/Assets/GWConquest/Prefabs/Formation.prefab +++ b/Assets/GWConquest/Prefabs/Formation.prefab @@ -48,7 +48,6 @@ MonoBehaviour: movingArmyPrefab: {fileID: 6934264676097734670, guid: b4b4aee434157c54cb53399d1578f446, type: 3} movingArmyScale: 0.85 - movementSpeed: 150 keepFormationName: 0 --- !u!114 &-4037000077425190141 MonoBehaviour: diff --git a/Assets/GWConquest/Scenes/GalaxyMap.unity b/Assets/GWConquest/Scenes/GalaxyMap.unity index bfc2645..b1ba56b 100644 --- a/Assets/GWConquest/Scenes/GalaxyMap.unity +++ b/Assets/GWConquest/Scenes/GalaxyMap.unity @@ -27185,18 +27185,19 @@ MonoBehaviour: GroundTransitionLengthFactor: 45 SpaceTransitionLengthFactor: 1 BetweenTransitionLengthFactor: 60 - BattleTurnLength: 30 - BattleTurnDeviation: 10 - BattlePreparingCooldown: 30 - MoveToFlankCooldown: 15 - MoveToReserveCooldown: 15 - UnitDeathCooldown: 60 - ArtilleryCooldown: 20 - MovementStartingCooldown: 10 - MovementFinishedCooldown: 10 + battleTurnLength: 30 + battleTurnDeviation: 10 + battlePreparingCooldown: 30 + moveToFlankCooldown: 15 + moveToReserveCooldown: 15 + unitDeathCooldown: 60 + artilleryCooldown: 20 + movementStartingCooldown: 10 + movementFinishedCooldown: 10 DefaultStorageCapacity: 10000 MaxStackSize: 500 - DefaultProductionCooldown: 10 + defaultProductionCooldown: 10 + defaultMovementSpeed: 150 StartRevealChance: 0.5 StartFullRevealChance: 0.5 RevealTurnLength: 30 @@ -27205,8 +27206,9 @@ MonoBehaviour: RevealChanceOther: 0.5 RevealChanceSelf: 0.1 RevealChanceAttack: 0.3 - ShieldsCooldown: 10 + shieldsCooldown: 10 SpawnAIPlayer: 1 + TimeScale: 1 --- !u!4 &426309784 Transform: m_ObjectHideFlags: 0 @@ -27222,6 +27224,186 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &429234467 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 587515776} + m_Modifications: + - target: {fileID: 116803036596692165, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_Text + value: '-' + objectReference: {fileID: 0} + - target: {fileID: 116803036596692165, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_FontData.m_MinSize + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 116803036596692165, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_FontData.m_FontSize + value: 22 + objectReference: {fileID: 0} + - target: {fileID: 116803036596692165, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_FontData.m_Alignment + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1441723235595607368, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_Name + value: SpeedDownButton + objectReference: {fileID: 0} + - target: {fileID: 2472813335678215477, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2472813335678215477, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2472813335678215477, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target + value: + objectReference: {fileID: 587515777} + - target: {fileID: 2472813335678215477, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_CallState + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 2472813335678215477, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: SpeedDown + objectReference: {fileID: 0} + - target: {fileID: 2472813335678215477, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName + value: GWConquest.DebugUI, Assembly-CSharp + objectReference: {fileID: 0} + - target: {fileID: 2472813335678215477, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName + value: UnityEngine.Object, UnityEngine + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_RootOrder + value: 13 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_AnchorMin.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_SizeDelta.x + value: 28.4675 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_SizeDelta.y + value: 30 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 1969.3198 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_AnchoredPosition.y + value: -114 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 33c4cb604a7a3db48b51a358e1d9692a, type: 3} +--- !u!224 &429234468 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + m_PrefabInstance: {fileID: 429234467} + m_PrefabAsset: {fileID: 0} --- !u!1 &431870514 GameObject: m_ObjectHideFlags: 0 @@ -33587,6 +33769,9 @@ RectTransform: - {fileID: 740356799} - {fileID: 953746576} - {fileID: 894815927} + - {fileID: 1892591759} + - {fileID: 1137103079} + - {fileID: 429234468} m_Father: {fileID: 494226835} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -33617,6 +33802,7 @@ MonoBehaviour: MoveEnemyUnitsToggle: {fileID: 740356798} FreeBuildToggle: {fileID: 953746575} FPSCounter: {fileID: 894815925} + GameSpeedLabel: {fileID: 1137103080} --- !u!1 &590405909 GameObject: m_ObjectHideFlags: 0 @@ -67251,6 +67437,88 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 6ded4d2fd3f18ad40916c57fe4f6a566, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &1137103078 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1137103079} + - component: {fileID: 1137103081} + - component: {fileID: 1137103080} + m_Layer: 5 + m_Name: Speed Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1137103079 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1137103078} + 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: 587515776} + m_RootOrder: 12 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 785.4, y: 606} + m_SizeDelta: {x: -2422.2, y: -1415.5} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1137103080 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1137103078} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3} + m_FontSize: 18 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: 'Game Speed: 1.00 + +' +--- !u!222 &1137103081 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1137103078} + m_CullTransparentMesh: 1 --- !u!1001 &1142756837 PrefabInstance: m_ObjectHideFlags: 0 @@ -112995,6 +113263,186 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1885138119} m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1001 &1892591758 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 587515776} + m_Modifications: + - target: {fileID: 116803036596692165, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_Text + value: + + objectReference: {fileID: 0} + - target: {fileID: 116803036596692165, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_FontData.m_MinSize + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 116803036596692165, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_FontData.m_FontSize + value: 24 + objectReference: {fileID: 0} + - target: {fileID: 116803036596692165, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_FontData.m_Alignment + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1441723235595607368, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_Name + value: SpeedUpButton + objectReference: {fileID: 0} + - target: {fileID: 2472813335678215477, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2472813335678215477, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2472813335678215477, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target + value: + objectReference: {fileID: 587515777} + - target: {fileID: 2472813335678215477, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_CallState + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 2472813335678215477, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: SpeedUp + objectReference: {fileID: 0} + - target: {fileID: 2472813335678215477, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName + value: GWConquest.DebugUI, Assembly-CSharp + objectReference: {fileID: 0} + - target: {fileID: 2472813335678215477, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName + value: UnityEngine.Object, UnityEngine + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_RootOrder + value: 11 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_AnchorMin.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_SizeDelta.x + value: 28.4675 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_SizeDelta.y + value: 30 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 2147.873 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_AnchoredPosition.y + value: -114 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 33c4cb604a7a3db48b51a358e1d9692a, type: 3} +--- !u!224 &1892591759 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 2546910633527798616, guid: 33c4cb604a7a3db48b51a358e1d9692a, + type: 3} + m_PrefabInstance: {fileID: 1892591758} + m_PrefabAsset: {fileID: 0} --- !u!1 &1893307637 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/GWConquest/Scripts/DistrictFactory.cs b/Assets/GWConquest/Scripts/DistrictFactory.cs index 34b5e20..287e77e 100644 --- a/Assets/GWConquest/Scripts/DistrictFactory.cs +++ b/Assets/GWConquest/Scripts/DistrictFactory.cs @@ -87,7 +87,7 @@ namespace GWConquest var entry = GetProductionQueueEntry(i); if(entry != null) { - return GetProductionTime(i) / GetProductionQueueEntry(i).BuildTime; + return GetProductionTime(i) / GetBuildTimeForBuildable(GetProductionQueueEntry(i)); } else return 0; } @@ -133,7 +133,10 @@ namespace GWConquest } } - + public float GetBuildTimeForBuildable(IBuildable buildable) + { + return buildable.BuildTime * GameManager.Instance.TimeScale; + } public override void SimulateOwner() { @@ -141,7 +144,7 @@ namespace GWConquest { State.ProductionQueue[0].TimeProduced += BoltNetwork.FrameDeltaTime; IBuildable buildable = GetProductionQueueEntry(0); - if (DebugUI.FreeBuild || GetProductionTime(0) >= buildable.BuildTime) + if (DebugUI.FreeBuild || GetProductionTime(0) >= GetBuildTimeForBuildable(buildable)) { if(buildable is UnitClass) { diff --git a/Assets/GWConquest/Scripts/Formation.cs b/Assets/GWConquest/Scripts/Formation.cs index badd2b1..31a9fc2 100644 --- a/Assets/GWConquest/Scripts/Formation.cs +++ b/Assets/GWConquest/Scripts/Formation.cs @@ -171,7 +171,7 @@ namespace GWConquest private Vector3 arrivalPosition; - public float movementSpeed = 1f; + public float movementSpeed {get => GameManager.Instance.DefaultMovementSpeed;} public int FormationNumber { get => State.FormationNumber; diff --git a/Assets/GWConquest/Scripts/GameManager.cs b/Assets/GWConquest/Scripts/GameManager.cs index e22b8cb..b2cc8dc 100644 --- a/Assets/GWConquest/Scripts/GameManager.cs +++ b/Assets/GWConquest/Scripts/GameManager.cs @@ -22,22 +22,45 @@ namespace GWConquest public float SpaceTransitionLengthFactor; public float BetweenTransitionLengthFactor; - public float BattleTurnLength; - public float BattleTurnDeviation; - - public float BattlePreparingCooldown; - - public float MoveToFlankCooldown; - public float MoveToReserveCooldown; - public float UnitDeathCooldown; - public float ArtilleryCooldown; - public float MovementStartingCooldown; - public float MovementFinishedCooldown; + [SerializeField] + private float battleTurnLength; + public float BattleTurnLength {get => battleTurnLength * TimeScale;} + [SerializeField] + private float battleTurnDeviation; + public float BattleTurnDeviation {get => battleTurnDeviation * TimeScale;} + + [SerializeField] + private float battlePreparingCooldown; + public float BattlePreparingCooldown {get => battlePreparingCooldown * TimeScale;} + + [SerializeField] + private float moveToFlankCooldown; + public float MoveToFlankCooldown {get => moveToFlankCooldown * TimeScale;} + [SerializeField] + private float moveToReserveCooldown; + public float MoveToReserveCooldown {get => moveToReserveCooldown * TimeScale;} + [SerializeField] + private float unitDeathCooldown; + public float UnitDeathCooldown {get => unitDeathCooldown * TimeScale;} + [SerializeField] + private float artilleryCooldown; + public float ArtilleryCooldown {get => artilleryCooldown * TimeScale;} + [SerializeField] + private float movementStartingCooldown; + public float MovementStartingCooldown {get => movementStartingCooldown * TimeScale;} + [SerializeField] + private float movementFinishedCooldown; + public float MovementFinishedCooldown {get => movementFinishedCooldown * TimeScale;} public int DefaultStorageCapacity; public int MaxStackSize; - public float DefaultProductionCooldown; + [SerializeField] + private float defaultProductionCooldown; + public float DefaultProductionCooldown {get => defaultProductionCooldown * TimeScale;} + [SerializeField] + private float defaultMovementSpeed; + public float DefaultMovementSpeed {get => defaultMovementSpeed / TimeScale;} public float StartRevealChance; public float StartFullRevealChance; @@ -48,12 +71,16 @@ namespace GWConquest public float RevealChanceSelf; public float RevealChanceAttack; - public float ShieldsCooldown; + [SerializeField] + private float shieldsCooldown; + public float ShieldsCooldown {get => shieldsCooldown * TimeScale;} public bool SpawnAIPlayer; public bool IsLoaded { get; private set; } = false; + public float TimeScale = 1f; + private static GameManager _instance; public static GameManager Instance { diff --git a/Assets/GWConquest/Scripts/UI/DebugUI.cs b/Assets/GWConquest/Scripts/UI/DebugUI.cs index 10433cd..6a47a44 100644 --- a/Assets/GWConquest/Scripts/UI/DebugUI.cs +++ b/Assets/GWConquest/Scripts/UI/DebugUI.cs @@ -26,6 +26,7 @@ namespace GWConquest public Toggle FreeBuildToggle; public Text FPSCounter; + public Text GameSpeedLabel; public void ClickSpawnButton() @@ -101,6 +102,17 @@ namespace GWConquest void Update() { FPSCounter.text = string.Format("FPS: {0:00}", 1f/Time.unscaledDeltaTime); + GameSpeedLabel.text = string.Format("Game Speed: {0:0.00}", 1f/GameManager.Instance.TimeScale); + } + + public void SpeedUp() + { + GameManager.Instance.TimeScale *= 0.5f; + } + + public void SpeedDown() + { + GameManager.Instance.TimeScale *= 2f; } } }