private IEnumerator ChannelingTime() { state = InteractionStates.CHANNELING; if (_animator != null) { _animator.Play("ChannelingAnimation"); } yield return(new WaitForSeconds(_channelingTime)); if (state == InteractionStates.CHANNELING) { state = InteractionStates.COMPLETED; DestroyText(0); DestroyText(1); // Notify object _interaction.Completed(); // Start completed animation } _runningThread = null; }
public bool AttractMyAttention_ToBot(Bot target, bool force, InteractionStates interactionState = InteractionStates.Interactor) { if (IsWithinInteractionDistance(target.transform) || target.IsWithinInteractionDistance(transform)) { if (ChangeInteractionState(interactionState, force)) { FocusOnTransform(target.transform); //CurrentInteractionState = interactionState; return(true); } } return(false); }
public void StopDraggingUI() { DisableVisualEffects(); if (state == InteractionStates.Neutral) { return; } DetectObjectRaycast(); state = InteractionStates.Neutral; }
private bool ChangeInteractionState(InteractionStates interactionState, bool force) { if (interactionState == InteractionStates.NotInteracting) { CurrentInteractionState = interactionState; ResetInteractionCooldown(); return(true); } else if (force || Time.time > m_CanInteractFromTime) { CurrentInteractionState = interactionState; return(true); } return(false); }
private void StopChanneling() { if (_runningThread != null) { StopCoroutine(_runningThread); } _runningThread = null; _interaction.Cancel(); state = InteractionStates.INTERACTABLE; if (_animator != null) { _animator.Rebind(); } SetText(0, "Interact"); SetText(1, "Interact"); }
private void Update() { if (state == InteractionStates.INTERACTABLE) { bool pOne = _playerColliders[0] && InputManager.IsInteracting(true); if (pOne || (_playerColliders[1] && InputManager.IsInteracting(false))) { StartChanneling(pOne); // Start channeling animation } } else if (state == InteractionStates.CHANNELING) { if (PlayerStoppedChanneling(true) || PlayerStoppedChanneling(false)) { state = InteractionStates.INTERACTABLE; // Cancel channeling StopChanneling(); } } }
public void SetState(InteractionStates stateId) { Debug.Log("changing to" + stateId); _interactionMachine.SetState(stateId); }
public void StartDraggingUI() { state = InteractionStates.Dragging; EnableVisualEffects(); }
private void Awake() { GetMissingVariables(); currentUIElement = null; state = InteractionStates.Neutral; }