// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.SpatialAwareness
{
///
/// Data for spatial awareness events.
///
public class MixedRealitySpatialAwarenessEventData : GenericBaseEventData
{
///
/// Identifier of the object associated with this event.
///
public int Id { get; private set; }
///
/// Constructor.
///
public MixedRealitySpatialAwarenessEventData(EventSystem eventSystem) : base(eventSystem) { }
///
/// Initialize the event data.
///
/// The that raised the event.
/// The identifier of the observed spatial object.
public void Initialize(IMixedRealitySpatialAwarenessObserver observer, int id)
{
BaseInitialize(observer);
Id = id;
}
}
///
/// Data for spatial awareness events.
///
/// The spatial object data type.
public class MixedRealitySpatialAwarenessEventData : MixedRealitySpatialAwarenessEventData
{
///
/// The spatial object to which this event pertains.
///
public T SpatialObject { get; private set; }
///
public MixedRealitySpatialAwarenessEventData(EventSystem eventSystem) : base(eventSystem) { }
///
/// Initialize the event data.
///
/// The that raised the event.
/// The identifier of the observed spatial object.
/// The observed spatial object.
public void Initialize(IMixedRealitySpatialAwarenessObserver observer, int id, T spatialObject)
{
Initialize(observer, id);
SpatialObject = spatialObject;
}
}
}