SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

79 lines
2.2 KiB

using System.Collections.Generic;
namespace UnityEngine.XR.Management.Tests.Standalone
{
public class StandaloneLoader : XRLoaderHelper
{
static List<StandaloneSubsystemDescriptor> s_StandaloneSubsystemDescriptors = new List<StandaloneSubsystemDescriptor>();
public StandaloneSubsystem standaloneSubsystem
{
get
{
return GetLoadedSubsystem<StandaloneSubsystem>();
}
}
public bool started { get; protected set; }
public bool stopped { get; protected set; }
public bool deInitialized { get; protected set; }
void OnStartCalled()
{
started = true;
}
void OnStopCalled()
{
stopped = true;
}
void OnDestroyCalled()
{
deInitialized = true;
}
public override bool Initialize()
{
started = false;
stopped = false;
deInitialized = false;
CreateSubsystem<StandaloneSubsystemDescriptor, StandaloneSubsystem>(s_StandaloneSubsystemDescriptors, "Standalone Subsystem");
if (standaloneSubsystem == null)
return false;
standaloneSubsystem.startCalled += OnStartCalled;
standaloneSubsystem.stopCalled += OnStopCalled;
standaloneSubsystem.destroyCalled += OnDestroyCalled;
return true;
}
public override bool Start()
{
if (standaloneSubsystem != null)
StartSubsystem<StandaloneSubsystem>();
return true;
}
public override bool Stop()
{
if (standaloneSubsystem != null)
StopSubsystem<StandaloneSubsystem>();
return true;
}
public override bool Deinitialize()
{
DestroySubsystem<StandaloneSubsystem>();
if (standaloneSubsystem != null)
{
standaloneSubsystem.startCalled -= OnStartCalled;
standaloneSubsystem.stopCalled -= OnStopCalled;
standaloneSubsystem.destroyCalled -= OnDestroyCalled;
}
return base.Deinitialize();
}
}
}