Example #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);
    }
Example #2
0
    void RpcRespawn()
    {
        if (isLocalPlayer)
        {
            // move back to zero location

            transform.position = Vector3.zero;



            currentHealth = maxHealth;
        }

        ConsoleGlobal.Log(gameObject.GetComponent <PlayerController>().nick + " died");
    }
Example #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;
    }
Example #4
0
 void Awake()
 {
     e = this;
 }
Example #5
0
 void RpcSendChat(string what)
 {
     ConsoleGlobal.Log(what);
 }
Example #6
0
    public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId)
    {
        ConsoleGlobal.Log("Player has connected: " + conn.address + " : " + playerControllerId);

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

        client = this;
    }