Beispiel #1
0
    public void TryEquip(BaseSlotController slot)
    {
        if (slot._Item != null)
        {
            if (slot != currentSlot)
            {
                if (currentSlot != null)
                {
                    if (!(currentSlot._Item as SO_Spell))
                    {
                        lastSlot = currentSlot;
                        (lastSlot as WeaponSlotController).DeSelect();
                    }
                    else
                    {
                        (currentSlot as WeaponSlotController).DeSelect();
                    }
                }

                EquipWeapon(slot);
            }
            else
            {
                UnequipWeapon();
            }
        }
        else
        {
            slot.Blink();
        }
    }
Beispiel #2
0
    public void TargetMoveToBase(NetworkConnection connection)
    {
        for (int i = 0; i < gci.bases[slot].transform.childCount; ++i)
        {
            Transform childTransform = gci.bases[slot].transform.GetChild(i);

            baseSlotController = childTransform.GetComponent <BaseSlotController>();
            if (!baseSlotController.occupied)
            {
                transform.position = childTransform.position;

                //EnableRendering(true);

                if (hasAuthority)
                {
                    CmdEnableRendering(true);
                }

                IsStaged = true;
                baseSlotController.occupied = true;
                currentTileIndex            = startTileIndex;
                CmdMove(transform.position);
                break;
            }
        }
    }
Beispiel #3
0
    public void UnequipWeapon()
    {
        (currentSlot as WeaponSlotController).DeSelect();
        currentSlot = null;

        if (lastSlot != null)
        {
            EquipWeapon(lastSlot);
        }
    }
Beispiel #4
0
    public void EquipWeapon(BaseSlotController slot)
    {
        if (slot == lastSlot)
        {
            lastSlot = null;
        }

        (slot as WeaponSlotController).Select();
        currentSlot = slot;

        var spell = currentSlot._Item as SO_Spell;

        if (spell)
        {
            spellController.currentSpell = spell.activeBlank;
        }
    }