예제 #1
0
파일: TownMenu.cs 프로젝트: zakattak/Timbre
    private void AddThreadToSlots(AllyInfo parent, ThreadButtonGroup group)
    {
        var newEthread = Instantiate(group.threadPrefab, new Vector2(0, 0), Quaternion.identity);

        newEthread.transform.SetParent(parent.threadCapacityGroup);
        parent.capacity.Add(newEthread);

        RefreshSlots(parent);

        partyInfoDict[parent].GetComponent <GridEntity>().equippedThreads.Add(newEthread.GetComponent <Ethread>());

        group.quantity--;
    }
예제 #2
0
    private void RemoveThreadFromSlot(int index, AllyInfo parent, ThreadButtonGroup group)
    {
        var ethreadToRemove = parent.capacity[index];

        parent.capacity.Remove(ethreadToRemove);

        RefreshSlots(parent);

        partyInfoDict[parent].GetComponent <GridEntity>().equippedThreads.Remove(ethreadToRemove.GetComponent <Ethread>());
        Destroy(ethreadToRemove);

        group.quantity++;
    }