Exemple #1
0
    public void loadFromNetworkFieldData(NetworkFieldData data)
    {
        mortgage = data.mortgage;
        if (data.ownerID == -1)
        {
            return;
        }

        owner = GameController.instance.getPlayers().Find(s => s.getPlayerID() == data.ownerID);
        var playerColor = owner.gameObject.GetComponent <MeshRenderer>().sharedMaterial;
        var outline     = transform.GetChild(0);

        outline.gameObject.GetComponent <MeshRenderer>().sharedMaterial = playerColor;
        outline.gameObject.SetActive(true);
        gameObject.transform.GetChild(1).gameObject.SetActive(mortgage);
    }
Exemple #2
0
    public void loadField(NetworkFieldData data)
    {
        var field = Array.Find(GameObject.FindObjectsOfType <NetworkField>(), s => s.getName() == data.courseName);

        field.loadFromNetworkFieldData(data);
    }