Exemple #1
0
    // Start is called before the first frame update
    void Start()
    {
        foreach (Transform item in items)
        {
            ItemControl control = item.GetComponent <ItemControl>();
            if (control != null)
            {
                if (control.IsChessPiece())
                {
                    GameObject mapItem = Instantiate(prefabMapItemUI, this.transform);
                    mapItem.transform.position = new Vector3(item.position.x, item.position.y, item.position.z);

                    MapCollect collect = mapItem.GetComponent <MapCollect>();
                    if (collect != null)
                    {
                        collect.SetItem(item);
                    }
                }
            }
        }
    }