Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    void RpcRespawn()
    {
        if (isLocalPlayer)
        {
            // move back to zero location

            transform.position = Vector3.zero;



            currentHealth = maxHealth;
        }

        ConsoleGlobal.Log(gameObject.GetComponent <PlayerController>().nick + " died");
    }
Ejemplo n.º 3
0
    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;
    }
Ejemplo n.º 4
0
 void RpcSendChat(string what)
 {
     ConsoleGlobal.Log(what);
 }
Ejemplo n.º 5
0
    public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId)
    {
        ConsoleGlobal.Log("Player has connected: " + conn.address + " : " + playerControllerId);

        base.OnServerAddPlayer(conn, playerControllerId);
    }
Ejemplo n.º 6
0
    public override void OnStartLocalPlayer()
    {
        ConsoleGlobal.Log("Welcome! Please, set you nick by using \\nick [yourName]");

        client = this;
    }