Beispiel #1
0
    private IEnumerator MakeDataPanel(ObjectData data, Vector3 position, Quaternion rotation)
    {
        yield return(new WaitForSeconds(0));

        Debug.Log("make a data panel");

        GameObject dataPanel = GameObject.Instantiate(dataPanelPrefab, position, rotation);

        dataPanel.transform.localPosition = position;

        Transform window = dataPanel.transform.Find("SF Window");

        Transform       titleLbl  = window.Find("Title");
        TextMeshProUGUI titleMesh = titleLbl.GetComponent <TextMeshProUGUI>();

        titleMesh.text = data.name;

        Transform icons = window.Find("Icons");

        PopulateGrid populateGrid = icons.GetComponent <PopulateGrid>();

        populateGrid.scores[0] = data.carbonScore;
        populateGrid.scores[1] = data.waterScore;
        populateGrid.scores[2] = data.landScore;
        populateGrid.Populate();
    }
Beispiel #2
0
    private void Start()
    {
        turnState = TTurnState.COMPOSING;

        rows = GameManager.Instance.ReturnRows();

        //cells = new GameObject[rows];

        grid = GameObject.FindGameObjectWithTag("Grid").GetComponent <PopulateGrid>();

        grid.Populate(rows);

        if (GameManager.Instance.getPlayerinTurn() == 1)
        {
            GameManager.Instance.UpdateText("p1");
        }
        else
        {
            GameManager.Instance.UpdateText("p2");
        }
    }