Beispiel #1
0
    public void setupMenu()
    {
        if (mPlayerOneUI == null)
        {
            spawnPlayerUI(_selectorPrefab1, _selectorPrefab2);
        }

        //RectTransform button = mGrid.getButton(mIndexPlayer1).transform as RectTransform;

        mPlayerOneUI.transform.SetParent(mGrid.getButton(mIndexPlayer1).gameObject.transform);
        mPlayerOneUI.transform.localPosition = Vector3.zero;

        (mPlayerOneUI.transform as RectTransform).sizeDelta = mGrid.getCellSize();

        if (mPlayerTwoUI != null)
        {
            mPlayerTwoUI.transform.SetParent(mGrid.getButton(mIndexPlayer2).gameObject.transform);
            mPlayerTwoUI.transform.localPosition = Vector3.zero;
        }
    }