예제 #1
0
        protected void Start()
        {
            if (AttachedInteractable != null)
            {
                _interactable = AttachedInteractable.GetComponent <IInteractableInterface>();
            }

            if (_interactable == null)
            {
                Debug.LogError("Failed to retrieve attached interactable!");
            }
        }
예제 #2
0
        private void UpdateInteractionStatus()
        {
            var mostDesirableInteractable = GetMostDesirableInteractable();
            var canStillInteract          = mostDesirableInteractable != null;

            if (mostDesirableInteractable != ActiveInteractable)
            {
                ActiveInteractable = mostDesirableInteractable;
                UnityMessageEventFunctions.InvokeMessageEventWithDispatcher(gameObject, new ActiveInteractableUpdatedMessage(ActiveInteractable));
            }
            if (canStillInteract != _interactionPossible)
            {
                _interactionPossible = canStillInteract;
                UnityMessageEventFunctions.InvokeMessageEventWithDispatcher(gameObject, new InteractionStatusUpdatedMessage(_interactionPossible));
            }
        }
예제 #3
0
 public ActiveInteractableUpdatedUIMessage(IInteractableInterface inUpdatedInteractable)
 {
     UpdatedInteractable = inUpdatedInteractable;
 }
예제 #4
0
 public void RemoveActiveInteractable(IInteractableInterface inInteractableInterface)
 {
     _possibleActiveInteractables.Remove(inInteractableInterface);
 }
예제 #5
0
 // IInteractionInterface
 public void AddActiveInteractable(IInteractableInterface inInteractableInterface)
 {
     _possibleActiveInteractables.Add(inInteractableInterface);
 }
예제 #6
0
 public void RemoveActiveInteractable(IInteractableInterface inInteractableInterface)
 {
     RemoveActiveInteractableResult = inInteractableInterface;
 }
예제 #7
0
 public void AddActiveInteractable(IInteractableInterface inInteractableInterface)
 {
     AddActiveInteractableResult = inInteractableInterface;
 }