// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using UnityEngine; using UnityEngine.EventSystems; namespace Microsoft.MixedReality.Toolkit { /// /// This is a helper class to allow you to call OnSubmit() on a UnityEngine.UI.Button or other control derived from UnityEngine.EventSystems.ISubmitHandler on this gameObject. /// It exposes a public function that can be bound in the Editor to a Unity Event. /// [AddComponentMenu("Scripts/MRTK/SDK/SubmitEventRouter")] public class SubmitEventRouter : MonoBehaviour { public void Submit() { ExecuteEvents.Execute(this.gameObject, new BaseEventData(EventSystem.current), ExecuteEvents.submitHandler); } } }