Esempio n. 1
0
    public void RemovePickUp(PlayerName pName)
    {
        PickUpContainer container = containerObj.Find(x => x.pName == pName);

        if (container != null)
        {
            Destroy(container.transContainer.GetChild(0).gameObject);
        }
    }
Esempio n. 2
0
    public void AddPickUp(PlayerName pName, Veggies vName)
    {
        PickUpContainer container = containerObj.Find(x => x.pName == pName);

        if (container != null)
        {
            GameObject newPickUp = Instantiate(pickUpUIPrefab);
            newPickUp.transform.GetComponentInChildren <Text> ().text = vName.ToString();
            newPickUp.transform.SetParent(container.transContainer, false);
        }
    }
Esempio n. 3
0
    public void RemoveAllPickUp(PlayerName pName)
    {
        PickUpContainer container = containerObj.Find(x => x.pName == pName);

        if (container != null)
        {
            int cnt = container.transContainer.childCount;
            foreach (Transform item in container.transContainer.transform)
            {
                Destroy(item.gameObject);
            }
        }
    }