Esempio n. 1
0
    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;
    }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
    public void StopDraggingUI()
    {
        DisableVisualEffects();

        if (state == InteractionStates.Neutral)
        {
            return;
        }

        DetectObjectRaycast();

        state = InteractionStates.Neutral;
    }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
    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");
    }
Esempio n. 6
0
    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();
            }
        }
    }
Esempio n. 7
0
 public void SetState(InteractionStates stateId)
 {
     Debug.Log("changing to" + stateId);
     _interactionMachine.SetState(stateId);
 }
Esempio n. 8
0
    public void StartDraggingUI()
    {
        state = InteractionStates.Dragging;

        EnableVisualEffects();
    }
Esempio n. 9
0
 private void Awake()
 {
     GetMissingVariables();
     currentUIElement = null;
     state            = InteractionStates.Neutral;
 }