void CmdSpawnInFront(GameObject prefab) { Debug.Log("CmdSpawnInFront begin"); // TODO: check if it has authority Vector3 position = head.position + head.forward * 2; var go = Instantiate(prefab, position, head.rotation) as GameObject; NetworkServer.Spawn(go); ConsoleGlobal.Log(nick + " has spawned " + prefab.name, true); }
void RpcRespawn() { if (isLocalPlayer) { // move back to zero location transform.position = Vector3.zero; currentHealth = maxHealth; } ConsoleGlobal.Log(gameObject.GetComponent <PlayerController>().nick + " died"); }
public override void OnStartClient() { base.OnStartClient(); ConsoleGlobal.Log("Client started!"); if (!isLocalPlayer) { return; } ConsoleGlobal.Log("Client started and is local player!"); //ConsoleGlobal.Log("Local player started!"); client = this; }
void RpcSendChat(string what) { ConsoleGlobal.Log(what); }
public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId) { ConsoleGlobal.Log("Player has connected: " + conn.address + " : " + playerControllerId); base.OnServerAddPlayer(conn, playerControllerId); }
public override void OnStartLocalPlayer() { ConsoleGlobal.Log("Welcome! Please, set you nick by using \\nick [yourName]"); client = this; }