Browse Source

Dummy spawns for all players

master
MB 5 years ago
parent
commit
2c3f749f75
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      Assets/Scipts/Map.cs

+ 9
- 2
Assets/Scipts/Map.cs View File

@ -5,6 +5,8 @@ using UnityEngine;
public class Map : MonoBehaviour { public class Map : MonoBehaviour {
GameObject LocalPlayer; GameObject LocalPlayer;
List<GameObject> Players = new List<GameObject>();
public GameObject[] Tiles; public GameObject[] Tiles;
public List<GameObject> Landmarks; public List<GameObject> Landmarks;
@ -29,16 +31,21 @@ public class Map : MonoBehaviour {
#region StartupFunctions #region StartupFunctions
private void Start() private void Start()
{ {
LocalPlayer = Multiplayer.PlayersManager.Instance.LocalPlayer;
Players.Add(LocalPlayer);
foreach (GameObject curPlayer in Multiplayer.PlayersManager.Instance.RemotePlayers.Values)
{
Players.Add(curPlayer);
}
//GenerateMap(); //GenerateMap();
CreateDummys(); CreateDummys();
LocalPlayer = Multiplayer.PlayersManager.Instance.LocalPlayer;
} }
//Create dummy players for the world wrapping //Create dummy players for the world wrapping
void CreateDummys() void CreateDummys()
{ {
List<GameObject> Players = new List<GameObject>();
foreach (GameObject Player in Players) foreach (GameObject Player in Players)
{ {
Player PS = Player.GetComponent<Player>(); Player PS = Player.GetComponent<Player>();

Loading…
Cancel
Save