资源简介
Cardboard SDK for Unity and Demo
虚拟现实眼镜开发(纸盒应用)谷歌官方SDk
详见:https://developers.google.com/cardboard/overview
代码片段和文件信息
// Copyright 2014 Google Inc. All rights reserved.
//
// Licensed under the Apache License Version 2.0 (the “License“);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing software
// distributed under the License is distributed on an “AS IS“ BASIS
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(Collider))]
public class Teleport : MonoBehaviour {
private Vector3 startingPosition;
void Start() {
startingPosition = transform.localPosition;
SetGazedAt(false);
}
public void SetGazedAt(bool gazedAt) {
GetComponent().material.color = gazedAt ? Color.green : Color.red;
}
public void Reset() {
transform.localPosition = startingPosition;
}
public void ToggleVRMode() {
Cardboard.SDK.VRModeEnabled = !Cardboard.SDK.VRModeEnabled;
}
public void TeleportRandomly() {
Vector3 direction = Random.onUnitSphere;
direction.y = Mathf.Clamp(direction.y 0.5f 1f);
float distance = 2 * Random.value + 1.5f;
transform.localPosition = direction * distance;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-05-28 08:15 cardboard-unity-master\
文件 4114 2015-05-28 08:15 cardboard-unity-master\CHANGELOG
目录 0 2015-05-28 08:15 cardboard-unity-master\Cardboard\
目录 0 2015-05-28 08:15 cardboard-unity-master\Cardboard\DemoScene\
文件 71490 2015-05-28 08:15 cardboard-unity-master\Cardboard\DemoScene\DemoScene.unity
文件 1769 2015-05-28 08:15 cardboard-unity-master\Cardboard\DemoScene\GazePointer.mat
文件 738 2015-05-28 08:15 cardboard-unity-master\Cardboard\DemoScene\GroundPlane.mat
文件 3474 2015-05-28 08:15 cardboard-unity-master\Cardboard\DemoScene\GroundPlane.png
文件 1408 2015-05-28 08:15 cardboard-unity-master\Cardboard\DemoScene\Teleport.cs
目录 0 2015-05-28 08:15 cardboard-unity-master\Cardboard\Editor\
文件 5355 2015-05-28 08:15 cardboard-unity-master\Cardboard\Editor\CardboardEditor.cs
文件 4077 2015-05-28 08:15 cardboard-unity-master\Cardboard\Editor\StereoControllerEditor.cs
目录 0 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\
目录 0 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\DemoScene\
文件 14724 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\DemoScene\CardboardPointer.png
文件 54073 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\DemoScene\DemoScene.unity
文件 1576 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\DemoScene\TeleportLegacyUI.cs
目录 0 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\Prefabs\
文件 4253 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\Prefabs\CardboardGUI.prefab
文件 10434 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\Prefabs\CardboardMain.prefab
目录 0 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\Resources\
文件 948 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\Resources\GUIScreen.shader
文件 1334 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\Resources\SkyboxMesh.shader
目录 0 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\sc
文件 6836 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\sc
文件 5449 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\sc
文件 4303 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\sc
文件 3086 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\sc
文件 7507 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\sc
文件 1605 2015-05-28 08:15 cardboard-unity-master\Cardboard\Legacy\sc
目录 0 2015-05-28 08:15 cardboard-unity-master\Cardboard\Prefabs\
............此处省略26个文件信息
- 上一篇:基于单片机的恒温箱设计
- 下一篇:简明微波-西电梁昌洪-完整版.zip
相关资源
- Unity3d 5.x滚动小球完整项目 demo
- Lightning - Procedural Lightning 2D and 3D.uni
- unity 好用易懂的摇杆插件 2017 unity可用
- Unity3D合金弹头游戏项目资源
- UNITY3D桂电校园漫游
- Unity实现卡拉OK歌词过渡效果
- unity单机斗地主项目
- Unity小游戏【Roll a ball】源码231346
- unity常用草坪贴图材质包
- Unity+VS+Socket实现聊天室
- Unity PIDI - Planar Reflections
- unity小型场景
- NGUI Next-Gen UI v3.12.1 (Jun 29 2018)最新
- Socket For Unity3d
- Terrain To Mesh 1.46.unitypackage
- 恶魔射手unity的项目和视频教程
- HoloToolKit-Unity2017.1.1
- Unity 2019.4 中文离线文档(优化了打开
- Dynamic Water Physics 2.unitypackage
- neo4j-community-3.5.14-unix.tar.gz
- 基于unity3D做的台球小游戏
- 已修改的资源包可成功应用于2019版
- unity 动态粒子插件
- UMP Pro Win Mac Linux WebGL 2.0.3.unitypackage
- UMP_Pro_Win_Mac_Linux2.0.2.rar
- unity100个材质球
- neo4j-community-4.0.3-windows.zip
- Unity 3D网络游戏实战
- TopDown Engine v1.3.unitypackage
- SteamVR.2.2.0.unitypackage
评论
共有 条评论