Esempio n. 1
0
    private void Start()
    {
        collectableItems = GetComponentInChildren <CollectableItems>();

        Canvas        = GameObject.Find("Canvas");
        cellContainer = Instantiate(cellContainerPrefab, Canvas.transform.position, Quaternion.identity) as GameObject;
        cellContainer.transform.SetParent(Canvas.transform);

        items = new List <ItemBase>();
        for (int i = 0; i < cellContainer.transform.childCount; i++)
        {
            items.Add(cellContainer.transform.GetChild(i).GetComponent <ItemBase>());
        }
        cellContainer.SetActive(false);
    }
Esempio n. 2
0
    private void Start()
    {
        сollectableItems = GetComponentInChildren <CollectableItems>();

        Canvas = GameObject.Find("Canvas");

        cellContainer = Instantiate(cellContainerPrefab, Canvas.transform.position, Quaternion.identity) as GameObject;
        cellContainer.transform.SetParent(Canvas.transform);

        MessageManager = Instantiate(MessageManagerPrefab, new Vector3(150, 270, 0), Quaternion.identity) as GameObject;
        MessageManager.transform.SetParent(Canvas.transform);

        items = new List <ItemBase>();
        for (int i = 0; i < cellContainer.transform.childCount; i++)
        {
            items.Add(new ItemBase());
        }
        cellContainer.SetActive(false);

        for (int i = 0; i < cellContainer.transform.childCount; i++)
        {
            cellContainer.transform.GetChild(i).GetComponent <CurrentItem>().index = i;
        }
    }