Browse Source

Production Queue cont.

bolt_update
laurids 4 years ago
parent
commit
ba56751769
28 changed files with 3004 additions and 1748 deletions
  1. +92
    -5
      Assets/GWConquest/Animations/ProductionIcon.controller
  2. +111
    -0
      Assets/GWConquest/Prefabs/Factory.prefab
  3. +7
    -0
      Assets/GWConquest/Prefabs/Factory.prefab.meta
  4. +2
    -2
      Assets/GWConquest/Prefabs/Formation.prefab
  5. +104
    -67
      Assets/GWConquest/Prefabs/Planet.prefab
  6. +1
    -1
      Assets/GWConquest/Prefabs/Player.prefab
  7. +45
    -0
      Assets/GWConquest/Prefabs/ProductionMenuIcon.prefab
  8. +515
    -0
      Assets/GWConquest/Prefabs/QueueIcon.prefab
  9. +7
    -0
      Assets/GWConquest/Prefabs/QueueIcon.prefab.meta
  10. +1
    -1
      Assets/GWConquest/Prefabs/Unit.prefab
  11. +1593
    -1661
      Assets/GWConquest/Scenes/GalaxyMap.unity
  12. +108
    -1
      Assets/GWConquest/Scripts/DistrictFactory.cs
  13. +6
    -0
      Assets/GWConquest/Scripts/ServerCallbacks.cs
  14. +5
    -3
      Assets/GWConquest/Scripts/UI/DistrictUI.cs
  15. +8
    -2
      Assets/GWConquest/Scripts/UI/IngameUI.cs
  16. +4
    -0
      Assets/GWConquest/Scripts/UI/PlanetViewUI.cs
  17. +22
    -2
      Assets/GWConquest/Scripts/UI/ProductionMenu.cs
  18. +10
    -1
      Assets/GWConquest/Scripts/UI/ProductionMenuIcon.cs
  19. +75
    -0
      Assets/GWConquest/Scripts/UI/QueueMenu.cs
  20. +11
    -0
      Assets/GWConquest/Scripts/UI/QueueMenu.cs.meta
  21. +52
    -0
      Assets/GWConquest/Scripts/UI/QueueMenuIcon.cs
  22. +11
    -0
      Assets/GWConquest/Scripts/UI/QueueMenuIcon.cs.meta
  23. +25
    -1
      Assets/GWConquest/Scripts/Unit.cs
  24. +4
    -1
      Assets/GWConquest/Scripts/UnitClass.cs
  25. BIN
      Assets/Photon/PhotonBolt/assemblies/bolt.user.dll
  26. BIN
      Assets/Photon/PhotonBolt/assemblies/bolt.user.dll.mdb
  27. +184
    -0
      Assets/Photon/PhotonBolt/project.json
  28. +1
    -0
      Assets/Photon/PhotonBolt/resources/BoltPrefabDatabase.asset

+ 92
- 5
Assets/GWConquest/Animations/ProductionIcon.controller View File

@ -11,7 +11,10 @@ AnimatorStateMachine:
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: -2870376458642484759}
m_Position: {x: 280, y: 80, z: 0}
m_Position: {x: 430, y: 60, z: 0}
- serializedVersion: 1
m_State: {fileID: -3038382536800868440}
m_Position: {x: 270, y: -30, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
@ -21,7 +24,34 @@ AnimatorStateMachine:
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: -2870376458642484759}
m_DefaultState: {fileID: -3038382536800868440}
--- !u!1102 &-3038382536800868440
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Paused
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: -803498051757648462}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 0
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!1102 &-2870376458642484759
AnimatorState:
serializedVersion: 5
@ -32,11 +62,12 @@ AnimatorState:
m_Name: CogwheelTurn
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_Transitions:
- {fileID: 3109142647042112950}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_WriteDefaultValues: 0
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
@ -48,6 +79,31 @@ AnimatorState:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &-803498051757648462
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: Running
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -2870376458642484759}
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!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
@ -56,7 +112,13 @@ AnimatorController:
m_PrefabAsset: {fileID: 0}
m_Name: ProductionIcon
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorParameters:
- m_Name: Running
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
@ -70,3 +132,28 @@ AnimatorController:
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1101 &3109142647042112950
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: Running
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -3038382536800868440}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.975
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1

+ 111
- 0
Assets/GWConquest/Prefabs/Factory.prefab View File

@ -0,0 +1,111 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1355812926097278600
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6365986322515139274}
- component: {fileID: 7080609719325669056}
- component: {fileID: 8496026405921973180}
- component: {fileID: 7954319019618919355}
- component: {fileID: 3732992427129260454}
m_Layer: 0
m_Name: Factory
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6365986322515139274
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1355812926097278600}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2, y: 2, z: 2}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7080609719325669056
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1355812926097278600}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59300c3dd14d29d4895f5f18e85d7eb3, type: 3}
m_Name:
m_EditorClassIdentifier:
zoneId: 0
attackZone: 0
mainZone: 1
--- !u!114 &8496026405921973180
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1355812926097278600}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3097d18430809bc4db1e8e075e8199a2, type: 3}
m_Name:
m_EditorClassIdentifier:
Tier: 1
FactoryType: 0
SpecialUnits: []
--- !u!114 &7954319019618919355
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1355812926097278600}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a89484993d239124eb667c8c33c633d3, type: 3}
m_Name:
m_EditorClassIdentifier:
DefaultSprite: {fileID: 21300000, guid: 3b81d9ff9816c8240b02293797c69234, type: 3}
DistrictName: Primus
Description:
IsCityDistrict: 1
--- !u!114 &3732992427129260454
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1355812926097278600}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -36112512, guid: 5b00bf8b25851d440940a40ec23344f4, type: 3}
m_Name:
m_EditorClassIdentifier:
_sceneGuid:
_serializerGuid: 5b40b0d7-d27b-4407-968a-c0f4c722eb67
_prefabId: 1
_updateRate: 1
_autoFreezeProxyFrames: 0
_clientPredicted: 1
_allowInstantiateOnClient: 1
_persistThroughSceneLoads: 0
_sceneObjectDestroyOnDetach: 1
_sceneObjectAutoAttach: 1
_alwaysProxy: 0
_detachOnDisable: 1
_allowFirstReplicationWhenFrozen: 0
_autoRemoveChildEntities: 0
_entityBehaviourQueryOption: 0
_entityPriorityCalculatorQueryOption: 0
_entityReplicationFilterQueryOption: 0

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

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

+ 2
- 2
Assets/GWConquest/Prefabs/Formation.prefab View File

@ -91,7 +91,7 @@ MeshCollider:
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
serializedVersion: 4
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
@ -174,7 +174,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
_sceneGuid:
_serializerGuid: d7ecbbfb-2aa4-41e6-b745-72f55b565b31
_prefabId: 1
_prefabId: 2
_updateRate: 1
_autoFreezeProxyFrames: 0
_clientPredicted: 1


+ 104
- 67
Assets/GWConquest/Prefabs/Planet.prefab View File

@ -61,7 +61,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4678135251998877763}
- {fileID: 4678135252407299477}
- {fileID: 5705803185017867045}
- {fileID: 4678135252239284613}
- {fileID: 4678135251355824056}
- {fileID: 7191419555384860655}
@ -100,7 +100,7 @@ MonoBehaviour:
- {fileID: 4678135251998877762}
- {fileID: 4678135252239284612}
groundZones:
- {fileID: 4678135252407299476}
- {fileID: 8445641380723648303}
- {fileID: 4678135251355824059}
showPlanetName: 1
planetName:
@ -244,71 +244,6 @@ MonoBehaviour:
zoneId: 0
attackZone: 1
mainZone: 0
--- !u!1 &4678135252407299479
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4678135252407299477}
- component: {fileID: 4678135252407299476}
- component: {fileID: 4437340467061616990}
m_Layer: 0
m_Name: GroundMain
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4678135252407299477
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4678135252407299479}
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: 4678135251219451999}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4678135252407299476
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4678135252407299479}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59300c3dd14d29d4895f5f18e85d7eb3, type: 3}
m_Name:
m_EditorClassIdentifier:
zoneId: 0
attackZone: 0
mainZone: 1
--- !u!114 &4437340467061616990
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4678135252407299479}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3097d18430809bc4db1e8e075e8199a2, type: 3}
m_Name:
m_EditorClassIdentifier:
DefaultSprite: {fileID: 21300000, guid: 3b81d9ff9816c8240b02293797c69234, type: 3}
DistrictName: Primus
Description:
IsCityDistrict: 1
Tier: 1
SpecialUnits: []
--- !u!1 &6190436286784700940
GameObject:
m_ObjectHideFlags: 0
@ -339,3 +274,105 @@ Transform:
m_Father: {fileID: 7191419555384860655}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 42.538002, y: 28.511002, z: 0}
--- !u!1001 &1690981885650063855
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 4678135251219451999}
m_Modifications:
- target: {fileID: 1355812926097278600, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_Name
value: GroundMain
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: fc3eae9e9964d5446a5c38fbf9a203bb, type: 3}
--- !u!4 &5705803185017867045 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
m_PrefabInstance: {fileID: 1690981885650063855}
m_PrefabAsset: {fileID: 0}
--- !u!114 &8445641380723648303 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 7080609719325669056, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
m_PrefabInstance: {fileID: 1690981885650063855}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59300c3dd14d29d4895f5f18e85d7eb3, type: 3}
m_Name:
m_EditorClassIdentifier:

+ 1
- 1
Assets/GWConquest/Prefabs/Player.prefab View File

@ -46,7 +46,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
_sceneGuid:
_serializerGuid: 59871d26-b925-463a-99f3-d6305974e7c3
_prefabId: 2
_prefabId: 3
_updateRate: 1
_autoFreezeProxyFrames: 0
_clientPredicted: 1


+ 45
- 0
Assets/GWConquest/Prefabs/ProductionMenuIcon.prefab View File

@ -318,6 +318,21 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- eventID: 7
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 6924224164136034615}
m_MethodName: Scroll
m_Mode: 0
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 &6924224162369387222
PrefabInstance:
m_ObjectHideFlags: 0
@ -325,6 +340,36 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 6924224164136034614}
m_Modifications:
- target: {fileID: 1738231878797738961, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738961, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738961, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738961, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 6924224164136034615}
- target: {fileID: 1738231878797738961, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: Click
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738961, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738974, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_Name


+ 515
- 0
Assets/GWConquest/Prefabs/QueueIcon.prefab View File

@ -0,0 +1,515 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3850329291015646697
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3850329291015646698}
- component: {fileID: 3850329291015646700}
- component: {fileID: 3850329291015646699}
m_Layer: 5
m_Name: UnitIcon
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3850329291015646698
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329291015646697}
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: 3850329291590619306}
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: 26.948929, y: -12.075}
m_SizeDelta: {x: 58, y: 58}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3850329291015646700
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329291015646697}
m_CullTransparentMesh: 0
--- !u!114 &3850329291015646699
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329291015646697}
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: 0
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: ae548785829024145b06993a6c449a28, 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 &3850329291441623360
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3850329291441623361}
- component: {fileID: 3850329291441623363}
- component: {fileID: 3850329291441623362}
m_Layer: 5
m_Name: percentage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3850329291441623361
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329291441623360}
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: 3850329291590619306}
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: -37.9, y: -12.3}
m_SizeDelta: {x: 21.413017, y: 21.413017}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3850329291441623363
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329291441623360}
m_CullTransparentMesh: 0
--- !u!114 &3850329291441623362
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329291441623360}
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.70980394, g: 0.28578943, b: 0.065301925, a: 1}
m_RaycastTarget: 0
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: c5c5d1f6b8fa0404ca44f3ea7c937909, type: 3}
m_Type: 3
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 0
m_FillClockwise: 1
m_FillOrigin: 2
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &3850329291590619305
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3850329291590619306}
- component: {fileID: 3850329291590619308}
- component: {fileID: 3850329291590619309}
- component: {fileID: 3850329291590619307}
m_Layer: 5
m_Name: QueueIcon
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3850329291590619306
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329291590619305}
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: 3850329291531620687}
- {fileID: 3850329291723751673}
- {fileID: 3850329291015646698}
- {fileID: 3850329291441623361}
- {fileID: 3850329292131814946}
m_Father: {fileID: 0}
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: 5, y: 0}
m_SizeDelta: {x: 130, y: 88}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &3850329291590619308
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329291590619305}
m_CullTransparentMesh: 0
--- !u!95 &3850329291590619309
Animator:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329291590619305}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: da78192b6e6c9c3499677ae0722e7670, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!114 &3850329291590619307
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329291590619305}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 170404c2782c8a84fa8c0212562e1afa, type: 3}
m_Name:
m_EditorClassIdentifier:
UnitIcon: {fileID: 3850329291015646699}
ProgressIcon: {fileID: 3850329291441623362}
UnitName: {fileID: 3850329291723751674}
Animator: {fileID: 3850329291590619309}
--- !u!1 &3850329291723751672
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3850329291723751673}
- component: {fileID: 3850329291723751675}
- component: {fileID: 3850329291723751674}
m_Layer: 5
m_Name: UnitText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3850329291723751673
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329291723751672}
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: 3850329291590619306}
m_RootOrder: 1
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.9000015}
m_SizeDelta: {x: 0, y: 23.250267}
m_Pivot: {x: 0, y: 1}
--- !u!222 &3850329291723751675
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329291723751672}
m_CullTransparentMesh: 0
--- !u!114 &3850329291723751674
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329291723751672}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_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: 1
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 'Tank 1
'
--- !u!1 &3850329292131814945
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3850329292131814946}
- component: {fileID: 3850329292131814948}
- component: {fileID: 3850329292131814947}
m_Layer: 5
m_Name: cogwheel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3850329292131814946
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329292131814945}
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: 3850329291590619306}
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: -37.9, y: -12.3}
m_SizeDelta: {x: 39.947266, y: 39.947266}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3850329292131814948
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329292131814945}
m_CullTransparentMesh: 0
--- !u!114 &3850329292131814947
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850329292131814945}
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: 0
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 3738cf91cf0b6a94cb7fb6d9e0d73c19, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 0.791
m_FillClockwise: 0
m_FillOrigin: 2
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1001 &3274238665969750672
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 3850329291590619306}
m_Modifications:
- target: {fileID: 1738231878797738974, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_Name
value: Corners
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 48644caf44a9db343acb000000c25522, type: 3}
--- !u!224 &3850329291531620687 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1738231878797738975, guid: 48644caf44a9db343acb000000c25522,
type: 3}
m_PrefabInstance: {fileID: 3274238665969750672}
m_PrefabAsset: {fileID: 0}

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

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

+ 1
- 1
Assets/GWConquest/Prefabs/Unit.prefab View File

@ -58,7 +58,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
_sceneGuid:
_serializerGuid: a3b5f966-83ae-4493-ac8f-90de2095ea63
_prefabId: 3
_prefabId: 4
_updateRate: 1
_autoFreezeProxyFrames: 0
_clientPredicted: 1


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


+ 108
- 1
Assets/GWConquest/Scripts/DistrictFactory.cs View File

@ -4,7 +4,7 @@ using System.Linq;
namespace GWConquest
{
public class DistrictFactory : District
public class DistrictFactory : Bolt.EntityBehaviour<IFactoryState>
{
public int Tier = 1;
public FactoryType FactoryType;
@ -17,6 +17,113 @@ namespace GWConquest
return classes.Union(special);
}
public int MaxQueueLength
{
get
{
return state.ProductionQueue.Length;
}
}
public int ProductionQueueLength
{
get
{
for(int i = 0; i < MaxQueueLength; i++)
{
if(state.ProductionQueue[i].UnitClass == null)
{
return i;
}
}
return MaxQueueLength;
}
}
public bool IsProducing
{
get
{
return state.ProductionQueue[0].UnitClass != null;
}
}
public UnitClass GetProductionQueueEntry(int i)
{
return UnitClass.FromName(state.ProductionQueue[i].UnitClass);
}
public float GetProductionTime(int i)
{
return state.ProductionQueue[i].TimeProduced;
}
public float GetProductionPercentage(int i)
{
return GetProductionTime(i) / GetProductionQueueEntry(i).BuildTime;
}
public void RemoveProductionQueueEntry(int index)
{
if(index == MaxQueueLength - 1)
{
state.ProductionQueue[index].UnitClass = null;
state.ProductionQueue[index].TimeProduced = 0f;
}
else
{
for (int i = index; i < MaxQueueLength - 1; i++)
{
var nextEntry = state.ProductionQueue[i + 1];
state.ProductionQueue[i].UnitClass = nextEntry.UnitClass;
state.ProductionQueue[i].TimeProduced = nextEntry.TimeProduced;
if (nextEntry.UnitClass == null)
{
return;
}
}
state.ProductionQueue[MaxQueueLength - 1].UnitClass = null;
state.ProductionQueue[MaxQueueLength - 1].TimeProduced = 0f;
}
}
public void AddProductionQueueEntry(string uc)
{
int length = ProductionQueueLength;
if(length < MaxQueueLength)
{
BoltLog.Info("Adding unit {0} to production queue on district {1}", uc, gameObject.name);
state.ProductionQueue[length].UnitClass = uc;
state.ProductionQueue[length].TimeProduced = 0f;
}
}
public override void SimulateOwner()
{
if(IsProducing)
{
state.ProductionQueue[0].TimeProduced += BoltNetwork.FrameDeltaTime;
UnitClass uc = GetProductionQueueEntry(0);
if (GetProductionTime(0) >= uc.BuildTime)
{
Zone zone = GetComponent<Zone>();
if(zone != null)
{
// TODO correct player when zones are under control
Unit.SpawnUnit(zone, uc, Player.CurrentPlayer);
}
else
{
BoltLog.Error("No corresponding zone for factory {0}", gameObject.name);
}
RemoveProductionQueueEntry(0);
}
}
}
}
public enum FactoryType


+ 6
- 0
Assets/GWConquest/Scripts/ServerCallbacks.cs View File

@ -51,5 +51,11 @@ namespace GWConquest
Formation formation = evnt.Formation.GetComponent<Formation>();
formation.MoveToZone(Zone.GetFromId(evnt.TargetZone));
}
public override void OnEvent(AddProductionEvent evnt)
{
DistrictFactory factory = evnt.Factory.GetComponent<DistrictFactory>();
factory.AddProductionQueueEntry(evnt.UnitClass);
}
}
}

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

@ -10,6 +10,7 @@ namespace GWConquest
public Text DescriptionText;
public ProductionMenu ProductionMenu;
public QueueMenu QueueMenu;
private District district;
@ -19,10 +20,11 @@ namespace GWConquest
NameText.text = district.GetDistrictName();
DescriptionText.text = district.GetDescription();
if(district is DistrictFactory)
if(district.GetComponent<DistrictFactory>() != null)
{
DistrictFactory factory = district as DistrictFactory;
ProductionMenu.Init(factory.GetAvailableUnitClasses().ToArray());
DistrictFactory factory = district.GetComponent<DistrictFactory>();
ProductionMenu.Init(factory);
QueueMenu.Init(factory);
}
}


+ 8
- 2
Assets/GWConquest/Scripts/UI/IngameUI.cs View File

@ -207,7 +207,10 @@ namespace GWConquest
{
if(p != planet)
{
p.gameObject.SetActive(false);
foreach(Renderer r in p.GetComponentsInChildren<Renderer>())
{
r.enabled = false;
}
}
}
@ -224,7 +227,10 @@ namespace GWConquest
foreach(Planet p in Planet.AllPlanets)
{
p.gameObject.SetActive(true);
foreach (Renderer r in p.GetComponentsInChildren<Renderer>())
{
r.enabled = true;
}
}
GWCamera camera = FindObjectOfType<GWCamera>();


+ 4
- 0
Assets/GWConquest/Scripts/UI/PlanetViewUI.cs View File

@ -168,6 +168,8 @@ namespace GWConquest
selectedDistrict = district;
ShowGroundPanel();
UpdateGroundIndicator();
}
public void ShowGroundPanel()
@ -204,6 +206,8 @@ namespace GWConquest
SpaceIndicatorPanel.SetActive(true);
FleetIcons.gameObject.SetActive(true);
GroundPanel.gameObject.SetActive(false);
UpdateGroundIndicator();
}
public void Deselect()


+ 22
- 2
Assets/GWConquest/Scripts/UI/ProductionMenu.cs View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
@ -10,6 +11,7 @@ namespace GWConquest
public Text UnitDescription;
public RectTransform Content;
public GameObject IconPrefab;
public ScrollRect ScrollRect;
public float IconHeight;
public float IconOffset;
@ -27,14 +29,16 @@ namespace GWConquest
private float AlphaLerpTarget = 0;
private DistrictFactory factory;
private UnitClass[] unitClasses;
private List<ProductionMenuIcon> iconList = new List<ProductionMenuIcon>();
private UnitClass selectedUnitClass;
public void Init(UnitClass[] _unitClasses)
public void Init(DistrictFactory _factory)
{
unitClasses = _unitClasses;
factory = _factory;
unitClasses = factory.GetAvailableUnitClasses().ToArray();
for(int i = 0; i < unitClasses.Length; i++)
{
@ -66,6 +70,8 @@ namespace GWConquest
}
iconList.Clear();
SelectUnitClass(null);
unitClasses = null;
factory = null;
InfoGroup.alpha = 0f;
}
@ -125,6 +131,20 @@ namespace GWConquest
}
public void AddUnitToQueue(UnitClass uc)
{
if(factory != null)
{
if(factory.ProductionQueueLength < factory.MaxQueueLength)
{
AddProductionEvent ev = AddProductionEvent.Create(Bolt.GlobalTargets.OnlyServer);
ev.Factory = factory.entity;
ev.UnitClass = uc.ShortName;
ev.Send();
}
}
}
}
}

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

@ -1,5 +1,6 @@
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
namespace GWConquest
{
@ -19,13 +20,21 @@ namespace GWConquest
public void Click()
{
Menu.AddUnitToQueue(UnitClass);
}
public void Highlight()
{
Menu.SelectUnitClass(UnitClass);
}
public void Scroll(BaseEventData ev)
{
if(ev is PointerEventData)
{
Menu.ScrollRect.OnScroll(ev as PointerEventData);
}
}
}
}

+ 75
- 0
Assets/GWConquest/Scripts/UI/QueueMenu.cs View File

@ -0,0 +1,75 @@
using System.Collections.Generic;
using UnityEngine;
namespace GWConquest
{
public class QueueMenu : MonoBehaviour
{
public RectTransform Content;
public GameObject IconPrefab;
public float IconWidth;
public float IconOffset;
private DistrictFactory factory;
private List<QueueMenuIcon> iconList = new List<QueueMenuIcon>();
public void Init(DistrictFactory _factory)
{
factory = _factory;
UpdateQueue();
}
public void UpdateQueue()
{
int queueLength = factory.ProductionQueueLength;
int listLength = iconList.Count;
if(listLength != queueLength)
{
if(queueLength > listLength)
{
for (int i = listLength; i < queueLength; i++)
{
GameObject iconGO = Instantiate(IconPrefab);
float iconPos = IconOffset * (i + 1) + IconWidth * i;
RectTransform iconRT = iconGO.GetComponent<RectTransform>();
iconRT.SetParent(Content);
iconRT.anchoredPosition = new Vector3(iconPos, 0f);
iconRT.localRotation = Quaternion.identity;
iconRT.localScale = Vector3.one;
QueueMenuIcon iconComp = iconGO.GetComponent<QueueMenuIcon>();
iconComp.Init(this);
iconList.Add(iconComp);
}
}
else if(queueLength < listLength)
{
for(int i = listLength - 1; i >= queueLength; i--)
{
Destroy(iconList[i].gameObject);
iconList.RemoveAt(i);
}
}
float totalSize = IconOffset * (queueLength + 2) + IconWidth * queueLength;
Content.sizeDelta = new Vector2(totalSize, 0f);
}
for(int i = 0; i < queueLength; i++)
{
QueueMenuIcon icon = iconList[i];
icon.UpdateIcon(i, factory.GetProductionQueueEntry(i), factory.GetProductionPercentage(i));
}
}
private void Update()
{
UpdateQueue();
}
}
}

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

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

+ 52
- 0
Assets/GWConquest/Scripts/UI/QueueMenuIcon.cs View File

@ -0,0 +1,52 @@
using UnityEngine;
using UnityEngine.UI;
namespace GWConquest
{
public class QueueMenuIcon : MonoBehaviour
{
public Image UnitIcon;
public Image ProgressIcon;
public Text UnitName;
public Animator Animator;
private QueueMenu menu;
private int queueIndex = -1;
private UnitClass unitClass = null;
private float percentage = -1;
public void Init(QueueMenu _menu)
{
menu = _menu;
}
public void UpdateIcon(int i, UnitClass uc, float p)
{
if(i != queueIndex)
{
queueIndex = i;
if(i == 0)
{
Animator.SetBool("Running", true);
}
else
{
Animator.SetBool("Running", false);
}
}
if(uc != unitClass)
{
unitClass = uc;
UnitIcon.sprite = unitClass.Sprite;
UnitName.text = unitClass.FullName;
}
if(percentage != p)
{
percentage = p;
ProgressIcon.fillAmount = percentage;
}
}
}
}

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

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

+ 25
- 1
Assets/GWConquest/Scripts/Unit.cs View File

@ -1,4 +1,6 @@
namespace GWConquest
using System.Linq;
namespace GWConquest
{
public class Unit : Bolt.EntityBehaviour<IUnitState>
{
@ -34,6 +36,28 @@
});
}
public static Unit SpawnUnit(Zone zone, UnitClass uc, Player player)
{
Formation playerFormation = zone.Formations.FirstOrDefault(f => f.Player == player);
if (playerFormation == null)
{
BoltEntity formationEntity = BoltNetwork.Instantiate(BoltPrefabs.Formation);
player.AssignControl(formationEntity);
playerFormation = formationEntity.GetComponent<Formation>();
playerFormation.currentZone = zone;
playerFormation.Player = player;
}
BoltEntity unitEntity = BoltNetwork.Instantiate(BoltPrefabs.Unit);
player.AssignControl(unitEntity);
Unit unit = unitEntity.GetComponent<Unit>();
unit.Class = uc;
unit.Formation = playerFormation;
playerFormation.UnitEntities.Add(unitEntity);
return unit;
}
}
}

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

@ -82,6 +82,8 @@ namespace GWConquest
FuelCost = data.GetInt("Fuel Cost")
};
unitClass.BuildTime = data.GetFloat("Build Time");
unitClass.CreditUpkeep = data.GetFloat("Credit Upkeep");
unitClass.FoodUpkeep = data.GetFloat("Food Upkeep");
@ -108,7 +110,7 @@ namespace GWConquest
unitClass.Description = data.GetString("Description");
unitClass.ZoneType = zoneType;
unitClass.UnitStrength = unitClass.BuildCost.CreditCost;
unitClass.UnitStrength = unitClass.BuildCost.CreditCost / 100f;
unitClass.LoadTexture();
@ -169,6 +171,7 @@ namespace GWConquest
public WeaponStats[] WeaponStatsArray;
public BuildCost BuildCost;
public float BuildTime;
public float CreditUpkeep;
public float FoodUpkeep;


BIN
Assets/Photon/PhotonBolt/assemblies/bolt.user.dll View File


BIN
Assets/Photon/PhotonBolt/assemblies/bolt.user.dll.mdb View File


+ 184
- 0
Assets/Photon/PhotonBolt/project.json View File

@ -592,6 +592,190 @@
"Name": "UnitState",
"Guid": "a3b5f966-83ae-4493-ac8f-90de2095ea63",
"Groups": []
},
{
"$type": "Bolt.Compiler.StateDefinition, bolt.compiler",
"Properties": [
{
"Name": "ProductionQueue",
"Enabled": true,
"Expanded": true,
"ReplicationMode": 1,
"Priority": 1,
"PropertyType": {
"$type": "Bolt.Compiler.PropertyTypeArray, bolt.compiler",
"ElementCount": 10,
"ElementType": {
"$type": "Bolt.Compiler.PropertyTypeObject, bolt.compiler",
"StructGuid": "1cc5b915-f4e9-46d4-bae3-de6b38d6dd82"
}
},
"AssetSettings": {
"$type": "Bolt.Compiler.PropertyStateSettings, bolt.compiler",
"ExtrapolationErrorTolerance": 0.25,
"_ExtrapolationCorrectionFrames": 6,
"ExtrapolationMaxFrames": 9,
"SnapMagnitude": 10.0
}
}
],
"PacketMaxBits": 512,
"PacketMaxProperties": 16,
"InitialPositionCompression": {
"Compression": [
{
"MinValue": -1024,
"MaxValue": 1024,
"Accuracy": 0.01,
"Pack": 100.0,
"Read": 0.01,
"Shift": 1024.0,
"BitsRequired": 18
},
{
"MinValue": -1024,
"MaxValue": 1024,
"Accuracy": 0.01,
"Pack": 100.0,
"Read": 0.01,
"Shift": 1024.0,
"BitsRequired": 18
},
{
"MinValue": -1024,
"MaxValue": 1024,
"Accuracy": 0.01,
"Pack": 100.0,
"Read": 0.01,
"Shift": 1024.0,
"BitsRequired": 18
}
]
},
"InitialRotationCompression": {
"EulerCompression": [
{
"MaxValue": 360,
"Accuracy": 1.0,
"Pack": 1.0,
"Read": 1.0,
"BitsRequired": 9
},
{
"MaxValue": 360,
"Accuracy": 1.0,
"Pack": 1.0,
"Read": 1.0,
"BitsRequired": 9
},
{
"MaxValue": 360,
"Accuracy": 1.0,
"Pack": 1.0,
"Read": 1.0,
"BitsRequired": 9
}
],
"QuaternionCompression": {
"MinValue": -1,
"MaxValue": 1,
"Accuracy": 0.01,
"Pack": 100.0,
"Read": 0.01,
"Shift": 1.0,
"BitsRequired": 8
}
},
"Name": "FactoryState",
"Guid": "5b40b0d7-d27b-4407-968a-c0f4c722eb67",
"Groups": []
},
{
"$type": "Bolt.Compiler.EventDefinition, bolt.compiler",
"Properties": [
{
"Name": "Factory",
"Enabled": true,
"Expanded": true,
"ReplicationMode": 1,
"Priority": 1,
"PropertyType": {
"$type": "Bolt.Compiler.PropertyTypeEntity, bolt.compiler"
},
"AssetSettings": {
"$type": "Bolt.Compiler.PropertyEventSettings, bolt.compiler"
}
},
{
"Name": "UnitClass",
"Enabled": true,
"Expanded": true,
"ReplicationMode": 1,
"Priority": 1,
"PropertyType": {
"$type": "Bolt.Compiler.PropertyTypeString, bolt.compiler",
"MaxLength": 1
},
"AssetSettings": {
"$type": "Bolt.Compiler.PropertyEventSettings, bolt.compiler"
}
}
],
"Name": "AddProductionEvent",
"Guid": "51b6b927-fab0-4fb2-81b2-67005bd9cb43",
"Groups": []
},
{
"$type": "Bolt.Compiler.ObjectDefinition, bolt.compiler",
"Properties": [
{
"Name": "UnitClass",
"Enabled": true,
"Expanded": true,
"ReplicationMode": 1,
"Priority": 1,
"PropertyType": {
"$type": "Bolt.Compiler.PropertyTypeString, bolt.compiler",
"MaxLength": 1
},
"AssetSettings": {
"$type": "Bolt.Compiler.PropertyStateSettings, bolt.compiler",
"ExtrapolationErrorTolerance": 0.25,
"_ExtrapolationCorrectionFrames": 6,
"ExtrapolationMaxFrames": 9,
"SnapMagnitude": 10.0
}
},
{
"Name": "TimeProduced",
"Enabled": true,
"Expanded": true,
"ReplicationMode": 1,
"Priority": 1,
"PropertyType": {
"$type": "Bolt.Compiler.PropertyTypeFloat, bolt.compiler",
"Compression": {
"MinValue": -2048,
"MaxValue": 2048,
"Accuracy": 0.01,
"Pack": 100.0,
"Read": 0.01,
"Shift": 2048.0,
"BitsRequired": 19
}
},
"AssetSettings": {
"$type": "Bolt.Compiler.PropertyStateSettings, bolt.compiler",
"ExtrapolationErrorTolerance": 0.25,
"_ExtrapolationCorrectionFrames": 6,
"ExtrapolationMaxFrames": 9,
"SnapMagnitude": 10.0
}
}
],
"Name": "QueueEntry",
"Guid": "1cc5b915-f4e9-46d4-bae3-de6b38d6dd82",
"Groups": []
}
],
"ActiveGroup": "Everything"

+ 1
- 0
Assets/Photon/PhotonBolt/resources/BoltPrefabDatabase.asset View File

@ -15,6 +15,7 @@ MonoBehaviour:
DatabaseMode: 0
Prefabs:
- {fileID: 0}
- {fileID: 1355812926097278600, guid: fc3eae9e9964d5446a5c38fbf9a203bb, type: 3}
- {fileID: 8292977142823461082, guid: 6af4ad43e05dcb344bfd726895735387, type: 3}
- {fileID: 3262827332414082260, guid: f05198a1b03fe2b4e8042a9349c41aa3, type: 3}
- {fileID: 8890686142670377634, guid: e369f02fbeb5a9046aaa40a9b89a8973, type: 3}


Loading…
Cancel
Save