Загрузка PICO Unity OpenXR Integration SDK
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa2c6dd6feb090341b43b2f825f99a7e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PICO.TOBSupport
|
||||
{
|
||||
public class PXR_EnterpriseTools : MonoBehaviour
|
||||
{
|
||||
public struct NoDelayedQueueItem
|
||||
{
|
||||
public Action action;
|
||||
}
|
||||
|
||||
private List<NoDelayedQueueItem> _actions = new List<NoDelayedQueueItem>();
|
||||
List<NoDelayedQueueItem> _currentActions = new List<NoDelayedQueueItem>();
|
||||
private static PXR_EnterpriseTools instance;
|
||||
|
||||
public void StartUp()
|
||||
{
|
||||
Debug.Log("ToBService PXR_EnterpriseTools StartUp");
|
||||
}
|
||||
public static PXR_EnterpriseTools Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = FindObjectOfType<PXR_EnterpriseTools>();
|
||||
}
|
||||
|
||||
if (instance == null)
|
||||
{
|
||||
GameObject obj = new GameObject("PXR_EnterpriseTools");
|
||||
instance = obj.AddComponent<PXR_EnterpriseTools>();
|
||||
DontDestroyOnLoad(obj);
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void QueueOnMainThread(Action taction)
|
||||
{
|
||||
lock (instance._actions)
|
||||
{
|
||||
instance._actions.Add(new NoDelayedQueueItem { action = taction });
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (_actions.Count > 0)
|
||||
{
|
||||
lock (_actions)
|
||||
{
|
||||
_currentActions.Clear();
|
||||
_currentActions.AddRange(_actions);
|
||||
_actions.Clear();
|
||||
}
|
||||
|
||||
for (int i = 0; i < _currentActions.Count; i++)
|
||||
{
|
||||
_currentActions[i].action.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fba0173074665504b9adf96a28713621
|
||||
timeCreated: 1686053214
|
Reference in New Issue
Block a user