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(); } }
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; } } }
public void UnequipWeapon() { (currentSlot as WeaponSlotController).DeSelect(); currentSlot = null; if (lastSlot != null) { EquipWeapon(lastSlot); } }
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; } }