public void CloseAbilitySelectionWheel(HackerHand hand) { AbilitySelectionWheel wheel = selectionWheels[(int)hand]; if (wheel == null) { return; // already closed } Destroy(wheel.gameObject); selectionWheels[(int)hand] = null; }
public void SetAbilitySelectionPosition(HackerHand hand, Vector2 position) { AbilitySelectionWheel wheel = selectionWheels[(int)hand]; if (wheel == null) { return; // not open } if (hand == HackerHand.Left) { // mirror input position.x = -position.x; } wheel.SetPreviewPosition(position); }
private IEnumerator _ConfirmCoroutineHelper(HackerHand hand, Vector2 position) { yield return(null); // delay by one frame AbilitySelectionWheel wheel = selectionWheels[(int)hand]; if (wheel == null) { yield break; // not open } AbilityType?newAbility = wheel.ConfirmSelection(position); if (newAbility != null) { EquipAbility(hand, newAbility.Value); //CloseAbilitySelectionWheel(hand); } }