Browse Source

Galaxy Map verändert; UI

bolt_update
laurids 4 years ago
parent
commit
a5719aed49
23 changed files with 2096 additions and 1231 deletions
  1. +132
    -0
      Assets/GWConquest/Prefabs/FormationPanel.prefab
  2. +7
    -0
      Assets/GWConquest/Prefabs/FormationPanel.prefab.meta
  3. +149
    -0
      Assets/GWConquest/Prefabs/GuiPanel.prefab
  4. +7
    -0
      Assets/GWConquest/Prefabs/GuiPanel.prefab.meta
  5. +276
    -0
      Assets/GWConquest/Prefabs/UnitPanel.prefab
  6. +7
    -0
      Assets/GWConquest/Prefabs/UnitPanel.prefab.meta
  7. +1204
    -1199
      Assets/GWConquest/Scenes/GalaxyMap.unity
  8. +1
    -0
      Assets/GWConquest/Scripts/Editor/PlanetEditor.cs
  9. +30
    -2
      Assets/GWConquest/Scripts/EntityList.cs
  10. +54
    -0
      Assets/GWConquest/Scripts/FleetPanelUI.cs
  11. +11
    -0
      Assets/GWConquest/Scripts/FleetPanelUI.cs.meta
  12. +21
    -7
      Assets/GWConquest/Scripts/Formation.cs
  13. +73
    -0
      Assets/GWConquest/Scripts/FormationUI.cs
  14. +11
    -0
      Assets/GWConquest/Scripts/FormationUI.cs.meta
  15. +79
    -17
      Assets/GWConquest/Scripts/GalaxyMapUI.cs
  16. +8
    -1
      Assets/GWConquest/Scripts/Planet.cs
  17. +1
    -1
      Assets/GWConquest/Scripts/ServerCallbacks.cs
  18. +13
    -2
      Assets/GWConquest/Scripts/Unit.cs
  19. +1
    -1
      Assets/GWConquest/Scripts/UnitClass.cs
  20. +7
    -0
      Assets/GWConquest/Scripts/Zone.cs
  21. +1
    -0
      Assets/GWConquest/Units/Cruiser.asset
  22. +2
    -1
      Assets/GWConquest/Units/Fighter.asset
  23. +1
    -0
      Assets/GWConquest/Units/Frigate.asset

+ 132
- 0
Assets/GWConquest/Prefabs/FormationPanel.prefab View File

@ -0,0 +1,132 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1708373284979538649
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1708373284979538650}
- component: {fileID: 1708373284979538652}
- component: {fileID: 1708373284979538651}
m_Layer: 5
m_Name: FormationTitle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1708373284979538650
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1708373284979538649}
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: 1708373286441865770}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 17}
m_Pivot: {x: 0, y: 1}
--- !u!222 &1708373284979538652
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1708373284979538649}
m_CullTransparentMesh: 0
--- !u!114 &1708373284979538651
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1708373284979538649}
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: 0.7882353}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
m_MaxSize: 112
m_Alignment: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "Fleet 1\n\t"
--- !u!1 &1708373286441865769
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1708373286441865770}
- component: {fileID: 2074407632541709644}
m_Layer: 5
m_Name: FormationPanel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1708373286441865770
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1708373286441865769}
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: 1708373284979538650}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 17}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &2074407632541709644
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1708373286441865769}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1c0e43d1dc685d84e91c202da724b6d3, type: 3}
m_Name:
m_EditorClassIdentifier:
FormationNameText: {fileID: 1708373284979538651}
UnitPanelPrefab: {fileID: 4461107318606652521, guid: 94778366cfbff894aafdef5ec6b24d19,
type: 3}
UnitPanelHeight: 17

+ 7
- 0
Assets/GWConquest/Prefabs/FormationPanel.prefab.meta View File

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

+ 149
- 0
Assets/GWConquest/Prefabs/GuiPanel.prefab View File

@ -0,0 +1,149 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3709556431398436641
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7870129596896663125}
- component: {fileID: 5413735710222757955}
- component: {fileID: 6066937026882375993}
m_Layer: 5
m_Name: GuiPanel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7870129596896663125
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3709556431398436641}
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: 7169136399962620445}
m_Father: {fileID: 0}
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: 0, y: 0}
m_SizeDelta: {x: 150, y: 150}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5413735710222757955
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3709556431398436641}
m_CullTransparentMesh: 0
--- !u!114 &6066937026882375993
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3709556431398436641}
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: 0, g: 0, b: 0, a: 0.8784314}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1.8
--- !u!1 &4108209800669813447
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7169136399962620445}
- component: {fileID: 5899782003992863072}
- component: {fileID: 7264797158076383403}
m_Layer: 5
m_Name: Border
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7169136399962620445
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4108209800669813447}
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: 7870129596896663125}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5899782003992863072
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4108209800669813447}
m_CullTransparentMesh: 0
--- !u!114 &7264797158076383403
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4108209800669813447}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.5529412}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 0
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 2

+ 7
- 0
Assets/GWConquest/Prefabs/GuiPanel.prefab.meta View File

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

+ 276
- 0
Assets/GWConquest/Prefabs/UnitPanel.prefab View File

@ -0,0 +1,276 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4461107317180991733
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4461107317180991734}
- component: {fileID: 4461107317180991728}
- component: {fileID: 4461107317180991735}
m_Layer: 5
m_Name: Count
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4461107317180991734
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4461107317180991733}
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: 4461107318606652522}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 19, y: 0}
m_Pivot: {x: 1, y: 1}
--- !u!222 &4461107317180991728
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4461107317180991733}
m_CullTransparentMesh: 0
--- !u!114 &4461107317180991735
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4461107317180991733}
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: 0.7882353}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3}
m_FontSize: 12
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
m_MaxSize: 112
m_Alignment: 2
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "x13\n\n\t"
--- !u!1 &4461107317294241808
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4461107317294241809}
- component: {fileID: 4461107317294241811}
- component: {fileID: 4461107317294241810}
m_Layer: 5
m_Name: Name
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4461107317294241809
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4461107317294241808}
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: 4461107318606652522}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 19, y: 0}
m_SizeDelta: {x: -38, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!222 &4461107317294241811
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4461107317294241808}
m_CullTransparentMesh: 0
--- !u!114 &4461107317294241810
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4461107317294241808}
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: 0.7882353}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: c47f9c9ae53006b46bef8b5c48a002a5, type: 3}
m_FontSize: 12
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
m_MaxSize: 112
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "Fighter Squadron\n\n\t"
--- !u!1 &4461107317436715333
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4461107317436715334}
- component: {fileID: 4461107317436715328}
- component: {fileID: 4461107317436715335}
m_Layer: 5
m_Name: Icon
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4461107317436715334
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4461107317436715333}
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: 4461107318606652522}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 17, y: 0}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &4461107317436715328
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4461107317436715333}
m_CullTransparentMesh: 0
--- !u!114 &4461107317436715335
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4461107317436715333}
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_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 52e22bcf1988b2b4da1b4da2ffba5c9d, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &4461107318606652521
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4461107318606652522}
- component: {fileID: 4461107318606652523}
m_Layer: 5
m_Name: UnitPanel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4461107318606652522
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4461107318606652521}
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: 4461107317294241809}
- {fileID: 4461107317436715334}
- {fileID: 4461107317180991734}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -17}
m_SizeDelta: {x: 0, y: 17}
m_Pivot: {x: 0.5, y: 1}
--- !u!222 &4461107318606652523
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4461107318606652521}
m_CullTransparentMesh: 0

+ 7
- 0
Assets/GWConquest/Prefabs/UnitPanel.prefab.meta View File

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

+ 1204
- 1199
Assets/GWConquest/Scenes/GalaxyMap.unity
File diff suppressed because it is too large
View File


+ 1
- 0
Assets/GWConquest/Scripts/Editor/PlanetEditor.cs View File

@ -27,6 +27,7 @@ namespace GWConquest
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("X", GUILayout.Width(20)))
{
Undo.RecordObject(conn.gameObject, "Delete planet connection");
DestroyImmediate(conn.gameObject);
}
if (conn.planet1 != planet)


+ 30
- 2
Assets/GWConquest/Scripts/EntityList.cs View File

@ -74,7 +74,7 @@ namespace GWConquest
public IEnumerator<BoltEntity> GetEnumerator()
{
return Token.Entities.GetEnumerator() as IEnumerator<BoltEntity>;
return new GenericListEnumerator<BoltEntity>(this);
}
public int IndexOf(BoltEntity item)
@ -109,7 +109,35 @@ namespace GWConquest
IEnumerator IEnumerable.GetEnumerator()
{
return Token.Entities.GetEnumerator();
return new GenericListEnumerator<BoltEntity>(this);
}
}
public class GenericListEnumerator<T> : IEnumerator<T>
{
private int position = -1;
private IList<T> list;
public GenericListEnumerator(IList<T> _list)
{
list = _list;
}
public T Current => list[position];
object IEnumerator.Current => list[position];
public void Dispose() { }
public bool MoveNext()
{
position++;
return position < list.Count;
}
public void Reset()
{
position = -1;
}
}


+ 54
- 0
Assets/GWConquest/Scripts/FleetPanelUI.cs View File

@ -0,0 +1,54 @@
using System.Collections.Generic;
using UnityEngine;
namespace GWConquest
{
public class FleetPanelUI : MonoBehaviour
{
public GameObject FormationUIPrefab;
public GameObject FormationParent;
private Formation[] formations;
private List<FormationUI> formationUIList = new List<FormationUI>();
public void SetFormations(Formation[] fs)
{
formations = fs;
UpdateUI();
}
private void OnDisable()
{
formations = null;
}
public void UpdateUI()
{
foreach(FormationUI ui in formationUIList)
{
Destroy(ui.gameObject);
}
formationUIList.Clear();
if(formations != null && formations.Length > 0)
{
float yPos = 0;
for (int i = 0; i < formations.Length; i++)
{
GameObject go = Instantiate(FormationUIPrefab.gameObject);
RectTransform rt = go.GetComponent<RectTransform>();
rt.SetParent(FormationParent.transform, false);
rt.anchoredPosition = new Vector2(0, yPos);
FormationUI ui = go.GetComponent<FormationUI>();
ui.FormationNameText.text = "Fleet " + (i + 1);
ui.SetFormation(formations[i]);
formationUIList.Add(ui);
yPos += rt.sizeDelta.y;
}
}
}
}
}

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

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

+ 21
- 7
Assets/GWConquest/Scripts/Formation.cs View File

@ -1,5 +1,6 @@
using UnityEngine;
using System.Linq;
using System;
namespace GWConquest
{
@ -54,7 +55,12 @@ namespace GWConquest
private float animDistanceCovered = 0;
public EntityList Units;
public EntityList UnitEntities;
public Unit[] Units
{
get => Array.ConvertAll(UnitEntities.ToArray(), e => e.GetComponent<Unit>());
}
public GameObject unitIcon;
@ -181,7 +187,7 @@ namespace GWConquest
public override void Attached()
{
BoltLog.Info("Formation attached: {0}", this);
Units = new EntityList(state, "Units");
UnitEntities = new EntityList(state, "Units");
if(entity.IsOwner)
{
@ -193,16 +199,24 @@ namespace GWConquest
state.AddCallback("IsInTransit", OnTransitBegun);
state.AddCallback("CurrentZone", OnZoneChanged);
}
public float GetFormationStrength()
{
BoltLog.Info("Getting formation strength for {0}", Units);
return Units.Sum(unit => {
BoltLog.Info("processing unit {0}", unit);
return 1f;
});
return UnitEntities.Sum(unit => unit.GetComponent<Unit>().Class.UnitStrength);
}
public void OnUnitAdded(Unit unit)
{
BoltLog.Info("Unit {0} added to formation {1}", unit, this);
if(currentZone != null)
{
currentZone.OnFormationChanged(this);
}
}
}

+ 73
- 0
Assets/GWConquest/Scripts/FormationUI.cs View File

@ -0,0 +1,73 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace GWConquest
{
public class FormationUI : MonoBehaviour
{
public Text FormationNameText;
public GameObject UnitPanelPrefab;
public float UnitPanelHeight;
private Formation formation;
private readonly List<GameObject> unitPanels = new List<GameObject>();
private class UnitClassEntry
{
public UnitClass Class;
public int Count;
}
public void SetFormation(Formation f)
{
formation = f;
UpdateUI();
}
public void UpdateUI()
{
foreach(GameObject go in unitPanels)
{
Destroy(go);
}
unitPanels.Clear();
if(formation != null)
{
Dictionary<UnitClass, UnitClassEntry> unitClassMap = new Dictionary<UnitClass, UnitClassEntry>();
foreach(Unit unit in formation.Units)
{
if(unitClassMap.ContainsKey(unit.Class))
{
unitClassMap[unit.Class].Count++;
}
else
{
unitClassMap[unit.Class] = new UnitClassEntry() { Class = unit.Class, Count = 1 };
}
}
List<UnitClassEntry> entries = new List<UnitClassEntry>(unitClassMap.Values);
entries.Sort((e1, e2) => e2.Count - e1.Count);
for(int i = 0; i < entries.Count; i++)
{
UnitClass unitClass = entries[i].Class;
int count = entries[i].Count;
GameObject unitPanel = Instantiate(UnitPanelPrefab);
RectTransform rt = unitPanel.GetComponent<RectTransform>();
rt.SetParent(transform, false);
rt.anchoredPosition = new Vector2(0, -(i + 1) * UnitPanelHeight);
rt.Find("Name").GetComponent<Text>().text = unitClass.FullName;
rt.Find("Count").GetComponent<Text>().text = "x" + count;
rt.Find("Icon").GetComponent<Image>().sprite = unitClass.Sprite;
unitPanels.Add(unitPanel);
}
}
GetComponent<RectTransform>().sizeDelta = new Vector2(0, (unitPanels.Count + 1) * UnitPanelHeight);
}
}
}

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

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

+ 79
- 17
Assets/GWConquest/Scripts/GalaxyMapUI.cs View File

@ -1,4 +1,6 @@
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
namespace GWConquest
@ -8,7 +10,13 @@ namespace GWConquest
public Text PlanetNameText;
public GameObject PlayerFleetPanel;
public GameObject EnemyFleetPlanel;
public GameObject EnemyFleetPanel;
public Image PlayerStrengthBar;
public Image EnemyStrengthBar;
public float StrengthBarParts;
public float MaxFormationStrength;
public GameObject PlanetSelection;
@ -16,23 +24,48 @@ namespace GWConquest
public void SelectPlanet(Planet planet)
{
SelectedPlanet = planet;
if(planet != SelectedPlanet)
{
if(SelectedPlanet != null)
{
SelectedPlanet.FormationsChanged -= PlanetFormationsChanged;
}
if(SelectedPlanet != null)
SelectedPlanet = planet;
if (SelectedPlanet != null)
{
gameObject.SetActive(true);
PlanetSelection.SetActive(true);
PlanetSelection.transform.SetParent(planet.transform, false);
PlanetNameText.text = SelectedPlanet.planetName;
UpdateIndicator();
SelectedPlanet.FormationsChanged += PlanetFormationsChanged;
}
else
{
PlanetSelection.SetActive(false);
EnemyFleetPanel.SetActive(false);
PlayerFleetPanel.SetActive(false);
gameObject.SetActive(false);
}
}
}
public void PlanetFormationsChanged()
{
if(PlayerFleetPanel.activeInHierarchy)
{
gameObject.SetActive(true);
PlanetSelection.SetActive(true);
PlanetSelection.transform.SetParent(planet.transform, false);
PlanetNameText.text = SelectedPlanet.planetName;
ShowPlayerFleetPanel();
}
else
if(EnemyFleetPanel.activeInHierarchy)
{
gameObject.SetActive(false);
PlanetSelection.SetActive(false);
EnemyFleetPlanel.SetActive(false);
PlayerFleetPanel.SetActive(false);
ShowEnemyFleetPanel();
}
}
public void BuildFleet(string unitClass)
@ -45,8 +78,6 @@ namespace GWConquest
ev.UnitClass = unitClass;
ev.Send();
gameObject.SetActive(false);
SelectedPlanet = null;
}
}
@ -54,11 +85,42 @@ namespace GWConquest
public void ShowPlayerFleetPanel()
{
PlayerFleetPanel.SetActive(true);
IEnumerable<Formation> formations = SelectedPlanet
.GetAllFormations(ZoneType.Space)
.Where(f => f.Player == Player.CurrentPlayer);
PlayerFleetPanel.GetComponent<FleetPanelUI>().SetFormations(formations.ToArray());
}
public void ShowEnemyFleetPanel()
{
EnemyFleetPlanel.SetActive(true);
EnemyFleetPanel.SetActive(true);
IEnumerable<Formation> formations = SelectedPlanet
.GetAllFormations(ZoneType.Space)
.Where(f => f.Player != Player.CurrentPlayer);
EnemyFleetPanel.GetComponent<FleetPanelUI>().SetFormations(formations.ToArray());
}
private void FixedUpdate()
{
UpdateIndicator();
}
public void UpdateIndicator()
{
if(SelectedPlanet != null)
{
IEnumerable<Formation> formations = SelectedPlanet.GetAllFormations(ZoneType.Space);
float playerStrength = formations.Sum(f => f.Player == Player.CurrentPlayer ? f.GetFormationStrength() : 0f);
float enemyStrength = formations.Sum(f => f.Player != Player.CurrentPlayer ? f.GetFormationStrength() : 0f);
playerStrength *= StrengthBarParts / MaxFormationStrength;
enemyStrength *= StrengthBarParts / MaxFormationStrength;
PlayerStrengthBar.fillAmount = Mathf.Ceil(playerStrength) / StrengthBarParts;
EnemyStrengthBar.fillAmount = Mathf.Ceil(enemyStrength) / StrengthBarParts;
}
}
}
}

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

@ -105,7 +105,7 @@ namespace GWConquest
return GetAllFormations(zoneType, player).Sum(formation => formation.GetFormationStrength());
}
private void Update()
private void FixedUpdate()
{
if(indicatorUI != null)
{
@ -113,6 +113,13 @@ namespace GWConquest
}
}
public event Action FormationsChanged;
public void OnFormationsChanged()
{
FormationsChanged?.Invoke();
}
#if UNITY_EDITOR


+ 1
- 1
Assets/GWConquest/Scripts/ServerCallbacks.cs View File

@ -42,7 +42,7 @@ namespace GWConquest
Unit unit = unitEntity.GetComponent<Unit>();
unit.Class = UnitClass.FromName(evnt.UnitClass);
unit.Formation = playerFormation;
playerFormation.Units.Add(unitEntity);
playerFormation.UnitEntities.Add(unitEntity);
}


+ 13
- 2
Assets/GWConquest/Scripts/Unit.cs View File

@ -19,10 +19,21 @@
public Formation Formation
{
get => state.Formation.GetState<Formation>();
get => state.Formation.GetComponent<Formation>();
set => state.Formation = value.entity;
}
public override void Attached()
{
state.AddCallback("Formation", () =>
{
if(Formation != null)
{
Formation.OnUnitAdded(this);
}
});
}
}
}

+ 1
- 1
Assets/GWConquest/Scripts/UnitClass.cs View File

@ -35,7 +35,6 @@ namespace GWConquest
}
if (classMap.ContainsKey(name))
{
BoltLog.Info("Unit class {0} found.", name);
return classMap[name];
}
else
@ -45,6 +44,7 @@ namespace GWConquest
}
}
public string FullName;
public Sprite Sprite;
public ZoneType ZoneType;


+ 7
- 0
Assets/GWConquest/Scripts/Zone.cs View File

@ -73,11 +73,18 @@ namespace GWConquest
public void OnFormationArrived(Formation formation)
{
formations.Add(formation);
planet.OnFormationsChanged();
}
public void OnFormationDeparting(Formation formation)
{
formations.Remove(formation);
planet.OnFormationsChanged();
}
public void OnFormationChanged(Formation formation)
{
planet.OnFormationsChanged();
}
#if UNITY_EDITOR


+ 1
- 0
Assets/GWConquest/Units/Cruiser.asset View File

@ -12,6 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 866efe5bcc98fde42bdab9c01ab3b6ba, type: 3}
m_Name: Cruiser
m_EditorClassIdentifier:
FullName: Battlecruiser
Sprite: {fileID: 21300000, guid: ce4e8e58b24032c41813c44cf346ac9c, type: 3}
ZoneType: 0
UnitStrength: 20


+ 2
- 1
Assets/GWConquest/Units/Fighter.asset View File

@ -12,7 +12,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 866efe5bcc98fde42bdab9c01ab3b6ba, type: 3}
m_Name: Fighter
m_EditorClassIdentifier:
FullName: Fighter Squadron
Sprite: {fileID: 21300000, guid: 52e22bcf1988b2b4da1b4da2ffba5c9d, type: 3}
ZoneType: 0
UnitStrength: 0
UnitStrength: 2
MaxHealth: 0

+ 1
- 0
Assets/GWConquest/Units/Frigate.asset View File

@ -12,6 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 866efe5bcc98fde42bdab9c01ab3b6ba, type: 3}
m_Name: Frigate
m_EditorClassIdentifier:
FullName: Frigate Squadron
Sprite: {fileID: 21300000, guid: a725f0b3a4d26a945a5b8ccbcffef516, type: 3}
ZoneType: 0
UnitStrength: 10


Loading…
Cancel
Save