public void OnDrop(PointerEventData data) { InputMovement.isDragging = false; if (data.pointerDrag != null && data.pointerDrag.GetComponent <AbilityScreenIcon>() != null) { var ability = data.pointerDrag.GetComponent <AbilityScreenIcon>().ability; if (slot == 1 && abilityMenu.fusionSource2 != ability) { abilityMenu.fusionSource1 = (ActiveAbility)ability; abilityMenu.fusionSourceSlot1 = -1; } else if (slot == 2 && abilityMenu.fusionSource1 != ability) { abilityMenu.fusionSource2 = (ActiveAbility)ability; abilityMenu.fusionSourceSlot2 = -1; } else { return; } GetComponent <AbilityScreenIcon>().Initialize(ability); CheckAndUpdate(); abilityMenu.UpdateAbilities(); abilityMenu.ResetFusionChoices(); } else if (data.pointerDrag != null && data.pointerDrag.GetComponent <MouseOverHotbarButton>() != null) { var abilities = PlayerCharacter.localPlayer.GetComponent <AbilityUser>().soulGemActives; var num = data.pointerDrag.GetComponent <MouseOverHotbarButton>().number; var ability = abilities[num]; if (slot == 1) { abilityMenu.fusionSource1 = ability; abilityMenu.fusionSourceSlot1 = num; } else if (slot == 2) { abilityMenu.fusionSource2 = ability; abilityMenu.fusionSourceSlot2 = num; } else { return; } GetComponent <AbilityScreenIcon>().Initialize(ability); CheckAndUpdate(); abilityMenu.UpdateAbilities(); abilityMenu.ResetFusionChoices(); } }
public void OnEndDrag(PointerEventData eventData) { InputMovement.isDragging = false; if (!draggable) { return; } PlayerCharacter.localPlayer.GetComponent <HotbarUser>().CmdRefreshAbilityInfo(); abilityScreen.UpdateAbilities(); Destroy(gameObject); }