Esempio n. 1
0
    void Start()
    {
        if (isServer)
        {
            RoundManager = FindObjectOfType <RoundNetworking>();
        }

        if (isLocalPlayer)
        {
            CmdIncreaseMoney(1000000);
            CmdSetupStockList();

            GameObject.Find("EndTrading").GetComponent <Button>().onClick.AddListener(CmdEndRound);
        }
    }
Esempio n. 2
0
    // Start is called before the first frame update
    void Start()
    {
        if (!isLocalPlayer)
        {
            foreach (Behaviour behaviour in BehaviorsToDisable)
            {
                behaviour.enabled = false;
            }
        }

        Debug.Log("Is this the local player: " + isLocalPlayer.ToString());
        Debug.Log("Is this a client " + isClient.ToString());
        RoundManager = FindObjectOfType <RoundNetworking>();
        if (isLocalPlayer)
        {
            PlayerHandler = FindObjectOfType <PlayerHandler>();
            PlayerHandler.SetPlayer(GetComponent <PlayerManager>());
        }
        else if (isClient)
        {
            OtherPlayerHandler = FindObjectOfType <OtherPlayersHandler>();
            OtherPlayerHandler.AddPlayer(GetComponent <PlayerManager>());
        }
    }