Esempio n. 1
0
    public GameObject createPrefab(Transform parent = null)
    {
        Transform go = Instantiate(prefab);
        PlayerHandLayoutController phlc = parent.GetComponent <PlayerHandLayoutController>();

        if (phlc != null)
        {
            phlc.addItem(go.gameObject);
        }
        else
        {
            go.SetParent(parent);
        }
        return(go.gameObject);
    }
Esempio n. 2
0
    public GameObject createPrefab(Transform parent = null)
    {
        GameObject go = MonoBehaviour.Instantiate(prefab).gameObject;
        PlayerHandLayoutController phlc = parent.GetComponent <PlayerHandLayoutController>();

        if (phlc != null)
        {
            phlc.addItem(go);
        }
        else
        {
            go.transform.SetParent(parent);
        }
        go.GetComponent <CardObject>().card = this;
        return(go);
    }