Browse Source

Formation Icons for Districts, Fixes

master
laurids 2 years ago
parent
commit
204f6ef582
8 changed files with 573 additions and 121 deletions
  1. +149
    -64
      Assets/GWConquest/Animations/FleetIcon.controller
  2. +260
    -0
      Assets/GWConquest/Prefabs/UI/DistrictIcon.prefab
  3. +75
    -40
      Assets/GWConquest/Scripts/Formation.cs
  4. +11
    -1
      Assets/GWConquest/Scripts/Planet.cs
  5. +35
    -2
      Assets/GWConquest/Scripts/UI/DistrictIcon.cs
  6. +42
    -12
      Assets/GWConquest/Scripts/UI/FormationIcon.cs
  7. +0
    -1
      Assets/GWConquest/Scripts/UI/PlanetIndicatorUI.cs
  8. +1
    -1
      Assets/GWConquest/Scripts/UI/StickToFormation.cs

+ 149
- 64
Assets/GWConquest/Animations/FleetIcon.controller View File

@ -1,30 +1,5 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1101 &-9134304281230999749
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: Small
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -7549341647043909749}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-7549341647043909749
AnimatorState:
serializedVersion: 6
@ -37,7 +12,6 @@ AnimatorState:
m_CycleOffset: 0
m_Transitions:
- {fileID: 432087809510585664}
- {fileID: 5792764332646239327}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
@ -53,6 +27,31 @@ AnimatorState:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &-5092324987875389103
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: Small
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -1138101577836653692}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1107 &-4945115439738441631
AnimatorStateMachine:
serializedVersion: 6
@ -67,10 +66,7 @@ AnimatorStateMachine:
m_Position: {x: 380, y: -40, z: 0}
- serializedVersion: 1
m_State: {fileID: -7549341647043909749}
m_Position: {x: 380, y: 100, z: 0}
- serializedVersion: 1
m_State: {fileID: 9198265562621750234}
m_Position: {x: 380, y: 240, z: 0}
m_Position: {x: 390, y: 100, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
@ -81,6 +77,33 @@ AnimatorStateMachine:
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -7549341647043909749}
--- !u!1102 &-1138101577836653692
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: New State
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 4044931645689831722}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 0}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
@ -95,13 +118,13 @@ AnimatorController:
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
- m_Name: Small
m_Type: 4
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
@ -111,7 +134,19 @@ AnimatorController:
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_DefaultWeight: 1
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
- serializedVersion: 5
m_Name: Small Layer
m_StateMachine: {fileID: 4176715154956997435}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 1
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
@ -140,7 +175,7 @@ AnimatorStateTransition:
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &1716441036608713572
--- !u!1101 &1335262404698826941
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
@ -149,7 +184,7 @@ AnimatorStateTransition:
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: Cooldown
m_ConditionEvent: Small
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -7549341647043909749}
@ -159,40 +194,38 @@ AnimatorStateTransition:
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.9166667
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &5455739953621634429
AnimatorState:
serializedVersion: 6
--- !u!1101 &1716441036608713572
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: FormationIconCooldown
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 1716441036608713572}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: c76c05908b5b595469de539a4d604e57, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &5792764332646239327
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: Cooldown
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -7549341647043909749}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.9166667
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &4044931645689831722
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
@ -204,20 +237,45 @@ AnimatorStateTransition:
m_ConditionEvent: Small
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 9198265562621750234}
m_DstState: {fileID: 4463222673447704654}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.5
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &9198265562621750234
--- !u!1107 &4176715154956997435
AnimatorStateMachine:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Small Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 4463222673447704654}
m_Position: {x: 370, y: 20, z: 0}
- serializedVersion: 1
m_State: {fileID: -1138101577836653692}
m_Position: {x: 330, y: 150, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -1138101577836653692}
--- !u!1102 &4463222673447704654
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
@ -228,7 +286,7 @@ AnimatorState:
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: -9134304281230999749}
- {fileID: -5092324987875389103}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
@ -244,3 +302,30 @@ AnimatorState:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &5455739953621634429
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: FormationIconCooldown
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 1716441036608713572}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: c76c05908b5b595469de539a4d604e57, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:

+ 260
- 0
Assets/GWConquest/Prefabs/UI/DistrictIcon.prefab View File

@ -75,6 +75,41 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &912138683181057275
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7732175615502777310}
m_Layer: 0
m_Name: EnemyPoint1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7732175615502777310
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 912138683181057275}
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: 8837000425762888635}
m_RootOrder: 3
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: 59.2, y: 18.6}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1315769791052656276
GameObject:
m_ObjectHideFlags: 0
@ -150,6 +185,76 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &1500748053091594896
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 737088092558660365}
m_Layer: 0
m_Name: PlayerPoint3
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &737088092558660365
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1500748053091594896}
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: 8837000425762888635}
m_RootOrder: 2
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: -77.8, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1873063369351356139
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2832928536144002898}
m_Layer: 0
m_Name: PlayerPoint2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2832928536144002898
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1873063369351356139}
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: 8837000425762888635}
m_RootOrder: 1
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: -59.2, y: -18.6}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &2319728517661333030
GameObject:
m_ObjectHideFlags: 0
@ -927,6 +1032,7 @@ RectTransform:
- {fileID: 2621911207336838695}
- {fileID: 6698525327820101171}
- {fileID: 3591757799697619954}
- {fileID: 8837000425762888635}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -957,6 +1063,14 @@ MonoBehaviour:
BattleIcon: {fileID: 5980683245453820297}
FactionLogo: {fileID: 7396948212335766816}
FactionLogoGO: {fileID: 5773017720448351161}
PlayerFleetPoints:
- {fileID: 3291331238021767455}
- {fileID: 2832928536144002898}
- {fileID: 737088092558660365}
EnemyFleetPoints:
- {fileID: 7732175615502777310}
- {fileID: 3649531905154520175}
- {fileID: 2367613139329943555}
--- !u!114 &1344012077935187005
MonoBehaviour:
m_ObjectHideFlags: 0
@ -1318,6 +1432,41 @@ MonoBehaviour:
baked: 0
modifiedFromInspector: 0
bakedShadows: []
--- !u!1 &3182485215948763977
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2367613139329943555}
m_Layer: 0
m_Name: EnemyPoint3
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2367613139329943555
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3182485215948763977}
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: 8837000425762888635}
m_RootOrder: 5
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: 77.8, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &3236815388754272088
GameObject:
m_ObjectHideFlags: 0
@ -1468,6 +1617,41 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &3319193315921325081
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3649531905154520175}
m_Layer: 0
m_Name: EnemyPoint2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3649531905154520175
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3319193315921325081}
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: 8837000425762888635}
m_RootOrder: 4
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: 59.2, y: -18.6}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &3875231843501954846
GameObject:
m_ObjectHideFlags: 0
@ -1618,6 +1802,47 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &4210250642177840842
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8837000425762888635}
m_Layer: 0
m_Name: FleetIconPoints
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8837000425762888635
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4210250642177840842}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 3291331238021767455}
- {fileID: 2832928536144002898}
- {fileID: 737088092558660365}
- {fileID: 7732175615502777310}
- {fileID: 3649531905154520175}
- {fileID: 2367613139329943555}
m_Father: {fileID: 2621911208907321623}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &4444822104361386639
GameObject:
m_ObjectHideFlags: 0
@ -1768,6 +1993,41 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &5561541809886656294
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3291331238021767455}
m_Layer: 0
m_Name: PlayerPoint1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3291331238021767455
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5561541809886656294}
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: 8837000425762888635}
m_RootOrder: 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: -59.2, y: 18.6}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &5773017720448351161
GameObject:
m_ObjectHideFlags: 0


+ 75
- 40
Assets/GWConquest/Scripts/Formation.cs View File

@ -187,6 +187,21 @@ namespace GWConquest
get => MovementState == FormationMovementState.Idle;
}
public Planet CurrentPlanet {
get {
var z = currentZone;
if(z != null)
{
return z.planet;
}
else if(State.CurrentTransition.OriginZone != -1)
{
return Zone.GetFromId(State.CurrentTransition.OriginZone).planet;
}
else return null;
}
}
public IInventory FormationInventory;
public void TryMoveToPlanet(Planet planet)
@ -195,16 +210,22 @@ namespace GWConquest
{
var targetZone = planet.GetMainZone(ZoneType.Space);
var shortestPath = Planet.PlanetPathfindingGraph.FindShortestPath(this, currentZone, targetZone);
TryMoveToZone(targetZone);
}
}
if(shortestPath != null)
{
StartMovingOnPath(shortestPath.zones);
}
else
{
BoltLog.Warn("No path found between {0} and {1}", currentZone.planet, planet);
}
public void TryMoveToZone(Zone targetZone)
{
var pathfindingGraph = targetZone.zoneType == ZoneType.Space ? Planet.PlanetPathfindingGraph : targetZone.planet.pathfindingGraph;
var shortestPath = pathfindingGraph.FindShortestPath(this, currentZone, targetZone);
if(shortestPath != null)
{
StartMovingOnPath(shortestPath.zones);
}
else
{
BoltLog.Warn("No path found between {0} and {1}", currentZone, targetZone);
}
}
@ -338,7 +359,7 @@ namespace GWConquest
var iconComp = movingArmyIcon.GetComponent<FormationIcon>();
iconComp.Arrow.gameObject.SetActive(true);
iconComp.UpdateDisplay(this);
iconComp.CanBeDragged = ZoneType == ZoneType.Space;
//iconComp.CanBeDragged = ZoneType == ZoneType.Space;
var stick = movingArmyIcon.AddComponent<StickToFormation>();
stick.formation = this;
@ -352,16 +373,15 @@ namespace GWConquest
var originZone = Zone.GetFromId(State.CurrentTransition.OriginZone);
var targetZone = Zone.GetFromId(State.CurrentTransition.TargetZone);
if(State.CurrentTransition.IsCurved) {
MakeMovingIcon(IngameUI.Instance.PlanetView.DistrictIcons);
if(IsOnSpaceGroundTransition && IngameUI.PlanetViewEnabled)
if (State.CurrentTransition.IsCurved)
{
if (IsOnSpaceGroundTransition && IngameUI.PlanetViewEnabled)
{
IngameUI.Instance.PlanetView.SpawnLandingLine(this);
}
} else {
//MakeMovingIcon(IngameUI.Instance.MovingFleetsTransform);
}
else
{
arrivalPosition = targetZone.planet.GetFleetArrivalPosition(originZone);
}
@ -373,22 +393,13 @@ namespace GWConquest
}
else
{
if(currentZone.zoneType == ZoneType.Ground && movingArmyIcon != null)
{
Destroy(movingArmyIcon);
movingArmyIcon = null;
}
var planet = currentZone.planet;
if(planet.InTransitFormations.Contains(this))
{
planet.InTransitFormations.Remove(this);
}
}
}
public override void SimulateOwner()
@ -518,9 +529,15 @@ namespace GWConquest
{
if (GameManager.EntitiesLoaded)
{
if (currentZone != null && currentZone.zoneType == ZoneType.Space && movingArmyIcon == null)
if (currentZone != null && movingArmyIcon == null)
{
MakeMovingIcon(IngameUI.Instance.MovingFleetsTransform);
if(currentZone.zoneType == ZoneType.Space)
{
MakeMovingIcon(IngameUI.Instance.MovingFleetsTransform);
}
else {
MakeMovingIcon(IngameUI.Instance.PlanetView.DistrictIcons);
}
}
}
//Debug.LogFormat("Current state: IsInTransit {0}; CurrentZone {1}; CoveredDistance {2}", State.IsInTransit, State.CurrentZone, CoveredDistance);
@ -608,23 +625,41 @@ namespace GWConquest
}
}
if (movingArmyIcon != null && ZoneType == ZoneType.Space)
if (movingArmyIcon != null)
{
if (!IngameUI.PlanetViewEnabled)
if(ZoneType == ZoneType.Space)
{
if(GWCamera.Instance.ShowCircles || MovementState == FormationMovementState.Moving)
if (!IngameUI.PlanetViewEnabled)
{
movingArmyIcon.SetActive(true);
movingArmyIcon.GetComponent<Animator>().SetBool("Small", false);
var stick = movingArmyIcon.GetComponent<StickToFormation>();
stick.overridePoint = null;
stick.Update();
}
if(GWCamera.Instance.ShowCircles || MovementState == FormationMovementState.Moving)
{
movingArmyIcon.SetActive(true);
var stick = movingArmyIcon.GetComponent<StickToFormation>();
stick.overridePoint = null;
stick.Update();
}
}
else
{
movingArmyIcon.SetActive(false);
}
}
else
{
movingArmyIcon.SetActive(false);
else {
if(IngameUI.PlanetViewEnabled && IngameUI.Instance.PlanetView.selectedPlanet == CurrentPlanet)
{
if(MovementState == FormationMovementState.Moving)
{
//movingArmyIcon.SetActive(true);
var stick = movingArmyIcon.GetComponent<StickToFormation>();
stick.overridePoint = null;
stick.Update();
}
}
else
{
movingArmyIcon.SetActive(false);
}
}
}
}


+ 11
- 1
Assets/GWConquest/Scripts/Planet.cs View File

@ -396,8 +396,18 @@ namespace GWConquest
{
foreach(var planet in Planet.AllPlanets)
{
planet.VisibilityStatus = planet.GetVisibilityStatus(Player.CurrentPlayer);
var status = planet.GetVisibilityStatus(Player.CurrentPlayer);
if(status != planet.VisibilityStatus)
{
planet.VisibilityStatus = status;
if (planet.indicatorUI != null)
{
planet.indicatorUI.UpdateIndicator();
}
}
planet.UpdatePlanetRenderer();
}
foreach(var conn in FindObjectsOfType<PlanetConnection>())


+ 35
- 2
Assets/GWConquest/Scripts/UI/DistrictIcon.cs View File

@ -23,6 +23,9 @@ namespace GWConquest
public Image FactionLogo;
public GameObject FactionLogoGO;
public RectTransform[] PlayerFleetPoints;
public RectTransform[] EnemyFleetPoints;
public District district { get; private set; }
private bool isSelected = false;
@ -65,8 +68,10 @@ namespace GWConquest
public void UpdateIndicator(bool isPlanetContested)
{
IEnumerable<Formation> formations = district.Zone.Formations;
float playerStrength = formations.Sum(f => f.Player == Player.CurrentPlayer ? f.GetFormationStrength() : 0f);
float enemyStrength = formations.Sum(f => f.Player != Player.CurrentPlayer ? f.GetFormationStrength() : 0f);
var playerFormations = formations.Where(f => f.Player == Player.CurrentPlayer).ToList();
float playerStrength = playerFormations.Sum(f => f.GetFormationStrength());
var enemyFormations = formations.Where(f => f.Player != Player.CurrentPlayer).ToList();
float enemyStrength = enemyFormations.Sum(f => f.GetFormationStrength());
if(playerStrength > 0f)
{
@ -106,6 +111,9 @@ namespace GWConquest
FactionLogoGO.SetActive(false);
//nameText.color = Util.UpdateColorRGB(nameText.color, Color.white);
}
UpdateFormationIcons(playerFormations, PlayerFleetPoints);
UpdateFormationIcons(enemyFormations, EnemyFleetPoints);
@ -138,5 +146,30 @@ namespace GWConquest
GetComponentInParent<PlanetViewUI>().ShowBattleUI(district.Zone.CurrentBattle);
}
}
private void UpdateFormationIcons(List<Formation> formations, RectTransform[] points)
{
if(formations.Count > 0)
{
formations.Sort((f1, f2) => f1.FormationNumber - f2.FormationNumber);
for(int i = 0; i < formations.Count; i++)
{
var icon = formations[i].movingArmyIcon;
if(icon != null)
{
if(i < points.Length)
{
icon.SetActive(true);
var stick = icon.GetComponent<StickToFormation>();
stick.overridePoint = points[i];
stick.Update();
}
else {
icon.SetActive(false);
}
}
}
}
}
}
}

+ 42
- 12
Assets/GWConquest/Scripts/UI/FormationIcon.cs View File

@ -63,9 +63,22 @@ namespace GWConquest {
var color = f.Player.Faction.FactionColor;
SetColor(color);
}
}
public override void Update()
{
base.Update();
if(CurrentFormation != null)
{
var anim = GetComponent<Animator>();
if(CurrentFormation.ActionCooldown > 0)
{
GetComponent<Animator>().SetBool("Cooldown", true);
anim.SetBool("Cooldown", true);
CooldownCircle.fillAmount = CurrentFormation.ActionCooldownPercent;
if(CurrentFormation.MovementState == FormationMovementState.PreparingMovement)
{
@ -77,25 +90,42 @@ namespace GWConquest {
}
}
else {
GetComponent<Animator>().SetBool("Cooldown", false);
anim.SetBool("Cooldown", false);
}
bool isSmall = CurrentFormation.MovementState != FormationMovementState.Moving && (CurrentFormation.ZoneType == ZoneType.Space ? !GWCamera.Instance.ShowCircles : true);
anim.SetBool("Small", isSmall);
}
}
public override bool OnDragFinished()
{
PhysicsRaycaster pr = FindObjectOfType<PhysicsRaycaster>();
List<RaycastResult> list = pr.RaycastFromMousePosition();
foreach (RaycastResult result in list)
if(CurrentFormation.ZoneType == ZoneType.Space)
{
Planet planet = result.gameObject.GetComponentInParent<Planet>();
if (planet != null)
PhysicsRaycaster pr = FindObjectOfType<PhysicsRaycaster>();
List<RaycastResult> list = pr.RaycastFromMousePosition();
foreach (RaycastResult result in list)
{
Planet planet = result.gameObject.GetComponentInParent<Planet>();
if (planet != null)
{
CurrentFormation.TryMoveToPlanet(planet);
BoltLog.Info("Moving formation {0} to planet {1}", CurrentFormation.name, planet.name);
break;
}
}
}
else {
var mousePos = Input.mousePosition;
foreach(DistrictIcon di in FindObjectsOfType<DistrictIcon>())
{
CurrentFormation.TryMoveToPlanet(planet);
BoltLog.Info("Moving formation {0} to planet {1}", CurrentFormation.name, planet.name);
break;
if (RectTransformUtility.RectangleContainsScreenPoint(di.GetComponent<RectTransform>(), mousePos))
{
CurrentFormation.TryMoveToZone(di.district.Zone);
BoltLog.Info("Moving formation {0} to zone {1}", CurrentFormation.name, di.district.Zone);
break;
}
}
}


+ 0
- 1
Assets/GWConquest/Scripts/UI/PlanetIndicatorUI.cs View File

@ -141,7 +141,6 @@ namespace GWConquest
var stick = icon.GetComponent<StickToFormation>();
stick.overridePoint = points[i];
stick.Update();
icon.GetComponent<Animator>().SetBool("Small", true);
}
else {
icon.SetActive(false);


+ 1
- 1
Assets/GWConquest/Scripts/UI/StickToFormation.cs View File

@ -20,7 +20,7 @@ namespace GWConquest
}
else {
Vector3 dir;
if(formation.State.CurrentTransition.IsCurved)
if(formation.MovementState == FormationMovementState.Moving && formation.State.CurrentTransition.IsCurved)
{
var originZone = Zone.GetFromId(formation.State.CurrentTransition.OriginZone);
var targetZone = Zone.GetFromId(formation.State.CurrentTransition.TargetZone);


Loading…
Cancel
Save