Browse Source

Fix the spawning getting the right pen at the start of the game

Josh_Dev_branch
Claire Peta 5 years ago
parent
commit
3298be6569
6 changed files with 16 additions and 17 deletions
  1. +2
    -2
      Assets/Data/Map Generation/Map Manager.asset
  2. +2
    -2
      Assets/Scenes/GameMode Scenes/RacetrackGameMode.unity
  3. +1
    -2
      Assets/Scripts/GameMode/ColorGameMode/RacetrackGameMode.cs
  4. +1
    -1
      Assets/Scripts/GameMode/ColorGameMode/RoundsLeft.cs
  5. +6
    -9
      Assets/Scripts/Map Generation/MapManager.cs
  6. +4
    -1
      Assets/Scripts/Map Generation/MapManager.cs.meta

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

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:b6b048d7cd1d636b7d5c6eb9ab640eeec39d921f03df1ea868af25f2c72ae5f9
size 901
oid sha256:622bffe7b746c4cdf6ed74274b6b09dc3ec7066d4fc03abb09ab0d1e544ce394
size 1089

+ 2
- 2
Assets/Scenes/GameMode Scenes/RacetrackGameMode.unity View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:39df638172c07d5d3aaf8f76028a3f49445d7a18bb3e18d8956797a2587d6e63
size 25929
oid sha256:6f72ca2d694b49cd62ecf0fc314aa95d9e4f6a5aac8dcff71b4d2544334a7396
size 7092

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

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

+ 1
- 1
Assets/Scripts/GameMode/ColorGameMode/RoundsLeft.cs View File

@ -33,7 +33,7 @@ public class RoundsLeft : MonoBehaviour
[ContextMenu("Do Animation")] [ContextMenu("Do Animation")]
public void StartAnimation() public void StartAnimation()
{ {
UpdateText();
//UpdateText();
Vector3 startPosition = new Vector3(Screen.width * 2, 0, 0); Vector3 startPosition = new Vector3(Screen.width * 2, 0, 0);

+ 6
- 9
Assets/Scripts/Map Generation/MapManager.cs View File

@ -1,4 +1,6 @@
using System.Collections;
using Networking.Client;
using Networking.Server;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
@ -6,6 +8,7 @@ using UnityEngine;
[CreateAssetMenu(menuName = "Major Project/Map Manager")] [CreateAssetMenu(menuName = "Major Project/Map Manager")]
public class MapManager : ScriptableObject public class MapManager : ScriptableObject
{ {
public ClientList clients;
public GameObject spawn4; //The section to use as a spawn-point for games with 2-5 players public GameObject spawn4; //The section to use as a spawn-point for games with 2-5 players
public GameObject spawn8; //The section to use a spawn-point for games with 5-8 players public GameObject spawn8; //The section to use a spawn-point for games with 5-8 players
//In 5-player games, we choose between them at random //In 5-player games, we choose between them at random
@ -20,15 +23,9 @@ public class MapManager : ScriptableObject
float startX = -16.0f; //The x-position of the current start of the track float startX = -16.0f; //The x-position of the current start of the track
float endX = -16.0f; //The x-position of the current end of the track float endX = -16.0f; //The x-position of the current end of the track
// Start is called before the first frame update
void Start()
{
}
public void init(int players)
public void init()
{ {
int players = clients.ConnectedClients.Count;
activeSections = new List<MapSection>(); activeSections = new List<MapSection>();
if (players < 5) if (players < 5)

+ 4
- 1
Assets/Scripts/Map Generation/MapManager.cs.meta View File

@ -3,7 +3,10 @@ guid: 410315ba4dbcba04a90c22b64b070d6a
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
defaultReferences: []
defaultReferences:
- clients: {fileID: 11400000, guid: 78d89605739516c4f9c66fb270137102, type: 2}
- spawn4: {instanceID: 0}
- spawn8: {instanceID: 0}
executionOrder: 0 executionOrder: 0
icon: {instanceID: 0} icon: {instanceID: 0}
userData: userData:

Loading…
Cancel
Save