Esempio n. 1
0
    void CmdUpdateSnakeManager()
    {
        GameObject           snakeManagerInServer = GameObject.FindWithTag("SnakeManagerInServer");
        SnakeManagerInServer snakeManager         = snakeManagerInServer.GetComponent <SnakeManagerInServer>();
        NetworkInstanceId    thisSnakeNetId       = GetComponent <NetworkIdentity>().netId;

        snakeManager.CmdAddSnake(thisSnakeNetId);
        snakeManager.CmdAddBody(thisSnakeNetId, new NetworkInstanceId((uint)snakeHeadNetId));
        snakeManager.CmdAddBody(thisSnakeNetId, new NetworkInstanceId((uint)snakeBodyNetId));
        snakeManager.CmdAddBody(thisSnakeNetId, new NetworkInstanceId((uint)snakeBodySecondNetId));
    }
Esempio n. 2
0
    void CmdAddSnakeBodyInManager(NetworkInstanceId bodyNetId)
    {
        GameObject           snakeManagerInServer = GameObject.FindWithTag("SnakeManagerInServer");
        SnakeManagerInServer snakeManager         = snakeManagerInServer.GetComponent <SnakeManagerInServer>();
        NetworkInstanceId    thisSnakeNetId       = GetComponent <NetworkIdentity>().netId;

        snakeManager.CmdAddBody(thisSnakeNetId, bodyNetId);
    }