示例#1
0
 void CallMouseInteractionEvents(Collider col, InteractionEventType eventType)
 {
     if (interactionEvents.ContainsKey(col) && interactionEvents[col] != null)
     {
         interactionEvents[col](eventType);
     }
 }
        public override void Intercept(IInteraction a_interaction, InteractableCollection a_interactableCollection,
                                       InteractionEventType a_interactionType, int a_identifier = int.MinValue)
        {
            TInteractable interactable = a_interactableCollection.LocateInteractable <TInteractable>(a_eventType: a_interactionType, a_identifier: a_identifier);

            OnIntercept((TInteraction)a_interaction, (TInteractable)interactable);
        }
 public void Notify(InteractionEventType eventType, Skill skill)
 {
     _mediator.Publish(new SkillInteractiondNotificationMessage
     {
         AffectedSkill = skill,
         EventType     = eventType,
         UpdateTime    = DateTime.Now
     });
 }
示例#4
0
        //public abstract void Invoke(InteractableCollection a_unit, int a_identifier = 0);

        protected TInteractable LocateInteractable(InteractableCollection a_interactableCollection,
                                                   int a_identifier,
                                                   InteractionEventType a_interactionType = null)
        {
            if (a_interactableCollection == null)
            {
                throw new System.NullReferenceException("can't locate interactable from null collection");
            }
            return(a_interactableCollection.LocateInteractable <TInteractable>(a_eventType: a_interactionType, a_identifier: a_identifier));
        }
示例#5
0
        // Invoke Interaction with provided interactables
        public void Invoke(InteractableCollection a_interactableCollection, InteractionEventType a_interactionType = null,
                           int a_identifier = int.MinValue, InteractableCollection a_invokerInteractables = null)
        {
            TInteractable interactable = LocateInteractable(a_interactableCollection, a_identifier, a_interactionType);

            if (interactable != null)
            {
                OnInvoke(interactable, a_interactableCollection, a_invokerInteractables);
            }
        }
 public InteractionEvent(InteractionEventType type, Vector3 targetPoint)
 {
     this.type = type;
     this.targetPoint = targetPoint;
 }
 public InteractionEvent(InteractionEventType type, GameObject targetObject)
 {
     this.type = type;
     this.targetObject = targetObject;
 }
 public InteractionEvent(InteractionEventType type, GameObject targetObject, Vector3 targetPoint)
 {
     this.type = type;
     this.targetObject = targetObject;
     this.targetPoint = targetPoint;
 }
 public InteractionEvent(InteractionEventType type, Unit targetUnit)
 {
     this.type = type;
     this.targetUnit = targetUnit;
 }
示例#10
0
 public static void doClickUnit(InteractionEventType iet, Unit targetUnit, Vector3 clickPoint)
 {
     if (Instance.ClickUnit != null) Instance.ClickUnit(new InteractionEvent(iet, targetUnit, clickPoint));
 }
示例#11
0
 public static void doClickObject(InteractionEventType iet, GameObject targetUnit, Vector3 clickPoint)
 {
     if (Instance.MouseExitObject != null) Instance.MouseExitObject(new InteractionEvent(iet, targetUnit, clickPoint));
 }
示例#12
0
 public abstract void Intercept(IInteraction a_interaction, InteractableCollection a_interactableCollection,
                                InteractionEventType a_interactionType, int a_identifier);