Browse Source

Added an 8-player starting area. Changed player-spawning slightly: instead of skipping index 0 for odd numbers of players, each starting pen section starts with no squares marked isSpawnable, and lists of squares to mark as spawnable on instantiation depending on the number of players. RacetrackGameMode.cs is currently hardcoded to call the map initialiser with five players, until I can figure out how to get the number of connected players when OnPreGameStart is called.

Josh_Dev_branch
s3607057 (Angus Niven) 5 years ago
parent
commit
3a6ae2f4c9
9 changed files with 9886 additions and 193 deletions
  1. +2
    -2
      Assets/Data/Map Generation/Map Manager.asset
  2. +12
    -4
      Assets/Prefabs/Blocks/Cube_GroundWall.prefab
  3. +192
    -163
      Assets/Prefabs/Map Sections/Start 4-player.prefab
  4. +9558
    -0
      Assets/Prefabs/Map Sections/Start 8-player.prefab
  5. +7
    -0
      Assets/Prefabs/Map Sections/Start 8-player.prefab.meta
  6. +2
    -2
      Assets/Scripts/GameMode/ColorGameMode/RacetrackGameMode.cs
  7. +48
    -9
      Assets/Scripts/Managers/GameManager.cs
  8. +52
    -0
      Assets/Scripts/Map Generation/MapManager.cs
  9. +13
    -13
      Assets/Scripts/Map Generation/MapSection.cs

+ 2
- 2
Assets/Data/Map Generation/Map Manager.asset View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0b856f73309ed68add224a7de7995afae4bbc0b4d5f37f937d8edf2a00f0c738
size 834
oid sha256:b6b048d7cd1d636b7d5c6eb9ab640eeec39d921f03df1ea868af25f2c72ae5f9
size 901

+ 12
- 4
Assets/Prefabs/Blocks/Cube_GroundWall.prefab View File

@ -14,7 +14,7 @@ GameObject:
- component: {fileID: 5320983720737496023}
- component: {fileID: 1547357862911686826}
m_Layer: 0
m_Name: Cube_GroundWall 1
m_Name: Cube_GroundWall
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -31,9 +31,9 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4721099343502762}
- {fileID: 4721100610124675}
- {fileID: 4721099741402202}
- {fileID: 4721099343502762}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -120,6 +120,14 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 3615111875144653457}
m_Modifications:
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalPosition.y
value: -3
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457}
propertyPath: m_LocalPosition.x
value: 0
@ -189,7 +197,7 @@ PrefabInstance:
m_Modifications:
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_RootOrder
value: 2
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_LocalPosition.y
@ -268,7 +276,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
propertyPath: m_RootOrder
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457}
propertyPath: m_LocalPosition.x

+ 192
- 163
Assets/Prefabs/Map Sections/Start 4-player.prefab View File

@ -27,7 +27,7 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4721099042904524}
- {fileID: 3961879821808847470}
- {fileID: 8422142931567203649}
- {fileID: 6222255621894721158}
- {fileID: 5323365066712967164}
@ -168,16 +168,33 @@ MonoBehaviour:
width: 9
length: 5
sectionName: 4-player pen
boulders: []
belts: []
cannons: []
pits: []
spawns:
spawns1:
- {fileID: 3620822236163029838}
spawns2:
- {fileID: 2712934075651174045}
- {fileID: 5915415157891220731}
spawns3:
- {fileID: 3620822236163029838}
- {fileID: 2712934075651174045}
- {fileID: 5915415157891220731}
spawns4:
- {fileID: 2712934075651174045}
- {fileID: 5915415157891220731}
- {fileID: 1880794270609936212}
- {fileID: 1476947395447377135}
spawns5:
- {fileID: 3620822236163029838}
- {fileID: 2712934075651174045}
- {fileID: 5915415157891220731}
- {fileID: 1880794270609936212}
- {fileID: 1476947395447377135}
spawns6: []
spawns7: []
spawns8: []
boulders: []
belts: []
cannons: []
pits: []
spikes: []
track:
- {fileID: 8173881161237315294}
@ -192,7 +209,7 @@ MonoBehaviour:
- {fileID: 3120937111272552252}
- {fileID: 6681604932799357795}
walls:
- {fileID: 1133981147424236}
- {fileID: 4042330930307082055}
- {fileID: 8427841112059603297}
- {fileID: 6218668495138845350}
- {fileID: 5329067722560625628}
@ -233,7 +250,7 @@ MonoBehaviour:
- {fileID: 4239367682014495038}
- {fileID: 3120937111272552252}
- {fileID: 6681604932799357795}
- {fileID: 1133981147424236}
- {fileID: 0}
- {fileID: 8427841112059603297}
- {fileID: 6218668495138845350}
- {fileID: 5329067722560625628}
@ -645,18 +662,18 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
--- !u!1 &306300284348476361 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07,
type: 3}
m_PrefabInstance: {fileID: 307429111159606821}
m_PrefabAsset: {fileID: 0}
--- !u!4 &312139210648623081 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07,
type: 3}
m_PrefabInstance: {fileID: 307429111159606821}
m_PrefabAsset: {fileID: 0}
--- !u!1 &306300284348476361 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07,
type: 3}
m_PrefabInstance: {fileID: 307429111159606821}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &324476270324866443
PrefabInstance:
m_ObjectHideFlags: 0
@ -730,6 +747,99 @@ GameObject:
type: 3}
m_PrefabInstance: {fileID: 324476270324866443}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &346805398788854015
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 2936725396817118767}
m_Modifications:
- target: {fileID: 4380075252948432824, guid: 125772d94eff8224a8f3a327ec632883,
type: 3}
propertyPath: m_Name
value: Cube_GroundWall
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 125772d94eff8224a8f3a327ec632883,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 125772d94eff8224a8f3a327ec632883,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 125772d94eff8224a8f3a327ec632883,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 125772d94eff8224a8f3a327ec632883,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 125772d94eff8224a8f3a327ec632883,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 125772d94eff8224a8f3a327ec632883,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 125772d94eff8224a8f3a327ec632883,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 125772d94eff8224a8f3a327ec632883,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 125772d94eff8224a8f3a327ec632883,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 125772d94eff8224a8f3a327ec632883,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 125772d94eff8224a8f3a327ec632883,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4721100610124675, guid: 125772d94eff8224a8f3a327ec632883, type: 3}
propertyPath: m_LocalPosition.y
value: -2
objectReference: {fileID: 0}
- target: {fileID: 4721099343502762, guid: 125772d94eff8224a8f3a327ec632883, type: 3}
propertyPath: m_LocalPosition.y
value: -1
objectReference: {fileID: 0}
- target: {fileID: 4721099741402202, guid: 125772d94eff8224a8f3a327ec632883, type: 3}
propertyPath: m_LocalPosition.y
value: -3
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 125772d94eff8224a8f3a327ec632883, type: 3}
--- !u!4 &3961879821808847470 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 3615111875144653457, guid: 125772d94eff8224a8f3a327ec632883,
type: 3}
m_PrefabInstance: {fileID: 346805398788854015}
m_PrefabAsset: {fileID: 0}
--- !u!1 &4042330930307082055 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4380075252948432824, guid: 125772d94eff8224a8f3a327ec632883,
type: 3}
m_PrefabInstance: {fileID: 346805398788854015}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &370251961083199106
PrefabInstance:
m_ObjectHideFlags: 0
@ -788,18 +898,18 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3c1f892a78332a64481617382603dd10, type: 3}
--- !u!4 &370251961105817883 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 47964057, guid: 3c1f892a78332a64481617382603dd10,
type: 3}
m_PrefabInstance: {fileID: 370251961083199106}
m_PrefabAsset: {fileID: 0}
--- !u!1 &2205701123479895218 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1999421548732318256, guid: 3c1f892a78332a64481617382603dd10,
type: 3}
m_PrefabInstance: {fileID: 370251961083199106}
m_PrefabAsset: {fileID: 0}
--- !u!4 &370251961105817883 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 47964057, guid: 3c1f892a78332a64481617382603dd10,
type: 3}
m_PrefabInstance: {fileID: 370251961083199106}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &392022298361934827
PrefabInstance:
m_ObjectHideFlags: 0
@ -1888,6 +1998,16 @@ PrefabInstance:
propertyPath: m_TagString
value: Coloured
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: isSpawnable
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: SpawnDirection
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalPosition.x
value: 1
@ -1944,30 +2064,20 @@ PrefabInstance:
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: isSpawnable
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: SpawnDirection
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
--- !u!1 &1476947395447377135 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
m_PrefabInstance: {fileID: 1475814807006897995}
m_PrefabAsset: {fileID: 0}
--- !u!4 &1474033034203271423 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
m_PrefabInstance: {fileID: 1475814807006897995}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1476947395447377135 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
m_PrefabInstance: {fileID: 1475814807006897995}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1566197182692229239
PrefabInstance:
m_ObjectHideFlags: 0
@ -2166,6 +2276,16 @@ PrefabInstance:
propertyPath: m_TagString
value: Coloured
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: isSpawnable
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: SpawnDirection
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalPosition.x
value: 1
@ -2222,16 +2342,6 @@ PrefabInstance:
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: isSpawnable
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: SpawnDirection
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
--- !u!4 &1878588751769195332 stripped
@ -2441,18 +2551,18 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e5fac62723232674aa487c9073f1ca07, type: 3}
--- !u!1 &2264083158536076915 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07,
type: 3}
m_PrefabInstance: {fileID: 2265210533806726047}
m_PrefabAsset: {fileID: 0}
--- !u!4 &2269639570744345171 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4721099042904524, guid: e5fac62723232674aa487c9073f1ca07,
type: 3}
m_PrefabInstance: {fileID: 2265210533806726047}
m_PrefabAsset: {fileID: 0}
--- !u!1 &2264083158536076915 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1133981147424236, guid: e5fac62723232674aa487c9073f1ca07,
type: 3}
m_PrefabInstance: {fileID: 2265210533806726047}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &2291122838956282867
PrefabInstance:
m_ObjectHideFlags: 0
@ -2590,6 +2700,16 @@ PrefabInstance:
propertyPath: m_TagString
value: Coloured
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: isSpawnable
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: SpawnDirection
value: 3
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalPosition.x
value: 3
@ -2646,16 +2766,6 @@ PrefabInstance:
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: isSpawnable
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: SpawnDirection
value: 3
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
--- !u!4 &2715034798296494733 stripped
@ -3160,6 +3270,16 @@ PrefabInstance:
propertyPath: m_TagString
value: Coloured
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: isSpawnable
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: SpawnDirection
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalPosition.x
value: 1
@ -3216,16 +3336,6 @@ PrefabInstance:
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: isSpawnable
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: SpawnDirection
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
--- !u!4 &3617591491379193694 stripped
@ -3310,87 +3420,6 @@ GameObject:
type: 3}
m_PrefabInstance: {fileID: 3619681099032281125}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &3619681099672568669
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 2936725396817118767}
m_Modifications:
- target: {fileID: 3620814462272186033, guid: 1076feda658eef24aaee6c9578839241,
type: 3}
propertyPath: m_Name
value: Cube_GroundWall
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 1076feda658eef24aaee6c9578839241,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 1076feda658eef24aaee6c9578839241,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 1076feda658eef24aaee6c9578839241,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 1076feda658eef24aaee6c9578839241,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 1076feda658eef24aaee6c9578839241,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 1076feda658eef24aaee6c9578839241,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 1076feda658eef24aaee6c9578839241,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 1076feda658eef24aaee6c9578839241,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 1076feda658eef24aaee6c9578839241,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 1076feda658eef24aaee6c9578839241,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3615111875144653457, guid: 1076feda658eef24aaee6c9578839241,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1076feda658eef24aaee6c9578839241, type: 3}
--- !u!4 &4721099042904524 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 3615111875144653457, guid: 1076feda658eef24aaee6c9578839241,
type: 3}
m_PrefabInstance: {fileID: 3619681099672568669}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1133981147424236 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 3620814462272186033, guid: 1076feda658eef24aaee6c9578839241,
type: 3}
m_PrefabInstance: {fileID: 3619681099672568669}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &3619681100294476286
PrefabInstance:
m_ObjectHideFlags: 0
@ -5584,6 +5613,16 @@ PrefabInstance:
propertyPath: m_TagString
value: Coloured
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: isSpawnable
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: SpawnDirection
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
propertyPath: m_LocalPosition.x
value: 2
@ -5640,16 +5679,6 @@ PrefabInstance:
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: isSpawnable
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: SpawnDirection
value: 2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
--- !u!4 &5916670350898600171 stripped

+ 9558
- 0
Assets/Prefabs/Map Sections/Start 8-player.prefab
File diff suppressed because it is too large
View File


+ 7
- 0
Assets/Prefabs/Map Sections/Start 8-player.prefab.meta View File

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

+ 2
- 2
Assets/Scripts/GameMode/ColorGameMode/RacetrackGameMode.cs View File

@ -26,8 +26,8 @@ public class RacetrackGameMode : GameMode
/// </summary>
protected override void OnPreGameStart()
{
//mapManager.init(allPlayers.Length);
mapManager.init(4);
//mapManager.init(ConnectedClients.Count);
mapManager.init(5);
}
/// <summary>

+ 48
- 9
Assets/Scripts/Managers/GameManager.cs View File

@ -102,6 +102,12 @@ public class GameManager : MonoBehaviour
gameMode.GameEnd(playerDataAsArray);
}
void removePlayer(PlayerData player)
{
player.client.ChangeScene("WaitScene");
player.isDead = true;
}
private IEnumerator RoundRoutine()
{
//Tell the gamemode that we are starting a round
@ -130,13 +136,29 @@ public class GameManager : MonoBehaviour
//Let GameMode know that Round is Over
gameMode.RoundEnd(playerDataAsArray.ToArray());
//Reset some player Data
//check is anyone has 0 lives remaining
//remove them from the array
//force them back to the waiting for players screen
foreach (PlayerData player in playerDataAsArray)
{
player.blockReader.Reset();
player.client.SendInventory();
if(player.client.Lives == 0)
{
Debug.Log("Remove: " + player.client.characterAnimal);
removePlayer(player);
}
}
//Reset some player Data
foreach (PlayerData player in playerDataAsArray)
{
if(player.client.Lives > 0)
{
player.blockReader.Reset();
player.client.SendInventory();
}
}
}
private IEnumerator WaitForPlayerInput()
@ -144,19 +166,35 @@ public class GameManager : MonoBehaviour
//send round length to players
//#TODO make this only happen after first input
LogicProtocols.FloatMsg RoundTime = new LogicProtocols.FloatMsg(gameMode.GetRoundTime());
playerDataAsArray.ForEach(p => p.client.conn.Send(LogicProtocols.SendRoundTime, RoundTime));
//playerDataAsArray.ForEach(p => p.client.conn.Send(LogicProtocols.SendRoundTime, RoundTime));
foreach (PlayerData player in playerDataAsArray)
{
if (player.client.Lives > 0)
{
player.client.conn.Send(LogicProtocols.SendRoundTime, RoundTime);
}
}
//Send players to input Scene
ClientList.ForEach(p => p.ChangeScene("ClientScene"));
//ClientList.ForEach(p => p.ChangeScene("ClientScene"));
foreach (ClientData client in ClientList)
{
if(client.Lives > 0){client.ChangeScene("ClientScene");}
}
//Let gamemode know clients are input-ing
gameMode.InputStart(playerDataAsArray);
//wait for all players to
yield return new WaitUntil(() => playerData.All(p => p.Value.recievedList));
yield return new WaitUntil(() => playerData.All(p => p.Value.recievedList || p.Value.isDead));
//reset
playerDataAsArray.ForEach(p => p.recievedList = false); //reset all players list
//playerDataAsArray.ForEach(p => p.recievedList = false); //reset all players list
foreach (PlayerData player in playerDataAsArray)
{
if (player.client.Lives > 0){player.recievedList = false;}
}
//Let gamemode know all inputs have been recieved
gameMode.InputEnd(playerDataAsArray);
@ -202,9 +240,9 @@ public class GameManager : MonoBehaviour
//int spawnIndex = 0;
//If we have an odd number of players, then we start at spawn point 0 (in the middle)
//If we have an even number, then we skip it
int spawnIndex = ((ClientList.Count() + 1) % 2);
//int spawnIndex = ((ClientList.Count() + 1) % 2);
//int spawnIndex = 0;
int spawnIndex = 0;
foreach (ClientData client in ClientList)
{
@ -269,6 +307,7 @@ public class PlayerData
public ClientData client;
public bool recievedList;
public bool isDead = false;
public PlayerData(Character character, ClientData client)
{

+ 52
- 0
Assets/Scripts/Map Generation/MapManager.cs View File

@ -51,6 +51,58 @@ public class MapManager : ScriptableObject
}
}
switch (players)
{
case 2:
foreach (GameObject spawnBlock in lastSection.spawns2)
{
spawnBlock.GetComponent<Block>().isSpawnable = true;
}
break;
case 3:
foreach (GameObject spawnBlock in lastSection.spawns3)
{
spawnBlock.GetComponent<Block>().isSpawnable = true;
}
break;
case 4:
foreach (GameObject spawnBlock in lastSection.spawns4)
{
spawnBlock.GetComponent<Block>().isSpawnable = true;
}
break;
case 5:
foreach (GameObject spawnBlock in lastSection.spawns5)
{
spawnBlock.GetComponent<Block>().isSpawnable = true;
}
break;
case 6:
foreach (GameObject spawnBlock in lastSection.spawns6)
{
spawnBlock.GetComponent<Block>().isSpawnable = true;
}
break;
case 7:
foreach (GameObject spawnBlock in lastSection.spawns7)
{
spawnBlock.GetComponent<Block>().isSpawnable = true;
}
break;
case 8:
foreach (GameObject spawnBlock in lastSection.spawns8)
{
spawnBlock.GetComponent<Block>().isSpawnable = true;
}
break;
default:
foreach (GameObject spawnBlock in lastSection.spawns1)
{
spawnBlock.GetComponent<Block>().isSpawnable = true;
}
break;
}
checkForward();
}

+ 13
- 13
Assets/Scripts/Map Generation/MapSection.cs View File

@ -9,12 +9,22 @@ public class MapSection : MonoBehaviour
int size;
public string sectionName = "";
//Lists of spawn points
//One for each possible number of players
public List<GameObject> spawns1;
public List<GameObject> spawns2;
public List<GameObject> spawns3;
public List<GameObject> spawns4;
public List<GameObject> spawns5;
public List<GameObject> spawns6;
public List<GameObject> spawns7;
public List<GameObject> spawns8;
//Lists of each type of block, assigned in the inspector
public List<GameObject> boulders;
public List<GameObject> belts;
public List<GameObject> cannons;
public List<GameObject> pits;
public List<GameObject> spawns;
public List<GameObject> spikes;
public List<GameObject> track;
public List<GameObject> walls;
@ -37,7 +47,7 @@ public class MapSection : MonoBehaviour
blocks.AddRange(belts);
blocks.AddRange(cannons);
blocks.AddRange(pits);
blocks.AddRange(spawns);
//blocks.AddRange(spawns);
blocks.AddRange(spikes);
blocks.AddRange(track);
blocks.AddRange(walls);
@ -47,17 +57,7 @@ public class MapSection : MonoBehaviour
public void InitSection(int num)
{
name = num + " " + name;
size = width * length;
blocks = new List<GameObject>();
blocks.AddRange(boulders);
blocks.AddRange(belts);
blocks.AddRange(cannons);
blocks.AddRange(pits);
blocks.AddRange(spawns);
blocks.AddRange(spikes);
blocks.AddRange(track);
blocks.AddRange(walls);
blocks.AddRange(water);
InitSection();
}
public int getSize()

Loading…
Cancel
Save