예제 #1
0
 /// <summary>
 /// Default constructor that should cover most use cases.
 /// </summary>
 /// <param name="kind">The kind of event being triggered.</param>
 /// <param name="sender">The `GameObject` that sends the event.</param>
 /// <param name="player">The player `GameObject` that triggered the event.</param>
 public InteractionEvent(InteractionKind kind, GameObject sender, GameObject player)
 {
     this.kind          = kind;
     this.sender        = sender;
     this.player        = player;
     this.worldPosition = Vector3.zero;
     this.worldNormal   = Vector3.zero;
     this.forwardTo     = null;
     this.waitFor       = null;
     this.runWhile      = null;
 }
예제 #2
0
 /// <summary>>
 /// Builder method for adding `waitFor`
 /// </summary>
 /// <param name="value">The receiver that any further events should be forwarded to</param>
 /// <returns>This `InteractionEvent`</returns>
 public InteractionEvent WaitFor(InteractionReceiver value)
 {
     waitFor = value;
     return(this);
 }
예제 #3
0
 /// <summary>>
 /// Builder method for adding `forwardTo`
 /// </summary>
 /// <param name="value">Any receiver that need to finish before this event can be handled</param>
 /// <returns>This `InteractionEvent`</returns>
 public InteractionEvent ForwardTo(InteractionReceiver value)
 {
     forwardTo = value;
     return(this);
 }