Ejemplo n.º 1
0
        void Update()
        {
            ActionButton    action    = LegacyInputManager.GetPressedActionButton();
            DirectionButton dir       = m_animationController.GetLastAnimationDirection();
            Vector3         dirVector = LegacyInputManager.GetDirectionButtonVector(dir);
            RaycastHit2D    hit       = CheckInteractableRaycast(dirVector);

            if (!hit || !hit.collider || !hit.collider.gameObject.HasComponent <Interactable>())
            {
                Debug.DrawRay(transform.position, dirVector, Color.red);
                Debug.DrawRay(transform.position, hit.point, Color.blue);
                return;
            }

            Debug.DrawRay(transform.position, dirVector, Color.green);
            Debug.DrawRay(transform.position, hit.point, Color.blue);

            hit.collider.gameObject.GetComponent <Interactable>()
            .Interact(new InteractionContext(dir, action, m_DialogManager));
        }
Ejemplo n.º 2
0
        public void UpdateAnimation(DirectionButton dir)
        {
            var pos = LegacyInputManager.GetDirectionButtonVector(dir);

            UpdateAnimation(pos, pos);
        }