Browse Source

UI: Unit Type Icons, other changes

bolt_update
laurids 3 years ago
parent
commit
9972217619
12 changed files with 611 additions and 243 deletions
  1. +151
    -41
      Assets/GWConquest/Prefabs/UI/BattleFormationUI.prefab
  2. +72
    -194
      Assets/GWConquest/Prefabs/UI/UnitInfoPanel/InfoPanel.prefab
  3. +250
    -0
      Assets/GWConquest/Prefabs/UI/UnitInfoPanel/UnitClassIcon.prefab
  4. +7
    -0
      Assets/GWConquest/Prefabs/UI/UnitInfoPanel/UnitClassIcon.prefab.meta
  5. +2
    -2
      Assets/GWConquest/Scenes/GalaxyMap.unity
  6. +2
    -2
      Assets/GWConquest/Scripts/Inventory.cs
  7. +29
    -1
      Assets/GWConquest/Scripts/UI/BattleArmyPanel.cs
  8. +18
    -0
      Assets/GWConquest/Scripts/UI/BattleFormationUI.cs
  9. +5
    -3
      Assets/GWConquest/Scripts/UI/FleetIconsUI.cs
  10. +31
    -0
      Assets/GWConquest/Scripts/UI/TransportUIUnitClassIcon.cs
  11. +11
    -0
      Assets/GWConquest/Scripts/UI/TransportUIUnitClassIcon.cs.meta
  12. +33
    -0
      Assets/GWConquest/Scripts/UI/UnitInfoPanel.cs

+ 151
- 41
Assets/GWConquest/Prefabs/UI/BattleFormationUI.prefab View File

@ -108,6 +108,7 @@ GameObject:
- component: {fileID: 1816981237351840950}
- component: {fileID: 1816981237351840948}
- component: {fileID: 1816981237351840951}
- component: {fileID: 8296412675757451049}
m_Layer: 5
m_Name: FormationName
m_TagString: Untagged
@ -175,6 +176,60 @@ MonoBehaviour:
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 1st Infantry Company
--- !u!114 &8296412675757451049
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1816981237351840945}
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: 1816981237351840951}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 7354699431146738932}
m_MethodName: OnNameClicked
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 &3767539619589676639
GameObject:
m_ObjectHideFlags: 0
@ -186,6 +241,7 @@ GameObject:
- component: {fileID: 6261843216987770138}
- component: {fileID: 6408366436070953654}
- component: {fileID: 8558640586982011803}
- component: {fileID: 5368622425246189868}
m_Layer: 5
m_Name: LeaderName
m_TagString: Untagged
@ -255,6 +311,60 @@ MonoBehaviour:
m_Text: '
'
--- !u!114 &5368622425246189868
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3767539619589676639}
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: 1816981237351840951}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 7354699431146738932}
m_MethodName: OnNameClicked
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!1001 &1034474529041651908
PrefabInstance:
m_ObjectHideFlags: 0
@ -269,108 +379,108 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_LocalPosition.x
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
propertyPath: m_Pivot.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_LocalPosition.z
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_LocalRotation.w
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_RootOrder
value: 0
propertyPath: m_SizeDelta.x
value: 100
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
propertyPath: m_SizeDelta.y
value: 100
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 7
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -8.400024
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_SizeDelta.x
value: 100
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_SizeDelta.y
value: 100
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
propertyPath: m_AnchoredPosition.x
value: 7
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
propertyPath: m_AnchoredPosition.y
value: -8.400024
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_Pivot.x
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1687732570946376589, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_Pivot.y
value: 1
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1687732571317619598, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
@ -387,17 +497,17 @@ PrefabInstance:
propertyPath: m_LocalScale.z
value: 1.0848497
objectReference: {fileID: 0}
- target: {fileID: 1687732571317619599, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1687732571317619599, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: 43c0c67fc0299df49ad542b1d669f483,
type: 3}
- target: {fileID: 1687732571317619599, guid: 70bba337c1bb2d64e83a214cd4a781ea,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 70bba337c1bb2d64e83a214cd4a781ea, type: 3}
--- !u!224 &1816981236274039625 stripped


+ 72
- 194
Assets/GWConquest/Prefabs/UI/UnitInfoPanel/InfoPanel.prefab View File

@ -4258,6 +4258,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1050217559578958967}
- component: {fileID: 2964497906568799060}
m_Layer: 5
m_Name: UnitCategories
m_TagString: Untagged
@ -4275,8 +4276,7 @@ RectTransform:
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: 4314428225394243898}
m_Children: []
m_Father: {fileID: 6958907541033482034}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -4285,6 +4285,24 @@ RectTransform:
m_AnchoredPosition: {x: 10, y: -34.5}
m_SizeDelta: {x: -30.38153, y: 37.5903}
m_Pivot: {x: 0, y: 0.5}
--- !u!114 &2964497906568799060
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1544424990729083085}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 048208b8918c3c74c821e2e69e3d613d, type: 3}
m_Name:
m_EditorClassIdentifier:
padding:
m_Left: 5
m_Right: 0
m_Top: 0
m_Bottom: 0
Spacing: {x: 10, y: 0}
--- !u!1 &2782739829439052396
GameObject:
m_ObjectHideFlags: 0
@ -5018,7 +5036,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &8922285020600295675
RectTransform:
m_ObjectHideFlags: 0
@ -6016,6 +6034,57 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &2066680301
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7228160732243375218}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3a89474e48880e44f97abfc6ce7be3fe, type: 3}
m_Name:
m_EditorClassIdentifier:
UnitNameText: {fileID: 976787391}
HealthBar: {fileID: 487272288}
HealthBarText: {fileID: 645723849}
DescriptionText: {fileID: 135006939}
UnitObjects: {fileID: 4617211388595578265}
StatusIconsTransform: {fileID: 1815122357}
ValueIconsTransform: {fileID: 970845490}
ValueIconPrefab: {fileID: 7541130419680964748, guid: 12f3a6f1f9c4a274883c016ebe2c9065,
type: 3}
ArmourIcons:
- {fileID: 21300000, guid: 0b13dc47c66b6c047b03e6513329837e, type: 3}
- {fileID: 21300000, guid: 685672c57176a604a95274687c9ecfcc, type: 3}
- {fileID: 21300000, guid: 2bfef1999cd2b714fba492ffd49eb356, type: 3}
- {fileID: 21300000, guid: da1431e4cb9d6804b823138d89fde4aa, type: 3}
- {fileID: 21300000, guid: 297684482aee75f469757daac209c5ad, type: 3}
PenetrationIcons:
- {fileID: 21300000, guid: f62ed88bae1f639428ebfcddaca2c014, type: 3}
- {fileID: 21300000, guid: c91c72ec4cff3a64d9d1c49971beb264, type: 3}
- {fileID: 21300000, guid: 82bc7d230a0995f46999e2b660a8783b, type: 3}
- {fileID: 21300000, guid: dc0c84a296b0e314384831fe84f85b0e, type: 3}
- {fileID: 21300000, guid: b1c8856dce75f6247813e65f74deb16b, type: 3}
ButtonsTransform: {fileID: 1956104733}
ItemsGO: {fileID: 218688404}
EquipmentTransform: {fileID: 631756796}
EquipmentIconPrefab: {fileID: 8157905562050262843, guid: 9550621bc537afe458470cf7ec4e49d8,
type: 3}
InventoryTransform: {fileID: 2117193695}
ItemIconPrefab: {fileID: 6815987390155653563, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
AbilitiesGO: {fileID: 1390411248}
AbilitiesTransform: {fileID: 2076331109}
AbilityIconPrefab: {fileID: 2472028539208066908, guid: 1a62b0361c965ac43bb89a11568fcfe4,
type: 3}
FormationObjects: {fileID: 135638608224023682}
FormationHeroImage: {fileID: 1231188988679905999}
FormationHeroName: {fileID: 3790361030781477297}
FormationUnitsTransform: {fileID: 1050217559578958967}
FormationUnitsPrefab: {fileID: 6815987390155653563, guid: a9ac5a15b3d5be741942da24cc7857c4,
type: 3}
--- !u!1 &6391937544300042816
GameObject:
m_ObjectHideFlags: 0
@ -6203,54 +6272,6 @@ RectTransform:
m_AnchoredPosition: {x: -0.36999512, y: -191}
m_SizeDelta: {x: -20.73999, y: 20.299988}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2066680301
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7228160732243375218}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3a89474e48880e44f97abfc6ce7be3fe, type: 3}
m_Name:
m_EditorClassIdentifier:
UnitNameText: {fileID: 976787391}
HealthBar: {fileID: 487272288}
HealthBarText: {fileID: 645723849}
DescriptionText: {fileID: 135006939}
UnitObjects: {fileID: 4617211388595578265}
StatusIconsTransform: {fileID: 1815122357}
ValueIconsTransform: {fileID: 970845490}
ValueIconPrefab: {fileID: 7541130419680964748, guid: 12f3a6f1f9c4a274883c016ebe2c9065,
type: 3}
ArmourIcons:
- {fileID: 21300000, guid: 0b13dc47c66b6c047b03e6513329837e, type: 3}
- {fileID: 21300000, guid: 685672c57176a604a95274687c9ecfcc, type: 3}
- {fileID: 21300000, guid: 2bfef1999cd2b714fba492ffd49eb356, type: 3}
- {fileID: 21300000, guid: da1431e4cb9d6804b823138d89fde4aa, type: 3}
- {fileID: 21300000, guid: 297684482aee75f469757daac209c5ad, type: 3}
PenetrationIcons:
- {fileID: 21300000, guid: f62ed88bae1f639428ebfcddaca2c014, type: 3}
- {fileID: 21300000, guid: c91c72ec4cff3a64d9d1c49971beb264, type: 3}
- {fileID: 21300000, guid: 82bc7d230a0995f46999e2b660a8783b, type: 3}
- {fileID: 21300000, guid: dc0c84a296b0e314384831fe84f85b0e, type: 3}
- {fileID: 21300000, guid: b1c8856dce75f6247813e65f74deb16b, type: 3}
ButtonsTransform: {fileID: 1956104733}
ItemsGO: {fileID: 218688404}
EquipmentTransform: {fileID: 631756796}
EquipmentIconPrefab: {fileID: 8157905562050262843, guid: 9550621bc537afe458470cf7ec4e49d8,
type: 3}
InventoryTransform: {fileID: 2117193695}
ItemIconPrefab: {fileID: 6815987390155653563, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
AbilitiesGO: {fileID: 1390411248}
AbilitiesTransform: {fileID: 2076331109}
AbilityIconPrefab: {fileID: 2472028539208066908, guid: 1a62b0361c965ac43bb89a11568fcfe4,
type: 3}
FormationObjects: {fileID: 135638608224023682}
FormationHeroImage: {fileID: 1231188988679905999}
FormationHeroName: {fileID: 3790361030781477297}
--- !u!1 &7442547893769427862
GameObject:
m_ObjectHideFlags: 0
@ -7751,146 +7772,3 @@ RectTransform:
type: 3}
m_PrefabInstance: {fileID: 6581998086233745666}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7298274475077793922
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1050217559578958967}
m_Modifications:
- target: {fileID: 6815987389502116016, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_Text
value: '5
'
objectReference: {fileID: 0}
- target: {fileID: 6815987389502116018, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_SizeDelta.x
value: 10
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_Pivot.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_SizeDelta.x
value: 50
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_SizeDelta.y
value: 35
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 10
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6815987390155653563, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_Name
value: ItemIcon
objectReference: {fileID: 0}
- target: {fileID: 6815987390313110545, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: 8b885d347e1e7f0438b7892eaea4ab67,
type: 3}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 06641392b6ebf5645b031c3f0700a917, type: 3}
--- !u!224 &4314428225394243898 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 6815987390155653560, guid: 06641392b6ebf5645b031c3f0700a917,
type: 3}
m_PrefabInstance: {fileID: 7298274475077793922}
m_PrefabAsset: {fileID: 0}

+ 250
- 0
Assets/GWConquest/Prefabs/UI/UnitInfoPanel/UnitClassIcon.prefab View File

@ -0,0 +1,250 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6815987389502116021
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6815987389502116018}
- component: {fileID: 6815987389502116017}
- component: {fileID: 6815987389502116016}
- component: {fileID: 6815987389502116019}
m_Layer: 5
m_Name: Count
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6815987389502116018
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6815987389502116021}
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: 6815987390155653560}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 40, y: 0}
m_SizeDelta: {x: 0, y: 35}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &6815987389502116017
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6815987389502116021}
m_CullTransparentMesh: 0
--- !u!114 &6815987389502116016
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6815987389502116021}
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: 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: 5
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: '0
'
--- !u!114 &6815987389502116019
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6815987389502116021}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalFit: 2
m_VerticalFit: 0
--- !u!1 &6815987390155653563
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6815987390155653560}
- component: {fileID: 6815987390155653558}
- component: {fileID: 1138806303401438636}
- component: {fileID: 857289834285570048}
m_Layer: 5
m_Name: UnitClassIcon
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6815987390155653560
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6815987390155653563}
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: 6815987390313110544}
- {fileID: 6815987389502116018}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 10, y: 0}
m_SizeDelta: {x: 35, y: 35}
m_Pivot: {x: 0, y: 1}
--- !u!222 &6815987390155653558
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6815987390155653563}
m_CullTransparentMesh: 0
--- !u!114 &1138806303401438636
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6815987390155653563}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 68d57de996f29404f8d57bdeb85ab942, type: 3}
m_Name:
m_EditorClassIdentifier:
Padding: 0
Horizontal: 1
Vertical: 0
--- !u!114 &857289834285570048
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6815987390155653563}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 37142a45667f8764a81893026e91ce40, type: 3}
m_Name:
m_EditorClassIdentifier:
Icon: {fileID: 6815987390313110545}
Amount: {fileID: 6815987389502116016}
CanBeDragged: 0
--- !u!1 &6815987390313110547
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6815987390313110544}
- component: {fileID: 6815987390313110542}
- component: {fileID: 6815987390313110545}
m_Layer: 5
m_Name: Icon
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6815987390313110544
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6815987390313110547}
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: 6815987390155653560}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 35, y: 35}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &6815987390313110542
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6815987390313110547}
m_CullTransparentMesh: 0
--- !u!114 &6815987390313110545
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6815987390313110547}
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_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

+ 7
- 0
Assets/GWConquest/Prefabs/UI/UnitInfoPanel/UnitClassIcon.prefab.meta View File

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

+ 2
- 2
Assets/GWConquest/Scenes/GalaxyMap.unity View File

@ -104024,10 +104024,10 @@ MonoBehaviour:
AttackerRadius: 1250
DefenderRadius: 930
RadialDistance: 45
AngularDistance: 1.5
AngularDistance: 31
AngularCenter: 12.65
AngularOffset: 6
RadialCount: 3
RadialCount: 2
--- !u!1 &1740317840
GameObject:
m_ObjectHideFlags: 0


+ 2
- 2
Assets/GWConquest/Scripts/Inventory.cs View File

@ -75,13 +75,13 @@ namespace GWConquest
};
}
public static ItemStack FromUnit(Unit unit)
public static ItemStack FromUnit(Unit unit, int amount=1)
{
return new ItemStack {
IsUnit = true,
UnitId = unit.entity.NetworkId,
Stackable = false,
Amount = 1
Amount = amount
};
}


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

@ -27,7 +27,9 @@ namespace GWConquest {
private float CurrentHeight = 0f;
private Unit SelectedUnit;
private Formation SelectedFormation;
private BattleUnitIcon SelectedUnitIcon;
private BattleFormationUI SelectedFormationUI;
public IEnumerable<Formation> GetBattleFormations()
{
@ -126,6 +128,9 @@ namespace GWConquest {
SelectedUnitIcon = null;
}
SelectedFormation = null;
SelectedFormationUI = null;
if(icon?.Flank != null)
{
BattleUI.SelectIconOnFlank(icon);
@ -134,13 +139,36 @@ namespace GWConquest {
UpdateSelectedUI();
}
public void OnFormationClicked(BattleFormationUI ui)
{
if(SelectedUnitIcon != null)
{
if(SelectedUnitIcon.Flank != null)
{
BattleUI.DeselectIconOnFlank(SelectedUnitIcon.Flank);
}
SelectedUnitIcon.GetComponent<Animator>().SetBool("Selected", false);
}
SelectedUnit = null;
SelectedUnitIcon = null;
SelectedFormation = ui.Formation;
SelectedFormationUI = ui;
UpdateSelectedUI();
}
public void UpdateSelectedUI()
{
if(SelectedUnit != null)
{
InfoPanel.SelectUnit(SelectedUnit);
Animator.SetBool("InfoPanelOpen", true);
}
else if(SelectedFormation != null)
{
InfoPanel.SelectFormation(SelectedFormation);
Animator.SetBool("InfoPanelOpen", true);
}
else {
Animator.SetBool("InfoPanelOpen", false);


+ 18
- 0
Assets/GWConquest/Scripts/UI/BattleFormationUI.cs View File

@ -144,5 +144,23 @@ namespace GWConquest {
icon.UpdateIcon();
}
}
public void OnNameClicked()
{
var battleUI = GetComponentInParent<BattleUI>();
if(!battleUI.SelectingTarget && Formation != null)
{
BattleArmyPanel panel;
if(Formation.Player == Player.CurrentPlayer)
{
panel = battleUI.PlayerPanel;
}
else {
panel = battleUI.EnemyPanel;
}
panel.OnFormationClicked(this);
}
}
}
}

+ 5
- 3
Assets/GWConquest/Scripts/UI/FleetIconsUI.cs View File

@ -77,11 +77,13 @@ namespace GWConquest
public void UpdateLayout(List<FleetIcons> iconList, float radius)
{
var angularDistance = AngularDistance / radius * Mathf.Rad2Deg;
var totalUnitCount = iconList.Select(i => i.formation.UnitCount).Sum();
var totalFormations = iconList.Count;
var totalAngluarCount = Mathf.CeilToInt((float) totalUnitCount / RadialCount);
var totalAngle = totalAngluarCount * AngularDistance + (totalFormations - 1) * AngularOffset;
var totalAngle = totalAngluarCount * angularDistance + (totalFormations - 1) * AngularOffset;
var angleStart = AngularCenter - totalAngle / 2f;
var radiusStart = radius - (RadialCount * RadialDistance) / 2f;
@ -92,7 +94,7 @@ namespace GWConquest
foreach(var formationIcon in iconList)
{
int formationUnitCount = formationIcon.formation.UnitCount;
float formationAngle = currentAngle + Mathf.CeilToInt((float) formationUnitCount / RadialCount) * AngularDistance / 2f;
float formationAngle = currentAngle + Mathf.CeilToInt((float) formationUnitCount / RadialCount) * angularDistance / 2f;
formationIcon.transform.position = GetPosition(radius, formationAngle);
foreach(var unitIcon in formationIcon.IconList)
@ -105,7 +107,7 @@ namespace GWConquest
if(radialIndex >= RadialCount)
{
radialIndex = 0;
currentAngle += AngularDistance;
currentAngle += angularDistance;
}
}
radialIndex = 0;


+ 31
- 0
Assets/GWConquest/Scripts/UI/TransportUIUnitClassIcon.cs View File

@ -0,0 +1,31 @@
using UnityEngine.UI;
using UnityEngine;
using System;
namespace GWConquest {
public class TransportUIUnitClassIcon : MonoBehaviour, IUpdatable<(UnitClass, int)> {
public Image Icon;
public Text Amount;
[System.NonSerialized]
private (UnitClass, int) Stack;
public void UpdateDisplay((UnitClass, int) stack)
{
Stack = stack;
Icon.sprite = Stack.Item1.Sprite;
Amount.text = Stack.Item2.ToString();
}
public (UnitClass, int) GetObject()
{
return Stack;
}
}
}

+ 11
- 0
Assets/GWConquest/Scripts/UI/TransportUIUnitClassIcon.cs.meta View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 37142a45667f8764a81893026e91ce40
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 33
- 0
Assets/GWConquest/Scripts/UI/UnitInfoPanel.cs View File

@ -2,6 +2,7 @@
using UnityEngine.UI;
using System.Collections.Generic;
using System.Linq;
using System;
namespace GWConquest
{
@ -47,6 +48,12 @@ namespace GWConquest
public Image FormationHeroImage;
public Text FormationHeroName;
public RectTransform FormationUnitsTransform;
public GameObject FormationUnitsPrefab;
[System.NonSerialized]
public List<TransportUIUnitClassIcon> FormationUnitsList = new List<TransportUIUnitClassIcon>();
[System.NonSerialized]
public Unit CurrentUnit;
@ -173,6 +180,24 @@ namespace GWConquest
FormationHeroImage.sprite = CurrentFormation.Player.Faction.FactionLogo;
FormationHeroName.text = "No Leader";
}
var formationUnits = new Dictionary<UnitClass, int>();
foreach(var u in CurrentFormation.Units)
{
var cl = u.Class;
if(!cl.IsHero)
{
if(formationUnits.ContainsKey(cl))
{
formationUnits[cl]++;
}
else {
formationUnits[cl] = 1;
}
}
}
var formationUnitList = formationUnits.Select(pair => (pair.Key, pair.Value)).ToList();
GWLayout.UpdateGameObjects(FormationUnitsList, formationUnitList, FormationUnitsPrefab, FormationUnitsTransform);
}
@ -214,6 +239,10 @@ namespace GWConquest
GWLayout.UpdateLayout(AbilitiesTransform);
}
}
else if(CurrentFormation != null)
{
GWLayout.UpdateLayout(FormationUnitsTransform);
}
}
@ -249,4 +278,8 @@ namespace GWConquest
}
}
public enum UnitActionButton {
Retreat, Bombard
}
}

Loading…
Cancel
Save