/// <summary> /// Creates a NetPlayer for a client when a round restarts. /// </summary> /// <param name="netId">The id of the player.</param> /// <param name="name">The name of the player.</param> /// <returns>The position of the newly created player.</returns> public Vector2 CreateNetPlayer(byte netId, string name) { PlayerManager player = ComponentFactory.CreateNetPlayer(netId, name); NetSyncComponent.TriggerClientEvent("CP", netId, name); Vector2 location = spawnLocations.GetRandomLocation(); player.Actor.GetComponent <Transform2>().WorldPosition = location; return(location); }
public void CreateNetPlayer(byte netId, string name) { ComponentFactory.CreateNetPlayer(netId, name); }