Пример #1
0
 /// <summary>
 /// Process the given windows event from the camera.
 /// </summary>
 /// <param name="e">The windows event to be processed.</param>
 /// <param name="type">The type of windows event being processed.</param>
 /// <param name="camera">The camera from which to process the windows event.</param>
 /// <param name="canvas">The source of the windows event being processed.</param>
 public virtual void ProcessEventFromCamera(EventArgs e, PInputType type, PCamera camera, PCanvas canvas)
 {
     nextInput         = e;
     nextType          = type;
     nextInputSource   = camera;
     nextWindowsSource = canvas;
     camera.Root.ProcessInputs();
 }
Пример #2
0
        /// <summary>
        /// Dispatch the given PInputEvent to the given pick path.
        /// </summary>
        /// <param name="e">A PInputEventArgs that contains the event data.</param>
        /// <param name="type">The type of PInputEvent being dispatched.</param>
        /// <param name="path">The pick path to which the PInputEvent will be dispatched.</param>
        public virtual void DispatchToPath(PInputEventArgs e, PInputType type, PPickPath path)
        {
            if (path != null)
            {
                //set the type and clear the handled bit since the same event object is
                //used to send multiple events such as mouseEntered/mouseExited and mouseMove.
                e.Type    = type;
                e.Handled = false;

                path.ProcessEvent(e);
            }
        }
Пример #3
0
    public static void RegisterInputAction(PInput input, PInputType type, System.Action <float> action)
    {
        List <PlayerInputSender> inputListeners = senders.FindAll(o => o.InputType == input);

        if (inputListeners.Count > 0)
        {
            foreach (PlayerInputSender pis in inputListeners)
            {
                pis.setup(type, action);
            }
        }
        else
        {
            Debug.Log("No input senders of such type: " + input.ToString());
        }
    }
Пример #4
0
    protected void setup(PInputType type, System.Action <float> action)
    {
        switch (type)
        {
        case PInputType.FOCUS:
            onInput += action;
            break;

        case PInputType.GAINED_FOCUS:
            onInputDown += action;
            break;

        case PInputType.LOST_FOCUS:
            onInputUp += action;
            break;
        }
    }
Пример #5
0
		/// <summary>
		/// Process the given windows event from the camera.
		/// </summary>
		/// <param name="e">The windows event to be processed.</param>
		/// <param name="type">The type of windows event being processed.</param>
		/// <param name="camera">The camera from which to process the windows event.</param>
		/// <param name="canvas">The source of the windows event being processed.</param>
		public virtual void ProcessEventFromCamera(EventArgs e, PInputType type, PCamera camera, PCanvas canvas) {
			nextInput = e;
			nextType = type;
			nextInputSource = camera;
			nextWindowsSource = canvas;
			camera.Root.ProcessInputs();
		}
Пример #6
0
		/// <summary>
		/// Dispatch the given PInputEvent to the given pick path.
		/// </summary>
		/// <param name="e">A PInputEventArgs that contains the event data.</param>
		/// <param name="type">The type of PInputEvent being dispatched.</param>
		/// <param name="path">The pick path to which the PInputEvent will be dispatched.</param>
		public virtual void DispatchToPath(PInputEventArgs e, PInputType type, PPickPath path) {
			if (path != null) {
				//set the type and clear the handled bit since the same event object is
				//used to send multiple events such as mouseEntered/mouseExited and mouseMove.
				e.Type = type;
				e.Handled = false;

				path.ProcessEvent(e);
			}
		}
		/// <summary>
		/// Constructs a new PInputEventArgs
		/// </summary>
		/// <param name="inputManager">The input manager that dispatched this event.</param>
		/// <param name="e">An EventArgs that contains the event data.</param>
		/// <param name="type">The type of input event.</param>
		public PInputEventArgs(PInputManager inputManager, EventArgs e, PInputType type) {
			this.inputManager = inputManager;
			this.e = e;
			this.type = type;
		}
Пример #8
0
 /// <summary>
 /// Constructs a new PInputEventArgs
 /// </summary>
 /// <param name="inputManager">The input manager that dispatched this event.</param>
 /// <param name="e">An EventArgs that contains the event data.</param>
 /// <param name="type">The type of input event.</param>
 public PInputEventArgs(PInputManager inputManager, EventArgs e, PInputType type)
 {
     this.inputManager = inputManager;
     this.e            = e;
     this.type         = type;
 }