Qualcomm_Snapdragon_VR_SDK SvrPlugin脚本简介(6)

在SvrPlugin的脚本中通过一个枚举类型eEventType来定义当前SDK的运行状态:

public enum eEventType
    {
        kEventNone = 0,
        kEventSdkServiceStarting = 1,
        kEventSdkServiceStarted = 2,
        kEventSdkServiceStopped = 3,
        kEventControllerConnecting = 4,
        kEventControllerConnected = 5,
        kEventControllerDisconnected = 6,
        kEventThermal = 7,
        kEventSensorError
    };       

包括 kEventSdkServiceStarting 类型表示的是当前SDK服务正在启动中。

 kEventSdkServiceStarted表示当前SDK服务启动完成。

kEventSdkServiceStopped表示当前SDK服务已经停止。

kEventControllerConnecting表示当前手柄处于连接中状态。

kEventControllerConnected表示当前手柄处于已连接状态。

kEventControllerDisconnected表示当前手柄处于失去连接的状态


在之前的文章中介绍了SvrPlugin脚本中开启VR模式的方法BeginVR:

public virtual IEnumerator BeginVr(int cpuPerfLevel =0, int gpuPerfLevel =0)
    {
        if (eyes == null)
        {
            eyes = SvrEye.Instances.ToArray();
            if (eyes == null)
            {
                Debug.Log("Components with SvrEye not found!");
            }

            Array.Sort(eyes);
        }

        if (overlays == null)
        {
            overlays = SvrOverlay.Instances.ToArray();
            if (overlays == null)
            {
                Debug.Log("Components with SvrOverlay not found!");
            }

            Array.Sort(overlays);
        }
        yield break;
    }

与之对应的还有关闭VR模式的方法为EndVR:

public virtual void EndVr()
    {
        eyes = null;
        overlays = null;
    }

该方法只是将eyes和overlays数组清空。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值