// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using UnityEngine; using UnityEngine.EventSystems; namespace Microsoft.MixedReality.Toolkit.Input { /// /// Describes an Input Event associated with a specific pointer's focus state change. /// public class FocusEventData : BaseEventData { /// /// The pointer associated with this event. /// public IMixedRealityPointer Pointer { get; private set; } /// /// The old focused object. /// public GameObject OldFocusedObject { get; private set; } /// /// The new focused object. /// public GameObject NewFocusedObject { get; private set; } /// public FocusEventData(EventSystem eventSystem) : base(eventSystem) { } /// /// Used to initialize/reset the event and populate the data. /// public void Initialize(IMixedRealityPointer pointer) { Reset(); Pointer = pointer; } /// /// Used to initialize/reset the event and populate the data. /// public void Initialize(IMixedRealityPointer pointer, GameObject oldFocusedObject, GameObject newFocusedObject) { Reset(); Pointer = pointer; OldFocusedObject = oldFocusedObject; NewFocusedObject = newFocusedObject; } } }