Exemple #1
0
    void Update()
    {
        // more to be added based on need

        if (Input.GetKeyDown(PAUSE))
        {
            OnPause?.Invoke();
        }

        if (!DialogueManager.InConversation && !TimelineController.InCutscene)
        {
            Horizontal = Input.GetAxisRaw("Horizontal");
            Vertical   = Input.GetAxisRaw("Vertical");
            if (Input.GetKeyDown(INTERACT))
            {
                OnInteract?.Invoke();
            }
            if (Input.GetKeyUp(INTERACT))
            {
                OnStopInteract?.Invoke();
            }
            if (!EventSystem.current.IsPointerOverGameObject())
            {
                if (Input.GetMouseButtonDown(0))
                {
                    OnMouseClickLeft?.Invoke();
                }
                if (Input.GetMouseButtonDown(1))
                {
                    OnMouseClickRight?.Invoke();
                }
                if (Input.GetMouseButtonUp(0))
                {
                    OnMouseUpLeft?.Invoke();
                }
                if (Input.GetMouseButtonUp(1))
                {
                    OnMouseUpRight?.Invoke();
                }
            }
        }
        else
        {
            Horizontal = 0;
            Vertical   = 0;

            if (Input.GetKeyDown(INTERACT) || Input.GetKeyDown(KeyCode.Space))
            {
                OnNextDialogue?.Invoke();
            }
        }

        int scrollDirection = (int)Input.mouseScrollDelta.y;

        if (scrollDirection != 0)
        {
            OnScroll?.Invoke(scrollDirection);
        }
    }
 public virtual void StopInteract()
 {
     OnStopInteract?.Invoke(this);
 }
Exemple #3
0
 private void OnInteractableStopInteraction(ITInteractable interactable)
 {
     _interactionState            = TInteractionState.None;
     interactable.OnStopInteract -= OnInteractableStopInteraction;
     OnStopInteract?.Invoke(Master, interactable);
 }