Beispiel #1
0
 public void StartDragging(PlayerData _data)
 {
     selectedPlayer = _data;
     draggingObject.Populate(_data);
     draggingObject.gameObject.SetActive(true);
     IsDragging = true;
 }
    public void Populate(PlayerData[] _list)
    {
        if (list != null)
        {
            foreach (SquadSubView sub in list)
            {
                Destroy(sub.gameObject);
            }
        }

        list = new List <SquadSubView>();
        for (int i = 0; i < _list.Length; i++)
        {
            SquadSubView slot = Instantiate(subTemplate, transform);
            slot.Populate(_list[i]);
            list.Add(slot);
        }
    }