Esempio n. 1
0
    void Update()
    {
        if (isLocalPlayer)
        {
            if (Input.GetKeyDown(KeyCode.G))
            {
                ChatScript.ChatLocally("G key pressed! " + hl.local_uId);
            }

            Cl_Orders.InputOrders();            //detect keyboard & mouse input, as orders, and send them to the server
        }

        if (isServer)
        {
            hl.svTime = Time.realtimeSinceStartup; //This is the server. Update this every frame
            ServerSideLoop.UpdateServer();
            Ticks.HandleTicks();                   //Send out ticks
        }

        if (isClient)
        {
            ClientSideLoop.UpdateClient();
        }
    }