diff --git a/Assets/GWConquest/Animations/PlanetIndicator.controller b/Assets/GWConquest/Animations/PlanetIndicator.controller index 4902ed6..6d91d79 100644 --- a/Assets/GWConquest/Animations/PlanetIndicator.controller +++ b/Assets/GWConquest/Animations/PlanetIndicator.controller @@ -66,7 +66,7 @@ AnimatorController: m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer @@ -94,7 +94,7 @@ AnimatorStateMachine: m_Position: {x: 260, y: 80, z: 0} - serializedVersion: 1 m_State: {fileID: 2989985220435069597} - m_Position: {x: 240, y: 190, z: 0} + m_Position: {x: 200, y: 180, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: [] m_EntryTransitions: [] @@ -151,7 +151,7 @@ AnimatorState: m_MirrorParameterActive: 0 m_CycleOffsetParameterActive: 0 m_TimeParameterActive: 0 - m_Motion: {fileID: 0} + m_Motion: {fileID: 7400000, guid: c638c5dbdee6c2e46a340d2e3d66a16d, type: 2} m_Tag: m_SpeedParameter: m_MirrorParameter: diff --git a/Assets/GWConquest/Animations/PlanetIndicatorIdle.anim b/Assets/GWConquest/Animations/PlanetIndicatorIdle.anim new file mode 100644 index 0000000..4ae0f2c --- /dev/null +++ b/Assets/GWConquest/Animations/PlanetIndicatorIdle.anim @@ -0,0 +1,143 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: PlanetIndicatorIdle + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Image/BattleAura + classID: 1 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Image/BattleSwords + classID: 1 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 4293498787 + attribute: 2086281974 + script: {fileID: 0} + typeID: 1 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 3939035237 + attribute: 2086281974 + script: {fileID: 0} + typeID: 1 + customType: 0 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Image/BattleAura + classID: 1 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: Image/BattleSwords + classID: 1 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/GWConquest/Animations/PlanetIndicatorIdle.anim.meta b/Assets/GWConquest/Animations/PlanetIndicatorIdle.anim.meta new file mode 100644 index 0000000..774808a --- /dev/null +++ b/Assets/GWConquest/Animations/PlanetIndicatorIdle.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c638c5dbdee6c2e46a340d2e3d66a16d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GWConquest/Prefabs/UI/GarrisonPanel.prefab b/Assets/GWConquest/Prefabs/UI/GarrisonPanel.prefab index eec1613..2ec0277 100644 --- a/Assets/GWConquest/Prefabs/UI/GarrisonPanel.prefab +++ b/Assets/GWConquest/Prefabs/UI/GarrisonPanel.prefab @@ -477,43 +477,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c007a78ea4c9b9741a9a08e917508e9f, type: 3} m_Name: m_EditorClassIdentifier: - Content: {fileID: 1069889124} - IconOffset: 5 - ArmyGroupOffset: 5 - ArmyGroupOffsetX: 50 - ArmyGroupPrefab: {fileID: 8873205197795550154, guid: 3da507d0addcecc4688100db8c4e4304, + ContentTransform: {fileID: 1069889124} + ElementPrefab: {fileID: 2673194344194583624, guid: f3a5c8bf38a7dfa408f601a424edb92d, type: 3} - UnitIconPrefab: {fileID: 7101981575647078767, guid: 826c1e93895e3e34399f95ec1d5acad8, - type: 3} - GreyedOutColor: {r: 1, g: 1, b: 1, a: 0.24705882} ---- !u!114 &5779445202336357724 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2443912949472084106} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Delegates: - - eventID: 4 - callback: - m_PersistentCalls: - m_Calls: - - m_Target: {fileID: 1590972559} - m_MethodName: Deselect - m_Mode: 1 - m_Arguments: - m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine - m_IntArgument: 0 - m_FloatArgument: 0 - m_StringArgument: - m_BoolArgument: 0 - m_CallState: 2 --- !u!1 &5411513710314136447 GameObject: m_ObjectHideFlags: 0 @@ -662,120 +628,120 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_LocalPosition.x - value: 0 + propertyPath: m_Pivot.x + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_LocalPosition.y - value: 0 + propertyPath: m_Pivot.y + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_LocalPosition.z + propertyPath: m_RootOrder value: 0 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_LocalRotation.x - value: -0 + propertyPath: m_AnchorMax.x + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_LocalRotation.y - value: -0 + propertyPath: m_AnchorMax.y + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_LocalRotation.z - value: -0 + propertyPath: m_AnchorMin.x + value: 0 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_LocalRotation.w - value: 1 + propertyPath: m_AnchorMin.y + value: 0 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_RootOrder - value: 0 + propertyPath: m_SizeDelta.x + value: -4 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 + propertyPath: m_SizeDelta.y + value: -4 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_LocalEulerAnglesHint.y + propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_LocalEulerAnglesHint.z + propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_AnchoredPosition.x - value: -2 + propertyPath: m_LocalPosition.z + value: 0 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_AnchoredPosition.y - value: -2 + propertyPath: m_LocalRotation.w + value: 1 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_SizeDelta.x - value: -4 + propertyPath: m_LocalRotation.x + value: -0 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_SizeDelta.y - value: -4 + propertyPath: m_LocalRotation.y + value: -0 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_AnchorMin.x - value: 0 + propertyPath: m_LocalRotation.z + value: -0 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_AnchorMin.y - value: 0 + propertyPath: m_AnchoredPosition.x + value: -2 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_AnchorMax.x - value: 0.5 + propertyPath: m_AnchoredPosition.y + value: -2 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_AnchorMax.y - value: 0.5 + propertyPath: m_LocalEulerAnglesHint.x + value: 0 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_Pivot.x - value: 0.5 + propertyPath: m_LocalEulerAnglesHint.y + value: 0 objectReference: {fileID: 0} - target: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} - propertyPath: m_Pivot.y - value: 0.5 + propertyPath: m_LocalEulerAnglesHint.z + value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} ---- !u!224 &9198647461551696382 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, - type: 3} - m_PrefabInstance: {fileID: 1337701076232978347} - m_PrefabAsset: {fileID: 0} --- !u!1 &2443912949472084106 stripped GameObject: m_CorrespondingSourceObject: {fileID: 3709556431398436641, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, type: 3} m_PrefabInstance: {fileID: 1337701076232978347} m_PrefabAsset: {fileID: 0} +--- !u!224 &9198647461551696382 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 7870129596896663125, guid: 8b0edf9c7ac699a4da4b06f9b352ff47, + type: 3} + m_PrefabInstance: {fileID: 1337701076232978347} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/GWConquest/Prefabs/UI/UnitInfoPanel/UnitClassIconLarge.prefab b/Assets/GWConquest/Prefabs/UI/UnitInfoPanel/UnitClassIconLarge.prefab index d1ea87c..5697b1e 100644 --- a/Assets/GWConquest/Prefabs/UI/UnitInfoPanel/UnitClassIconLarge.prefab +++ b/Assets/GWConquest/Prefabs/UI/UnitInfoPanel/UnitClassIconLarge.prefab @@ -67,7 +67,7 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3} - m_FontSize: 34 + m_FontSize: 24 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 1 @@ -131,7 +131,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 10, y: 0} - m_SizeDelta: {x: 77, y: 53} + m_SizeDelta: {x: 53, y: 53} m_Pivot: {x: 0, y: 1} --- !u!222 &6815987390155653558 CanvasRenderer: diff --git a/Assets/GWConquest/Scenes/GalaxyMap.unity b/Assets/GWConquest/Scenes/GalaxyMap.unity index 4f471b8..da6137c 100644 --- a/Assets/GWConquest/Scenes/GalaxyMap.unity +++ b/Assets/GWConquest/Scenes/GalaxyMap.unity @@ -16587,10 +16587,10 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3} - m_FontSize: 30 + m_FontSize: 24 m_FontStyle: 0 m_BestFit: 0 - m_MinSize: 3 + m_MinSize: 2 m_MaxSize: 69 m_Alignment: 1 m_AlignByGeometry: 0 @@ -20568,7 +20568,7 @@ MonoBehaviour: m_TargetGraphic: {fileID: 71338309} m_HandleRect: {fileID: 71338308} m_Direction: 2 - m_Value: 1 + m_Value: 0 m_Size: 1 m_NumberOfSteps: 0 m_OnValueChanged: @@ -41942,6 +41942,154 @@ Transform: type: 3} m_PrefabInstance: {fileID: 691306218} m_PrefabAsset: {fileID: 0} +--- !u!1 &692008056 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 692008057} + - component: {fileID: 692008061} + - component: {fileID: 692008060} + - component: {fileID: 692008059} + - component: {fileID: 692008058} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &692008057 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 692008056} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1420890672} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 0, y: 30.34} + m_SizeDelta: {x: 199.47, y: 30.675964} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &692008058 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 692008056} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 692008060} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1590972559} + m_MethodName: OpenTransportUI + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &692008059 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 692008056} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 342dd2fd557feed438ce05e1625dee09, type: 3} + m_Name: + m_EditorClassIdentifier: + smoothTime: 0.1 + scaleFactor: 1.05 +--- !u!114 &692008060 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 692008056} + 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: 0.936, g: 0.936, b: 0.936, a: 1} + m_RaycastTarget: 1 + 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: 1 + m_MaxSize: 40 + m_Alignment: 7 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Open Logistics Menu +--- !u!222 &692008061 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 692008056} + m_CullTransparentMesh: 0 --- !u!1 &692392196 GameObject: m_ObjectHideFlags: 0 @@ -71200,10 +71348,10 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3} - m_FontSize: 30 + m_FontSize: 24 m_FontStyle: 0 m_BestFit: 0 - m_MinSize: 3 + m_MinSize: 2 m_MaxSize: 69 m_Alignment: 1 m_AlignByGeometry: 0 @@ -127477,7 +127625,7 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3} - m_FontSize: 47 + m_FontSize: 43 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 3 @@ -130450,7 +130598,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: -0.000030517578} - m_SizeDelta: {x: 0, y: 168} + m_SizeDelta: {x: 0, y: 209} m_Pivot: {x: 0, y: 1} --- !u!114 &2089647853 MonoBehaviour: @@ -134394,6 +134542,11 @@ PrefabInstance: propertyPath: m_Name value: GarrisonPanel objectReference: {fileID: 0} + - target: {fileID: 5411513710314136447, guid: f8bffe0306e53cb4b958afe65a7c7b2c, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 7616586528241184281, guid: f8bffe0306e53cb4b958afe65a7c7b2c, type: 3} propertyPath: m_IsActive diff --git a/Assets/GWConquest/Scripts/UI/DistrictUI.cs b/Assets/GWConquest/Scripts/UI/DistrictUI.cs index 21f3772..e1f355d 100644 --- a/Assets/GWConquest/Scripts/UI/DistrictUI.cs +++ b/Assets/GWConquest/Scripts/UI/DistrictUI.cs @@ -48,7 +48,7 @@ namespace GWConquest { if(district != null) { - GarrisonUI.Rebuild(); + //GarrisonUI.Rebuild(); } } diff --git a/Assets/GWConquest/Scripts/UI/GarrisonArmyGroupUI.cs b/Assets/GWConquest/Scripts/UI/GarrisonArmyGroupUI.cs deleted file mode 100644 index b5bfbf6..0000000 --- a/Assets/GWConquest/Scripts/UI/GarrisonArmyGroupUI.cs +++ /dev/null @@ -1,186 +0,0 @@ -using System.Linq; -using UnityEngine; -using UnityEngine.UI; - -namespace GWConquest -{ - public class GarrisonArmyGroupUI : DragDropElement - { - public RectTransform ArrowTransform; - - public GameObject ButtonsSmall; - public GameObject ButtonsLarge; - - public GameObject Corners; - - public GameObject RelocatePanel; - public GameObject RelocateEntryPrefab; - public float RelocateEntryOffset; - - public GameObject MovingIcon; - - private Formation formation; - private bool relocatePanelShowing; - private float relocateEntryHeight; - - private bool isSelected; - - private GarrisonUI garrisonUI; - - public void Init(Formation f) - { - garrisonUI = GetComponentInParent(); - formation = f; - if (formation.IsExpandedInMenu) - { - ArrowTransform.localEulerAngles = Vector3.zero; - } - else - { - ArrowTransform.localEulerAngles = new Vector3(0f, 0f, 90f); - } - - relocateEntryHeight = RelocateEntryPrefab.GetComponent().rect.height; - } - - public void ToggleExpand() - { - BoltLog.Info("Toggling expand"); - formation.IsExpandedInMenu = !formation.IsExpandedInMenu; - if (formation.IsExpandedInMenu) - { - ArrowTransform.localEulerAngles = Vector3.zero; - } - else - { - ArrowTransform.localEulerAngles = new Vector3(0f, 0f, 90f); - } - GetComponentInParent().Rebuild(); - } - - public void SetSelected(bool sel) - { - isSelected = sel; - UpdateButtons(); - } - - public void UpdateButtons() - { - if (isSelected) - { - Corners.SetActive(true); - ButtonsSmall.SetActive(true); - ButtonsLarge.SetActive(formation.IsExpandedInMenu); - } - else - { - Corners.SetActive(false); - ButtonsSmall.SetActive(false); - ButtonsLarge.SetActive(false); - RelocatePanel.SetActive(false); - } - } - - public void SelectFormation() - { - garrisonUI.SelectFormation(formation, null); - } - - public void ToggleRelocatePanel() - { - relocatePanelShowing = !relocatePanelShowing; - RelocatePanel.SetActive(relocatePanelShowing); - ButtonsLarge.SetActive(!relocatePanelShowing && formation.IsExpandedInMenu); - Corners.SetActive(!relocatePanelShowing); - - garrisonUI.ToggleRelocatePanel(relocatePanelShowing, formation); - - if (relocatePanelShowing) - { - foreach (var e in RelocatePanel.GetComponentsInChildren()) - { - Destroy(e.gameObject); - } - - var relocatePanelRT = RelocatePanel.GetComponent(); - - if (formation.currentZone != null) - { - var pathfinding = formation.currentZone.planet.pathfindingGraph; - var allPaths = pathfinding.FindAllPaths(formation, formation.currentZone); - - var zones = allPaths.Keys; - - float entryY = RelocateEntryOffset; - - foreach (Zone z in zones) - { - Debug.LogFormat("Path to zone {0}: {1}", z, allPaths[z]); - - var entryGO = Instantiate(RelocateEntryPrefab); - var entryRT = entryGO.GetComponent(); - entryRT.SetParent(relocatePanelRT); - entryRT.anchoredPosition = new Vector2(0, -entryY); - entryRT.sizeDelta = new Vector2(0, relocateEntryHeight); - entryRT.rotation = Quaternion.identity; - entryRT.localScale = Vector3.one; - - var entryUI = entryRT.GetComponent(); - entryUI.Init(z); - - entryY += relocateEntryHeight; - } - - Vector2 relocatePanelSize = relocatePanelRT.sizeDelta; - relocatePanelSize.y = entryY; - relocatePanelRT.sizeDelta = relocatePanelSize; - } - } - } - - public void RelocateFormation(Zone z) - { - garrisonUI.Deselect(); - //formation.MoveToZone(z, GameManager.Instance.GroundTransitionLengthFactor); - var pathfinding = formation.currentZone.planet.pathfindingGraph; - var shortestPath = pathfinding.FindShortestPath(formation, formation.currentZone, z); - if(shortestPath != null) - { - formation.StartMovingOnPath(shortestPath.zones); - } - - } - - public override void OnDragBegin() - { - foreach(Graphic g in GetComponentsInChildren()) - { - g.enabled = false; - } - MovingIcon.SetActive(true); - Vector3 mousePos = Input.mousePosition; - MovingIcon.GetComponent().position = mousePos; - } - - public override bool OnDragFinished() - { - foreach(DistrictIcon di in FindObjectsOfType()) - { - RectTransform diRT = di.GetComponent(); - Vector3 mousePos = Input.mousePosition; - if(RectTransformUtility.RectangleContainsScreenPoint(diRT, mousePos)) - { - RelocateFormation(di.district.Zone); - break; - } - } - - MovingIcon.SetActive(false); - foreach (Graphic g in GetComponentsInChildren()) - { - g.enabled = true; - } - return true; - } - } -} \ No newline at end of file diff --git a/Assets/GWConquest/Scripts/UI/GarrisonArmyGroupUI.cs.meta b/Assets/GWConquest/Scripts/UI/GarrisonArmyGroupUI.cs.meta deleted file mode 100644 index 64fec8a..0000000 --- a/Assets/GWConquest/Scripts/UI/GarrisonArmyGroupUI.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e7bf2d966c11fc24290820bb140379d5 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/GWConquest/Scripts/UI/GarrisonUI.cs b/Assets/GWConquest/Scripts/UI/GarrisonUI.cs index 03c0937..645b5c0 100644 --- a/Assets/GWConquest/Scripts/UI/GarrisonUI.cs +++ b/Assets/GWConquest/Scripts/UI/GarrisonUI.cs @@ -7,220 +7,92 @@ namespace GWConquest { public class GarrisonUI : MonoBehaviour { - public RectTransform Content; - public float IconOffset; - public float ArmyGroupOffset; - public float ArmyGroupOffsetX; + public RectTransform ContentTransform; - public GameObject ArmyGroupPrefab; - public GameObject UnitIconPrefab; + public GameObject ElementPrefab; - public Color GreyedOutColor; + [System.NonSerialized] + public List SubElementList = new List(); - private Zone zone; + private Zone CurrentZone; - private Dictionary ArmyGroupMap = new Dictionary(); - private Dictionary UnitIconMap = new Dictionary(); - - private float unitWidth; + public void Init(Zone z) + { + CurrentZone = z; - private Formation selectedFormation; - private IIconObject selectedUnit; + RebuildPanel(); + FixedUpdate(); + } - public class UnitMapEntry + public void Update() { - public RectTransform unitRT; - public int indexX; - public int indexY; + GWLayout.UpdateLayout(ContentTransform); } - public void Init(Zone _zone) + public void RebuildPanel() { - zone = _zone; - selectedFormation = null; - selectedUnit = null; - - unitWidth = UnitIconPrefab.GetComponent().rect.width; - - Rebuild(); + Util.DestroyAllChildren(ContentTransform); + SubElementList.Clear(); } - public void Populate() + public void FixedUpdate() { - var formations = zone.Formations.Where(f => f.Player == Player.CurrentPlayer); - float armyGroupY = ArmyGroupOffset; - - foreach(Formation f in formations) - { - GameObject armyGroupGO = Instantiate(ArmyGroupPrefab); - RectTransform armyGroupRT = armyGroupGO.GetComponent(); - armyGroupRT.SetParent(Content); - armyGroupRT.anchoredPosition = new Vector2(0, -armyGroupY); - armyGroupRT.localRotation = Quaternion.identity; - armyGroupRT.localScale = Vector3.one; - - ArmyGroupMap[f] = armyGroupRT; + var objects = CurrentZone.Formations.Where(f => f.Player == Player.CurrentPlayer && f.ZoneType == CurrentZone.zoneType).Cast(); + + GWLayout.UpdateGameObjects(SubElementList, objects.ToList(), obj => { + var elementComp = AddElement(ContentTransform); - Text armyGroupTitle = armyGroupGO.GetComponentInChildren(); - armyGroupTitle.text = f.FormationName; - - var armyGroupUI = armyGroupGO.GetComponent(); - armyGroupUI.Init(f); - - float rowY = armyGroupTitle.GetComponent().rect.height; - - if (f.IsExpandedInMenu) + if(obj is District) { - - float armyGroupWidth = Content.rect.width - ArmyGroupOffsetX; - - var icons = new List(); - icons.AddRange(f.Units); - //icons.AddRange(f.AllItems); - - int unitsPerRow = Mathf.FloorToInt(armyGroupWidth / (unitWidth + IconOffset)); - int rowCount = Mathf.CeilToInt((float)icons.Count / unitsPerRow); - - Debug.LogFormat("Unit count: {0}, Units per row: {1}, Row count: {2} Army Group Rect: {3}", icons.Count, unitsPerRow, rowCount, armyGroupWidth); - - for (int i = 0; i < rowCount; i++) - { - - int maxInd = Mathf.Min(icons.Count - i * unitsPerRow, unitsPerRow); - float iconX = IconOffset; - - for (int j = 0; j < maxInd; j++) - { - IIconObject u = icons[j + i * unitsPerRow]; - - GameObject unitGO = Instantiate(UnitIconPrefab); - RectTransform unitRT = unitGO.GetComponent(); - unitRT.SetParent(armyGroupRT); - unitRT.anchoredPosition = new Vector2(iconX, -rowY); - unitRT.localRotation = Quaternion.identity; - unitRT.localScale = Vector3.one; - - unitGO.GetComponentInChildren().sprite = u.Icon; - - unitGO.GetComponent