// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Teleport;
using Microsoft.MixedReality.Toolkit.Utilities;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Experimental.Teleport
{
///
/// Service manager supporting running the teleport system, without requiring the MixedRealityToolkit object.
///
[AddComponentMenu("Scripts/MRTK/SDK/TeleportSystemManager")]
public class TeleportSystemManager : BaseServiceManager
{
[SerializeField]
[Tooltip("The teleport system type that will be instantiated.")]
[Implements(typeof(IMixedRealityTeleportSystem), TypeGrouping.ByNamespaceFlat)]
private SystemType TeleportSystemType = null;
private void Awake()
{
InitializeManager();
}
protected override void OnDestroy()
{
UninitializeManager();
base.OnDestroy();
}
///
/// Initialize the manager.
///
private void InitializeManager()
{
// The teleport system class takes no arguments.
Initialize(TeleportSystemType.Type);
}
///
/// Uninitialize the manager.
///
private void UninitializeManager()
{
Uninitialize();
}
}
}