Пример #1
0
        void Update()
        {
            CurrentInteractable = FindClosestInteractableObject();
            if (CurrentInteractable != null)
            {
                CurrentInteractable.Selected = true;
                //AnimateInteration();
            }
            if ((lastinteractableObject != null) && (lastinteractableObject != CurrentInteractable))
            {
                lastinteractableObject.Selected = false;
            }
            lastinteractableObject = CurrentInteractable;

            bool inputBool = Input.GetKeyDown("e");

            if ((inputBool) && (CurrentInteractable != null))
            {
                if (!DialogueManager.main.Animating)
                {
                    CurrentInteractable.RequesCurrentDialogue();
                    CurrentInteractable.TickTowardsNextDialogue();
                    CurrentInteractable.CallAction(this.gameObject);
                }
                else
                {
                    DialogueManager.main.AbortDialogue();
                }
            }
        }