《SteamVR2.2.0传送机制(Teleport)=>快速入门大结局》(Yanlz+Unity+XR+SteamVR+Interaction+Teleport+Valve+立钻哥哥++ok++)

《SteamVR2.2.0快速入门》

《SteamVR2.2.0快速入门》

版本html

做者react

参与者git

完成日期github

备注面试

SteamVR2.2.0_Teleport_V01_1.0算法

严立钻数据库

 

2019.04.18编程

 

 

 

 

 

 

 

 

##《SteamVR2.2.0快速入门》发布说明:设计模式

++++“SteamVR2.2.0快速入门”:是对“SteamVR2.2.0”的快速入门(Quick Start);(2019年度的重点技术突破点确立为:“SteamVR”api

++++“SteamVR2.2.0快速入门”:定位在熟悉SteamVR框架

 

 

++++SteamVR的Github:https://github.com/ValveSoftware/steamvr_unity_plugin

++++SteamVR的QuickStart:https://valvesoftware.github.io/steamvr_unity_plugin/

++++SteamVR的Releases:https://github.com/ValveSoftware/steamvr_unity_plugin/releases

++++SteamVR2.2.0开发指南http://www.javashuo.com/article/p-hguaxolf-ew.html

++++SteamVR2.2.0快速入门http://www.javashuo.com/article/p-fcmbsvpm-gb.html

++++SteamVR2.2.0交互系统http://www.javashuo.com/article/p-ocssrxuq-gd.html

++++SteamVR2.2.0传送机制http://www.javashuo.com/article/p-ophuaicg-gh.html

++++SteamVR2.2.0官方教程http://www.javashuo.com/article/p-gblmlsya-gp.html

 

 

 

 

#第一篇:v2.2.0快速入门

#第一篇:v2.2.0快速入门

#第一篇:v2.2.0快速入门

++++立钻哥哥:Valve maintains a Unity plugin to smoothly interface SteamVR with Unity. With SteamVR developers can target one API that all the popular VR headsets can connect to. The modern SteamVR Unity Plugin manages three main things for developers: loading 3d models for VR controllers, handling input from those controllers, and estimating what your hand looks like while using those controllers. On top of managing those things we have an Interaction System example to help get your VR application off the ground. Proving concrete examples of interacting with the virtual world and our APIs.立钻哥哥:Valve”维护了一个“Unity插件”,使“SteamVR”与Unity的界面更加流畅。使用“SteamVR”,开发者能够将全部流行的VR头盔链接到一个API上。现代的“SteamVR Unity插件”为开发者管理了三件主要的事情:为VR控制器加载3d模型,处理来自这些控制器的输入,以及在使用这些控制器时估计你的手的样子。在管理这些事情之上,咱们有一个“交互系统示例”来帮助您的VR应用程序起步。证实与虚拟世界和咱们的api交互的具体例子。

++++A.一、Quickstart

++++A.二、Render Models

++++A.三、SteamVR Input

++++A.四、Skeleton Input

++++A.五、Interaction System

++++A.六、Skeleton Poser

++++A.七、立钻哥哥带您v2.2.0快速入门

++++https://valvesoftware.github.io/steamvr_unity_plugin/

 

 

##A.一、Quickstart

##A.一、Quickstart

++A.一、Quickstart

++++立钻哥哥:Theres a quickstart guide here that will lead you through the process of getting setup with the SteamVR Unity Plugin and into a scene.立钻哥哥:这里有一个快速入门指南,将带领你经过“SteamVR Unity插件”的安装过程进入一个场景。

++++https://valvesoftware.github.io/steamvr_unity_plugin/articles/Quickstart.html

 

 

 

##A.二、Render Models

##A.二、Render Models

++A.二、Render Models

++++立钻哥哥:SteamVR works with a wide array of headsets and controllers. When you have a tracked device in VR its nice to have an accurate visualization of that device. Instead of shipping each individual model and texture for each controller with each application, SteamVR can manage this for you. We include a SteamVR_RenderModel component that you can put on a gameobject that will auto load whatever device SteamVR detects for a given Pose. Put a SteamVR_Behaviour_Pose on a gameobject to get the position and rotation of a controller and then a SteamVR_RenderModel to show the 3d model for that controller that will animate with button presses. See the simple sample scene or the SteamVR/Prefabs/CameraRig prefab for an example.立钻哥哥:SteamVR”与各类头盔和控制器配合使用。当你在VR中拥有一个被跟踪的设备时,拥有该设备的精确可视化效果是很好的。“SteamVR”能够为您管理这一点,而不是为每一个应用程序为每一个控制器提供每一个单独的模型和纹理。咱们包括了一个“SteamVR_RenderModel”组件,你能够把它放在一个gameobject(游戏对象)上,它会自动加载任何设备“SteamVR”检测到的给定姿式。在gameobject(游戏物体)上放置一个“SteamVR_Behavior_Pose”来获取控制器的位置和旋转,而后是一个“SteamVR_RenderModel”来显示控制器的3d模型,该模型将经过按键来动画。参见简单的场景示例或“SteamVR/Prefabs/CameraRig”预制件做为示例。

++++https://valvesoftware.github.io/steamvr_unity_plugin/articles/Render-Models.html

 

 

 

##A.三、SteamVR Input

##A.三、SteamVR Input

++A.三、SteamVR Input

++++立钻哥哥:Since SteamVR works with so many different input devices weve simplified the process of accommodating all these devices. Instead of referencing the individual buttons on one controller, with SteamVR Input you reference an action. Instead of writing the code to recognize pulling the trigger button down 75% of the way to grab the block you can now just focus on the last bit of that, grab the block. You still configure the default for what grab means but the user can rebind it to their preference in a standard interface. And when a new input device comes out your users can publish bindings to share for that device with no code changes on your end.立钻哥哥:由于“SteamVR”能够与许多不一样的输入设备一块儿工做,因此咱们简化了容纳全部这些设备的过程。使用“SteamVR Input”引用一个动做,而不是引用一个控制器上的单个按钮。不须要编写代码来识别“在抓取物体的过程当中按下75%的触发按钮”,如今只需将注意力集中在最后一点上,即“抓取物体”。您仍然能够为“grab”的含义配置默认值,可是用户能够在标准界面中将其从新绑定到他们的首选项。当一个新的输入设备出现时,您的用户能够发布绑定来共享该设备,而不须要您更改代码。

++++https://valvesoftware.github.io/steamvr_unity_plugin/articles/SteamVR-Input.html

 

 

 

##A.四、Skeleton Input

##A.四、Skeleton Input

++A.四、Skeleton Input

++++立钻哥哥:Inline with the Knuckles Valve has released a system to get skeletal hand data independent from the controller youre using. Some controllers have a high fidelity for hand tracking data with individual joints, some controllers only have buttons that we use to approximate joint data. We use whatever is available and give you two major sets of data: With Controller, Without Controller.(立钻哥哥:内联的“关节阀”已经发布了一个系统,以得到骨骼手数据独立于你使用的控制器。有些控制器对单个关节的手部跟踪数据有很高的保真度,有些控制器只有咱们用来近似关节数据的按钮。咱们使用全部可用的数据,并给出两组主要的数据:“带控制器”和“不带控制器”。

++++[With Controller]: Our best approximation of where the joints in your hand are wrapped around your controller in the real world.(立钻哥哥:[控制器]:咱们的最佳近似值,在现实世界中,您手中的关节是围绕在控制器周围的。

++++[Without Controller]: Based on the With Controller data we estimate how open or closed your hand it as if you were trying to hold your hand flat or make a fist.(立钻哥哥:[不带控制器]:根据“有控制器”的数据,咱们估计你的手张开或闭合的程度,就像你试图把你的手放平或握紧拳头同样

++++Included in this plugin are example models of gloves that you can freely use in your products. In addition we have a helper component that takes the data from SteamVR and applies it to these gloves: SteamVR_Behaviour_Skeleton. For an example of this in action see the Interaction System sample scene.立钻哥哥:这个插件包括手套的例子模型,你能够在你的产品中无偿使用。此外,咱们还有一个助手组件,它从“SteamVR”获取数据并将其应用于这些手套:“SteamVR_Behaviour_Skeleton”。有关实际操做的示例,请参见“交互系统”示例场景。

++++https://valvesoftware.github.io/steamvr_unity_plugin/articles/Skeleton-Input.html

 

 

 

##A.五、Interaction System

##A.五、Interaction System

++A.五、Interaction System

++++立钻哥哥:After Valve released The Lab we took the learning form that project and created an Interaction System that others could use in their own projects. This system has been updated since then to use SteamVR Input and the new SteamVR Skeleton Input systems. This system can serve as an example of how to use the these new systems. It includes the following examples: (立钻哥哥:在“Valve”发布了“The Lab”以后,咱们采用了该项目的学习形式,并建立了一个“交互系统”,其余人能够在他们本身的项目中使用。从那时起,该系统已经更新为使用“SteamVR输入”和新的“SteamVR骨架输入”系统。这个系统能够做为如何使用这些新系统的一个例子。它包括如下例子:

++++[Interaction with Unity UI elements]: 与Unity UI元素的交互;

++++[Pickup, Drop, and Throw]: 拾起,放下,扔出去;

++++[Multiple variations on throwing velocities]: 投掷速度的多种变化;

++++[Bow and Arrow]: 弓箭;

++++[Wheel interactions]: 轮交互;

++++[Proximity button]: 邻近按钮;

++++[Variety of Skeleton Input example]: 各类骨架输入示例;

++++[Teleporting]: 传送;

++++[Using held objects]: 使用抓握对象;

++++[Using Skeleton Input to from a hand around a held object]: 使用手持物体的手的骨架输入;

+++++++++++++++++++++++

++++https://valvesoftware.github.io/steamvr_unity_plugin/articles/Interaction-System.html

 

++Interaction System form The Lab

++++立钻哥哥:The Interaction System is a series of scripts, prefabs and other assets that were the basis of all the minigames and other scenes in The Lab. This system was initially designed to be designed to be lightweight and flexible so that it could support all the experiments that we were working on at the time. Since then it has been updated to be an example of the new features weve added to SteamVR. Including SteamVR Input(actions/action sets) and Skeleton Input(hands). Hopefully it can serve as a good starting point for your own experiments and help you in developing your projects.立钻哥哥:交互系统”是一系列脚本、预制件和其余资源,是《实验室》中全部迷你游戏和其余场景的基础。这个系统最初被设计成轻量级和灵活的,这样它就能够支持咱们当时正在进行的全部实验。从那时起,它被更新为咱们添加到“SteamVR”的新功能的一个例子。包括“SteamVR输入”(动做/动做集)和“骨架输入()”。但愿它能成为你本身实验的一个很好的起点,并帮助你开发你的项目。

 

++Getting started(入门指南)

++++立钻哥哥:With these basic building blocks you can then go on and create some fairly complex objects. For some examples take a look at the Interactions_Example scene in Assets/SteamVR/InteractionSystem/Samples/Scenes.(立钻哥哥:使用这些基本的构建块,您能够继续建立一些至关复杂的对象。要得到一些示例,请查看“Assets/SteamVR/InteractionSystem/Samples/Scenes”中的“Interactions_Example”场景。

++++[一、Create a new scene]: 新建场景;

++++[二、Delete the Main Camera object]: 删除“主摄像”对象;

++++[三、Drag in the Player prefab from Core/Prefabs into your scene. This prefab sets up the main Player component and the hands. It also hooks into all the relevant SteamVR Input actions needed.]: 将“Player”预置从Core/Prefabs拖到场景中。这个预置设置了主要的玩家。它还挂钩到全部相关的“SteamVR输入”行动须要;

++++[四、You should be able to see the scene in the headset now along with your controllers being tracked in the scene.]: 您如今应该能够看到头盔中的场景,以及您的控制器在场景中被跟踪。

++++[五、If you have controllers that support Skeleton Input youll also see hands that touch and press the buttons on your controllers.]: 若是你有支持“骨架输入”的控制器,你还会看到双手触摸并按下控制器上的按钮。

++++[六、Add the Interactable component to any object in the scene. All the other components on this object will then start receiving relevant messages from the players hands.(Look at Samples/Scripts/InteractableExample.cs for example usage)]: 将“Interactable”组件添加到场景中的任何对象中。该对象上的全部其余组件将开始从玩家手中接收相关消息。(查看示例/脚本/InteractableExample.cs示例用法)

++++[七、We have included a few commonly used interactable classes such as the Throwable. Adding this component to your object will allow it to be picked up and thrown by the player.]: 咱们已经包含了一些经常使用的可交互类,好比Throwable将此组件添加到对象中,将容许玩家拾取并抛出该物体

++++[八、You can then add the Skeleton Poser component to a GameObject with an Interactable and pose how you want the hand to look when interacting with it.]: 而后你能够将“Skeleton Poser”组件添加到带有“Interactable”的GameObject(游戏物体)中,并在与之交互时摆出你想要的手的样子。

++++[九、To add teleporting to your scene drag in the Teleporting prefab from Teleport/Prefabs into your scene. This will set up all the teleport logic.]:要将传送到场景中,请将传送预制块从Teleport/Prefabs拖拽到场景中。这将设置全部的传送逻辑。

++++[十、Drag in some TeleportPoint prefabs from Teleport/Prefabs to add locations that the player can teleport to.]: 从Teleport/ Prefabs中拖入一些TeleportPoint prefabs,添加玩家能够传送到的位置.

++++[十一、You can also add the TeleportArea component to any object in your scene. This will allow the player to teleport anywhere along the collider for that object.]: 您还能够将TeleportArea组件添加到场景中的任何对象。这将容许玩家在碰撞体的任何地方传送该物体。

++++\Assets\SteamVR\InteractionSystem\Samples\Scripts\InteractableExample.cs

//Purpose: Demonstrates how to create a simple interactable object(立钻哥哥:目的:展现了如何建立一个简单的interactable对象

 

using UnityEngine;

using System.Collections;

 

namespace Valve.VR.InteractionSystem.Sample{

    [RequireComponent(typeof(Interactable))]

    public class InteractableExample : MonoBehaviour{

        private TextMesh generalText;

        private TextMesh hoveringText;

        private Vector3 oldPosition;

        private Quaternion oldRotation;

 

        private float attachTime;

 

        private Interactable interactable;

 

        void Awake(){}

 

        //Called when a Hand starts hovering over this object.(立钻哥哥:当一只手开始悬停在该对象上时调用

        private void OnHandHoverBegin(Hand hand){}

 

        //Called when a Hand stops hovering over this object.(立钻哥哥:当一只手中止悬停在该对象上时调用.

        private void OnHandHoverEnd(Hand hand){}

 

        //Called every Update() while a Hand is hovering over this object.(立钻哥哥:当一只手悬停在此对象上时调用每一个Update()

        private void HandHoverUpdate(Hand hand){}

 

        //Called when this GameObject becomes attached to the hand.(立钻哥哥:当GameObject(游戏物体)与手相连时调用.

        private void OnAttachedToHand(Hand hand){}

 

        //Called when this GameObject is detached from the hand.(立钻哥哥:当GameObject(游戏物体)与手分离时调用.

        private void OnDetachedFromHand(Hand hand){}

 

        //Called every Update() while this GameObject is attached to the hand.(立钻哥哥:调用每一个Update(),而这个GameObject则被附加到指针上.

        private void HandAttachedUpdate(Hand hand){}

 

        private bool lastHovering = false;

        private void Update(){}

 

        //Called when this attached GameObject becomes the primary attached object.(立钻哥哥:当这个附属游戏对象成为主要附属对象时调用

        private void OnHandFocusAcquired(Hand hand){}

 

        //Called when another attached GameObject becomes the primary attached object.(立钻哥哥:当另外一个附加游戏对象成为主要附加对象时调用.

        private void OnHandFocusLost(Hand hand){}

    

    }    //立钻哥哥:public class InteractableExample:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem.Sample{}

++++\Assets\SteamVR\InteractionSystem\Teleport\Scripts\Teleport.cs

//Purpose: Handles all the teleport logic.(立钻哥哥:用途:处理全部的传送逻辑.

 

using UnityEngine;

using UnityEngine.Events;

using System.Collections;

 

namespace Valve.VR.InteractionSystem{

    public class Teleport : MonoBehaviour{

        public SteamVR_Action_Boolean teleportAction = SteamVR_Input.GetAction<SteamVR_Action_Boolean>(Teleport);

  

        public LayerMask traceLayerMask;

        public LayerMask floorFixupTraceLayerMask;

 

        private Coroutine hintCoroutine = null;

 

        SteamVR_Events.Action chaperoneInfoInitializedAction;

 

        //Events

        public static SteamVR_Events.Event<float> ChangeScene = new SteamVR_Events.Event<float>();

        public static SteamVR_Events.Action<float> ChangeSceneAction(UnityAction<float> action){}

 

        public static SteamVR_Events.Event<TeleportMarkerBase> Player = new SteamVR_Events.Event<TeleportMakerBase>();

        public static SteamVR_Events.Action<TeleportMakerBase> PlayerAction(UnityAction<TeleportMarkerBase> action){}

 

        public static SteamVR_Events.Event<TeleportMarkerBase> PlayerPre = new SteamVR_Events.Event<TeleportMakerBase>();

        public static SteamVR_Events.Action<TeleportMarkerBase> PlayerPreAction(UnityAction<TeleportMarkerBase> action){}

        

        private static Teleport _instance;

        public static Teleport instance{}

 

        void Awake(){}

        void Start(){}

        void OnEnable(){}

        void OnDisable(){}

 

        private void CheckForSpawnPoint(){}

        public void HideTeleportPointer(){}

 

        void Update(){}

 

        private void UpdatePointer(){}

 

        void FixedUpdate(){}

 

        private void OnChaperoneInfoInitialized(){}

 

        private void HidePointer(){}

        private void ShowPointer(Hand newPointerHand, Hand oldPointerHand){}

        

        private void UpdateTeleportColors(){}

 

        private void PlayAudioClip(AudioSource source, AudioClip clip){

            source.clip = clip;

            source.Play();

        }

 

        private void PlayPointerHaptic(bool validLocation){}

        private void TryTeleportPlayer(){}

        private void InitiateTeleportFade(){}

        private void TeleportPlayer(){}

        private void HighlightSelected(TeleportMarkerBase hitTeleportMarker){}

 

        public void ShowTeleportHint(){}

        public void CancelTeleportHint(){}

 

        private IEnumerator TeleportHintCoroutine(){}

 

        public bool IsEligibleForTeleport(Hand hand){}

 

        private bool ShouldOverrideHoverLock(){}

        private bool WasTeleportButtonReleased(Hand hand){}

        private bool IsTeleportButtonDown(Hand hand){}

        private bool WasTeleportButtonPressed(Hand hand){}

        private Transform GetPointerStartTransform(Hand hand){}

 

    }    //立钻哥哥:public class Teleport:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

++++\Assets\SteamVR\InteractionSystem\Teleport\Scripts\TeleportPoint.cs

//Purpose: Single location that the player can teleport to.(立钻哥哥:用途:单一的位置,玩家能够传送到.

using UnityEngine;

using UnityEngine.UI;

#if UNITY_EDITOR

    using UnityEditor;

#endif

 

namespace Valve.VR.InteractionSystem{

    public class TeleportPoint : TeleportMarkerBase{

        public enum TeleportPointType{

            MoveToLocation,

            SwitchToNewScene

        };

 

        //Public variables

        public TeleportPointType teleportType = TeleportPointType.MoveToLocation;

        public string title;

        public string switchToScene;

 

        //Private data

        private bool gotReleventComponents = false;

        private MeshRenderer markerMesh;

        private MeshRenderer switchSceneIcon;

        private MeshRenderer moveLocationIcon;

 

        //Constants

        private const string switchSceneAnimation = switch_scenes_idle;

        private const string moveLocationAnimation = move_location_idle;

        private const string lockedAnimation = locked_idle;

 

        public override bool showReticle{}

 

        void Awake(){}

        void Start(){}

        void Update(){}

 

        public override bool ShouldActivate(Vector3 playerPosition){}

        public override bool ShouldMovePlayer(){}

        public override void Highlight(bool highlight){}

        public override void UpdateVisuals(){}

        public override void SetAlpha(float tintAlpha, float alphaPercent){}

 

        public void SetMeshMaterials(Material material, Color textColor){}

        public void TeleportToScene(){}

        public void GetRelevantComponents(){}

        public void ReleaseRelevantComponents(){}

        public void UpdateVisualsInEditor(){}

 

    }    //立钻哥哥:public class TeleportPoint:TeleportMarkerBase{}

 

    #if UNITY_EDITOR

        [CustomEditor(typeof(TeleportPoint))]

        public class TeleportPointEditor : Editor{

            void OnEnable(){}

            public override void OnInspectorGUI(){}

        }    //立钻哥哥:public class TeleportPointEditor:Editor{}

    #endif

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

++++\Assets\SteamVR\InteractionSystem\Teleport\Scripts\TeleportArea.cs

//Purpose: An area that the player can teleport to.(立钻哥哥:用途:玩家能够传送到的区域.

using UnityEngine;

#if UNITY_EDITOR

    using UnityEditor;

#endif

 

namespce Valve.VR.InteractionSystem{

    public class TeleportArea : TeleportMarkerBase{

        //Public properties

        public Bounds meshBounds{}

 

        //Private data

        private MeshRenderer areaMesh;

        private int tintColorId = 0;

        private Color visibleTintColor = Color.clear;

        private Color highlightedTintColor = Color.clear;

        private Color lockedTintColor = Color.clear;

        private bool highlighted = false;

 

        public void Awake(){}

        public void Start(){}

 

        public override bool ShouldActivate(Vector3 playerPosition){}

        public override bool ShouldMovePlayer(){}

        public override void Highlight(bool highlight){}

        public override void SetAlpha(float tintAlpha, float alphaPercent){}

        public override void UpdateVisuals(){}

 

        public void UpdateVisualsInEditor(){}

        private bool CalculateBounds(){}

    

    }    //立钻哥哥:public class TeleportArea:TeleportMarkerBase{}

 

    #if UNITY_EDITOR

        [CustomEditor(typeof(TeleportArea))]

        public class TeleportAreaEditor : Editor{

            void OnEnable(){}

            public override void OnInspectorGUI(){}

        }    //立钻哥哥:public class TeleportAreaEditor:Editor{}

    #endif

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

 

++Sample Scene(示例场景)

++++立钻哥哥:The sample scene Interactions_Example in the Samples/Scenes folder includes all of the major components and is a good place to familiarize yourself with the system. The scene contains the following elements:(立钻哥哥:Samples/Scenes”文件夹中的示例场景 Interactions_Example包含全部主要组件,是熟悉系统的好地方。场景包含如下元素:

 

++++[Teleporting]: The Teleporting prefab handles all the teleporting logic for the system.立钻哥哥:传送】:传送预置处理系统的全部传送逻辑

 

 

++Documentation(技术资料)

++++立钻哥哥:Now well go a little more in depth into some of the basic components included in the interaction system. The system is broken up into a few different part: 立钻哥哥:如今咱们将更深刻地讨论交互系统中包含的一些基本组件。该系统分为几个不一样的部分:

++++[Core]: A the core of the interaction system are the Player, Hand and Interactable classes. The provided Player prefab sets up the player object and the SteamVR camera for the scene.立钻哥哥:Core】:交互系统的核心是“Player”、“Hand”和“Interactable 所提供的Player预置设置了Player对象和场景的“SteamVR”摄像机。

----The interaction system works by sending messages to any object that the hands interact with. These objects then react to the message and can attach themselves to the hands if wanted.立钻哥哥:交互系统的工做原理是将消息发送到与手交互的任何对象。而后,这些对象对消息做出反应,若是须要,能够将本身附加到手上.

----To make any object receive message from the hands just add the Interactable component to that object. This object will then be considered when the hand does its hovering checks.立钻哥哥:要使任何对象从接收消息,只需将Interactable组件添加到该对象。当手进行悬停检查时,将考虑该对象。

----We have also included a few commonly used interactables such as the Throwable or the LinearDrive.立钻哥哥:咱们还包括了一些经常使用的交互,如“Throwable”或“LinearDrive.

----The Player prefab also creates an InputModule which allows the hands to mimic mouse events to easily work with Unity UI widgets.立钻哥哥:Player”预置还建立了一个“InputModule”,容许双手模拟鼠标事件,以便轻松地使用“Unity UI widgets”。

----The interaction system also includes a fallback mode which allows for typical first-person camera controls using the keyboard and mouse. This also allows the mouse to act like one of the players hands. This mode is particularly useful when not everyone on the team has access to VR headset.立钻哥哥:交互系统还包括一个备选模式,容许使用键盘和鼠标进行典型的第一人称相机控制。这也容许鼠标像玩家的一只手同样工做。当团队中并不是全部人都能使用“VR”头盔时,这种模式尤为有用。

 

++[Player]

++++立钻哥哥:The Player class acts like a singleton which means there should only be one Player object in the scene.立钻哥哥:Player类就像一个单例对象,这意味着场景中应该只有一个Player对象。

++++The player itself doesnt do much except for keep track of the hands and the hmd.立钻哥哥:除了跟踪hmdPlayer自己并无作什么.

++++It can be accessed globally throughout the project and many aspects of the interaction system assume that the Player object always exists in the scene.立钻哥哥:它能够在整个项目中全局访问,交互系统的许多方面都假设“Player”对象始终存在于场景中。

++++It also keeps track of whether you are in VR mode or 2D fallback mode.立钻哥哥:它还能够跟踪你是在VR模式仍是2D备选模式

++++Using the accessors through the Player class allows the other components to function similarly without knowing if the VR headset or mouse/keyboard is being used.立钻哥哥:经过“Player”类使用访问器可让其余组件在不知道是否使用VR头盔或鼠标/键盘的状况下进行相似的操做.

++++The 2D fallback mode is useful but has its limitations. We mainly used this mode for testing out very simple interactions that only required 1 hand and the trigger button. It was mainly useful during development when not everyone on the team had a VR headset on controllers with them at all times.立钻哥哥:2D备选模式颇有用,但也有其局限性。咱们主要使用这种模式来测试很是简单的交互,只须要一只手和触发按钮。这在开发过程当中很是有用,由于团队中并非每一个人都随身携带VR头盔.

++++The Player also includes a few useful properties:立钻哥哥:玩家还包括一些有用的属性:

----[hmdTransform]: This will always return the transform of the current camera. This could be the VR headset or the 2D fallback camera.立钻哥哥:hmdTransform:它老是返回当前相机的转换这多是VR头盔或2D后置摄像头.

----[feetPositionGuess]: This guesses the position of the players feet based on the where the hmd is. Since we dont actually know the position of their feet, this can be pretty inaccurate depending on how the player is standing.立钻哥哥:feetPositionGuess:根据hmd的位置猜想玩家的脚的位置。由于咱们实际上并不知道他们的脚的位置,这多是很是不许确的,这取决于玩家是如何站着的

----[bodyDirectionGuess]: This is similar to the feetPositionGuess in that it can be inaccurate depending on how the player is standing.立钻哥哥:bodyDirectionGuess:这相似于“feetPositionGuess”,由于它多是不许确的,这取决于玩家是如何站着的。

++++Note: The player class is set up to use icons to show the feet and hands in the editor scene view but due to the way Unity works these icons have to be located in a specific folder to work. These icons are provided under Core/Icons. Move them to a folder named Gizoms in the root of your projects Asset tree and they should work.立钻哥哥:注意:player类设置为使用图标在编辑器场景视图中显示手脚,但因为Unity的工做方式,这些图标必须位于特定的文件夹中才能工做。这些图标在“Core/ Icons”下提供。将它们移到项目“资源”树的根目录中名为“Gizoms”的文件夹中,它们应该能够工做。

++++The 2D fallback mode can be useful during testing but its probably not something that you want to ship with your finished game. There are 2 ways to disable it:立钻哥哥:2D备选模式在测试过程当中很是有用,但它可能并非你想要在完成游戏后发行的东西。有两种方法能够禁用它:

----Uncheck the Allow Toggle To 2D bool on the player object in your scene before making your build.立钻哥哥:在生成以前,取消场景中Player对象上的“容许切换到2D”选项

----Add HIDE_DEBUG_UI to the list of Scripting Define Symbols in your projects PlayerSettings. This will only disable the 2D debug view in builds of your game while allowing you to keep using it in the editor.立钻哥哥:将“HIDE_DEBUG_UI”添加到项目“PlayerSettings”中的“脚本定义符号”列表中。这只会禁用游戏构建中的2D调试视图,同时容许您在编辑器中继续使用它.

 

++Hand

++++立钻哥哥:The Hand class does most of the heavy lifting for the interaction system.Hand”类为“交互系统”作了大部分繁重的工做

++++The Hand checks for objects(Interactables) that it is hovering over and sends them messages based on the current hover state.立钻哥哥:Hand检查它所悬停的对象(Interactables),并根据当前悬停状态向它们发送消息.

++++The hand can only hover on 1 object at a time and only 1 hand can hover on an object at the same time.立钻哥哥:一只手一次只能悬停在一个物体上,同时也只能悬停在一个物体上.

++++Objects can be attached to and detached from the Hand. Only one object can be the object in focus of the hand but multiple objects can be attached to the hand at the same time.立钻哥哥:物体能够附着在手上,也能够从手上分离出来。只有一个对象能够是手的焦点对象,但同时能够将多个对象附加到手.

++++Once an object is detached from the hand then the previous object attached to the hand(if it is still attached) becomes the object in focus on the hand.立钻哥哥:一旦一个对象与手分离,那么与手相连的前一个对象(若是它仍然与手相连)就成为手的焦点对象.

++++When nothing is attached to the hand it will always show the controller.立钻哥哥:当没有任何东西附着在手上时,它老是会显示控制器.

++++The attached object can set AttachmentFlags that determine the behaviour of the hand and the object once it has been attached.立钻哥哥:所附加的对象能够设置AttachmentFlags,该标记肯定手和对象在被附加后的行为.

++++The hand can be locked form hovering over other objects or any object depending on the situation.立钻哥哥:根据不一样的状况,能够将手锁定在悬停在其余物体或任何物体上.

++++These are the message the hand sends to objects that it is interacting with: (立钻哥哥:这些是手发送给它正在与之交互的对象的消息

----[OnHandHoverBegin]: Sent when the hand first starts hovering over the object.立钻哥哥:OnHandHoverBegin:当第一次开始悬停在对象上时发送

----[HandHoverUpdate]: Send every frame that the hand is hovering over the object.立钻哥哥:HandHoverUpdate:发送手悬停在对象上的每一帧

----[OnHandHoverEnd]: Sent when the hand stops hovering over the object.立钻哥哥:OnHandHoverEnd:当手离开悬停在物体上时发送

----[OnAttachedToHand]: Sent when the object gets attached to the hand.立钻哥哥:OnAttachedToHand:当对象附加到hand时发送

----[HandAttachedUpdate]: Sent every frame while the object is attached to the hand.立钻哥哥:HandAttachedUpdate:当对象附在手上时,发送每一帧.

----[OnDetachedFromHand]: Sent when the object gets detached from the hand.立钻哥哥:OnDetachedFromHand:当对象脱离手时发送

----[OnHandFocusLost]: Sent when an attached object loses focus because something else has been attached to the hand.立钻哥哥:OnHandFocusLost:当一个附加对象由于其余对象被附加到手上而失去焦点时发送.

----[OnHandFocusAcquired]: Send when an attached object gains focus because the previous focus object has been detached from the hand.立钻哥哥:OnHandFocusAcquired:当一个附加对象得到焦点时发送,由于以前的焦点对象已经与手分离

++++These are the message that the hand sends to its child objects:立钻哥哥:这是手发送给它的子对象的消息:

----[OnHandInitialized]: Sent when the hand first gets initialized by associating itself with the device ID of a SteamVR tracked controller.立钻哥哥:OnHandInitialized:经过将本身与“SteamVR”跟踪控制器的设备ID相关联,首次初始化手时发送.

----[OnParentHandHoverBegin]: Sent when the hand starts hovering over something.立钻哥哥:OnParentHandHoverBegin:当开始悬停在某物上时发送

----[OnParentHandHoverEnd]: Sent when the hand stops hovering over something.立钻哥哥:OnParentHandHoverEnd:当手离开悬停在某物上时发送

----[OnParentHandInputFocusAcquired]: Sent when the game window gains input focus.立钻哥哥:OnParentHandInputFocusAcquired:当游戏窗口得到输入焦点时发送

----[OnParentHandInputFocusLost]: Send when the game window loses input focus.立钻哥哥:OnParentHandInputFocusLost:当游戏窗口失去输入焦点时发送

++++These members deal with attaching and detaching:立钻哥哥:这些成员处理链接和分离:

----[AttachObject]: Attaches the object from the hand using the passed in AttachmentFlags.立钻哥哥:AttachObject:使用传递的AttachmentFlags从手上附加对象.

----[DetachObject]: Detaches the object from the hand and optionally restores it to its original parent.立钻哥哥:DetachObject:从中分离对象,并可选地将其还原到其原始父对象

----[currentAttachedObject]: This returns the in-focus attached object on the hand, if any.立钻哥哥:currentAttachedObject:这将返回手上的in-focus附加对象(若是有的话).

++++The Hand also has a few useful properties and functions that can be used to customize its behaviour:立钻哥哥:手也有一些有用的属性和功能,能够用来定制其行为:

----[OtherHand]: This is the other hand on the player. This can be useful for objects that need to interact with both hands such as the longbow.立钻哥哥:另外一只手:这是Player上的另外一只手。这对于须要双手交互的对象(如长弓)很是有用

----[HoverSphereTransform and Radius]: This can be used to customize the hover range of the hand.立钻哥哥:HoverSphereTransformRadius:可用于自定义手的悬停范围.

----[HoverLayerMask]: This can be changed so that the hand only hovers over objects in certain layers.立钻哥哥:HoverLayerMask:这能够改变,使手只悬停在某些层的对象上.

----[HoverUpdateInterval]: The hovering check can be done more or less frequently depending on the requirements of your game.立钻哥哥:HoverUpdateInterval:能够根据游戏的需求或多或少频繁地执行悬停检查.

----[HoverLock/Unlock]: This is used to make the hand only hover over a certain object. Passing in null will make the hand not hover over anything while it is hover locked. This technique is used to make the hand not hover over objects while the teleport arc is active.立钻哥哥:HoverLock/Unlock:这是用来让手只悬停在一个特定的物体上。传递null将使手在悬停锁定时不悬停在任何东西上。此技术用于使手在传送弧处于活动状态时不悬停在物体上.

----[GetGrabStarting/GetGrabEnding]: These are used to determine if the boolean grab actions are being triggered at that time. There are two types of grabs-grip grab and pinch grab. These are generally associated with grip buttons and trigger buttons but serve special functions on the Knuckles controllers.立钻哥哥:GetGrabStarting /GetGrabEnding:这些用于肯定布尔抓取操做是否在那个时候被触发。抓握有两种类型-抓取捏抓。这些一般与手柄按钮和触发器按钮相关联,但在Knuckles控制器上具备特殊功能

----[GetAttachmentTransform]: Objects can use attachment transforms on the hand to figure out how to snap on to the hand. These are just named children of the Hand object. The Player prefab contains Attach_ControllerTip as an example.立钻哥哥:GetAttachmentTransform:对象能够在上使用“附件转换”来肯定如何快速地抓住这些只是“Hand”对象的命名子对象。例如,“Player”预置包含“Attach_ControllerTip.

 

++Player(Prefab)(Player预制体)

++++立钻哥哥:This is the single piece of the interaction system that combines all its basic parts.这是交互系统的单个部分,它组合了全部的基本部分

++++This prefab arranges the player and hands in a way to make them all accessible easily.立钻哥哥:这个预置安排玩家和手在一种方式,使他们都容易访问

++++It also contains all the setup for SteamVR and the 2D fallback system.立钻哥哥:它还包含了全部的设置“SteamVR”和2D备份系统

++++Most of the other components of the interaction system depend on the player and some of them assume that the player and hands are set up in this way.立钻哥哥:交互系统的大多数其余组件都依赖于玩家,其中一些组件假设玩家和手是这样设置的.

++++These should only be 1 of these in a scene.立钻哥哥:一个场景中有且只有一个Player.

 

++Teleport(传送)

++++立钻哥哥:The teleport system from The Lab supports teleporting to specific teleport points or a more general teleport area.“实验室”的传送系统支持传送到特定的传送点或更通用的传送区

++++The important classes are Teleport, TeleportPoint and TeleportArea.立钻哥哥:重要的类是Teleport、TeleportPoint和TeleportArea

++++All the functionality is wrapped up in the Teleporting prefab in Teleport/Prefabs. This prefab included all the logic for the teleport system to function.立钻哥哥:全部功能都封装在“传送/预置”中的传送预置中。这个预置包括了传送系统运做的全部逻辑.

++++Add TeleportPoints or TeleportAreas to the scene to add spots where the player can teleport to.立钻哥哥:向场景中添加传送点或传送区域,以添加玩家能够传送到的点

++++\Assets\SteamVR\InteractionSystem\Teleport\Scripts\Teleport.cs

//Purpose: Handles all the teleport logic.(立钻哥哥:用途:处理全部的传送逻辑

using UnityEngine;

using UnityEngine.Events;

using System.Collections;

 

namespace Valve.VR.InteractionSystem{

    public class Teleport : MonoBehaviour{

        public SteamVR_Action_Boolean teleportAction = SteamVR_Input.GetAction<SteamVR_Action_Boolean>(Teleport);

 

        private Hand pointerHand = null;

        private Player player = null;

        private TeleportArc teleportArc = null;

 

        private static Teleport _instance;

        public static Teleport instance{}

 

        void Awake(){

            _instance = this;

        }

 

        void Start(){

            teleportMarkers = GameObject.FindObjectsOfType<TeleportMarkerBase>();

            player = InteractionSystem.Player.instance;

        }

 

        void OnEnable(){}

        void OnDisable(){}

 

        private void CheckForSpawnPoint(){}

 

        public void HideTeleportPointer(){}

 

        void Update(){}

 

        private void UpdatePointer(){}

 

        void FixedUpdate(){}

 

        private void OnChaperoneInfoInitialized(){}

        private void HidePointer(){}

        private void ShowPointer(Hand newPointerHand, Hand oldPointerHand){}

        private void UpdateTeleportColors(){}

        private void PlayAudioClip(AudioSource source, AudioClip clip){}

        private void PlayPointerHaptic(bool validLocation){}

        private void TryTeleportPlayer(){}

        private void InitiateTeleportFade(){}

        private void TeleportPlayer(){}

        private void HighlightSelected(TeleportMarkerBase hitTeleportMarker){}

 

        public void ShowTeleportHint(){}

        public void CancelTeleportHint(){}

 

        private IEnumerator TeleportHintCoroutine(){}

 

        public bool IsEligibleForTeleport(Hand hand){}

 

        private bool ShouldOverrideHoverLock(){}

        private bool WasTeleportButtonReleased(Hand hand){}

        private bool IsTeleportButtonDown(Hand hand){}

        private bool WasTeleportButtonPressed(Hand hand){}

        private Transform GetPointerStartTransform(Hand hand){}

 

    }    //立钻哥哥:public class Teleport:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++Teleport(传送)

++++立钻哥哥:This class handles most of the logic of teleporting.这个类处理传送的大部分逻辑

++++When the touchpad is pressed, the teleport pointer shows up. If the pointer is pointing at a valid spot when the touchpad is released when the player teleports.立钻哥哥:当触摸板被按下时,传送指针就会出现。当玩家传送touchpad时,若是指针指向一个有效的点

----You can also press T on the keyboard while in 2D fallback mode to bring up the teleport pointer.立钻哥哥:你也能够按下键盘上的“T”,在2D备选模式,以打开传送指针

++++This class keeps track of all the teleport markers in the scene and informs them to fade in/out depending on the state of the teleport pointer.立钻哥哥:该类跟踪场景中的全部传送端口标记,并根据传送端口指针的状态通知它们淡入/淡出

++++In certain situations it can be useful to have a separate mesh for the floor the scene that is different from the teleport mesh. In these situations the teleport system will trace down form where it hit the teleport mesh and try to place on the floor mesh. The point of this is to try to match the visual floor in the scene with the physical floor in the players play area.立钻哥哥:在某些状况下,在地板上使用不一样于传送网格的网格是颇有用的。在这种状况下,传送系统将追踪它击中传送网的位置,并试图将其放置在地板网孔上。这样作的目的是尝试将场景中的视觉地板与玩家游戏区域中的物理地板匹配起来.

++++There are a few properties that will probably need to be tweaked:立钻哥哥:有一些属性可能须要调整:

----[tracerLayerMask]: This is all the layers that the teleport pointer will try to hit.立钻哥哥:[tracerLayerMask]:这是传送指针将尝试命中的全部层

----[floorFixupMask]: The layer that the floor is on.立钻哥哥:[floorFixupMask]:地板所在的层

----[floorFixupMaximumTraceDistance]: The maximum distance to trace to try to look for the floor.立钻哥哥:[floorFixupMaximumTraceDistance]:查找地板的最大跟踪距离

----[ShowPlayAreaMarker]: This toggles whether to show the rectangle of the players play area while teleporting. This can help in orienting the players in their physical space.立钻哥哥:[ShowPlayAreaMarker]:这将切换是否显示传送时玩家游戏区域的矩形。这能够帮助玩家在他们的物理空间中找到方向

----[arcDistance]: How far the teleport arc should go. Increasing this number will allow the player to teleport further in the scene. This value will probably need to be tweaked for each scene.立钻哥哥:[arcDistance]:传送弧应该走多远。增长这个数字将容许玩家在场景中传送得更远。这个值可能须要为每一个场景进行调整

 

++TeleportMarkerBase(传送标记基类)

++++立钻哥哥:This is the base class for all the teleport markers.这是全部传送标记的基类

++++It contains methods that the Teleport class expects to be present in all the teleport markers.立钻哥哥:它包含“Teleport”类指望出如今全部Teleport标记中的方法.

++++You can use this as your base class to create a new type of teleport marker.立钻哥哥:你能够用这个做为你的基类来建立一种新的传送标记

++++A teleport marker can be locked or unlocked. The player cannot teleport to locked markers.立钻哥哥:传送标记能够锁定或解锁。玩家不能传送到锁定的标记.

++++\Assets\SteamVR\InteractionSystem\Teleport\Scripts\TeleportMarkerBase.cs

//Purpose: Base class for all the objects that the player can teleport to.(立钻哥哥:用途:玩家能够传送到的全部对象的基类

using UnityEngine;

 

namespace Valve.VR.InteractionSystem{

    public abstract class TeleportMarkerBase : MonoBehaviour{

        public bool locked = false;

        public bool markerActive = true;

 

        public virtual bool showReticle{  get{  return true;  }  }

 

        public void SetLocked(bool locked){

            this.locked = locked;

            UpdateVisuals();

        }

 

        public virtual void TeleportPlayer(Vector3 pointedAtPosition){}

 

        public abstract void UpdateVisuals();

        public abstract void Highlight(bool highlight);

        public abstract void SetAlpha(float tintAlpha, float alphaPercent);

        public abstract bool ShouldActivate(Vector3 playerPosition);

        public abstract bool ShouldMovePlayer();

    }    //立钻哥哥:public abstract class TeleportMarkerBase:MonoBehaviour{}

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++TeleportArea(传送区域)

++++立钻哥哥:This is a teleport area that is made up of a mesh.这是一个由网格组成的传送区

++++When teleporting onto these, the player will teleport exactly where they are pointing(plus the floor fixup).立钻哥哥:当传送到这些东西上时,玩家将会准确地传送到他们所指向的地方(加上地板固定)

++++Add this component to any object with a collider and a mesh renderer to allow the player to teleport on it.立钻哥哥:将此组件添加到任何带有碰撞体和网格渲染器的对象中,以容许玩家在其上传送

++++\Assets\SteamVR\InteractionSystem\Teleport\Scripts\TeleportArea.cs

//Purpose: An area that the Player can teleport to.(立钻哥哥:用途:玩家能够传送到的区域

using UnityEngine;

#if UNITY_EDITOR

    using UnityEditor;

#endif

 

namespace Valve.VR.InteractionSystem{

    public class TeleportArea : TeleportMarkerBase{

        public Bounds meshBounds{  get;  private set;  }

 

        private MeshRenderer areaMesh;

        private int tintColorId = 0;

        private Color visibleTintColor = Color.clear;

        private Color highlightedTintColor = Color.clear;

        private Color lockedTintColor = Color.clear;

        private bool highlighted = false;

 

        public void Awake(){

            areaMesh = GetComponent<MeshRenderer>();

            tintColorId = Shader.PropertyToID(_TintColor);

            CalculateBounds();

        }

 

        public void Start(){

            visibleTintColor = Teleport.instance.areaVisibleMaterial.GetColor(tintColorId);

            highlightedTintColor = Teleport.instance.areaHighlightedMaterial.GetColor(tintColorId);

            lockedTintColor = Teleport.instance.areaLockedMaterial.GetColor(tintColorId);

        }

 

        public override bool ShouldActivate(Vector3 playerPosition){}

        public override bool ShouldMovePlayer(){}

        public override void Highlight(bool highlight){}

        public override void SetAlpha(float tintAlpha, float alphaPercent){}

        public override void UpdateVisuals(){}

        public void UpdateVisualsInEditor(){}

 

        private bool CalculateBounds(){}

        private Color GetTintColor(){}

 

        #if UNITY_EDITOR

            [CustomEditor(typeof(TeleportArea))]

            public class TeleportAreaEditor : Editor{

                void OnEnable(){}

                public override void OnInspectorGUI(){}

            }    //立钻哥哥:public class TeleportAreaEditor:Editor{}

        #endif

 

    }    //立钻哥哥:public class TeleportArea:TeleportMarkerBase{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++TeleportPoint(传送点)

++++立钻哥哥:This is a teleport point that the player can teleport to.这是玩家能够传送到的传送点

++++When teleporting onto these, the player will teleport at the origin of the point regardless of where on the point they were pointing.立钻哥哥:传送到这些东西上时,玩家将会在点的原点进行传送,而无论他们所指向的点在哪里

++++These points can be named.立钻哥哥:这些点能够命名

++++The points also have the ability to teleport players to new scenes.(This isnt fully functional since you will have to hook it up to your scene loading system.)立钻哥哥:传送点还能够传送玩家到新的场景。(这并非彻底的功能,由于你必须把它链接到你的场景加载系统。)

++++\Assets\SteamVR\InteractionSystem\Teleport\Scripts\TeleportPoint.cs

//Purpose: Single location that the player can teleport to.(立钻哥哥:用途:单一的位置,玩家能够传送到

using UnityEngine;

using UnityEngine.UI;

#if UNITY_EDITOR

    using UnityEditor;

#endif

 

namespace Valve.VR.InteractionSystem{

    public class TeleportPoint : TeleportMarkerBase{

        public enum TeleportPointType{

            MoveToLocation,

            SwitchToNewScene

        };

 

        public TeleportPointType teleportType = TeleportPointType.MoveToLocation;

        public string title;

        public string switchToScene;

        public Color titleVisibleColor;

        public Color titleHighlightedColor;

        public Color titleLockedColor;

        public bool playerSpawnPoint = false;

 

        private bool gotReleventComponents = false;

        private MeshRenderer markerMesh;

        private Transform lookAtJointTransform;

        private new Animation animation;

        private Text titleText;

        private Player player;

        private Vector3 lookAtPosition = Vector3.zero;

        private int tintColorID = 0;

        private Color tintColor = Color.clear;

        private Color titleColor = Color.clear;

        private float fullTitleAlpha = 0.0f;

 

        private const string switchSceneAnimation = switch_scene_idle;

        private const string moveLocationAnimation = move_location_idle;

        private const string lockedAnimation = locked_idle;

 

        public override bool showReticle{  get{  return false;  }  }

 

        void Awake(){

            GetRelevantComponents();

            animation = GetComponent<Animation>();

            tintColorID = Shader.PropertyToID(_TintColor);

 

            moveLocationIcon.gameObject.SetActive(false);

            switchSceneIcon.gameObject.SetActive(false);

            lockedIcon.gameObject.SetActive(false);

 

            UpdateVisuals();

        }

 

        void Start(){

            player = Player.instance;

        }

 

        void Update(){

            if(Application.isPlaying){

                lookAtPosition.x = player.hmdTransform.position.x;

                lookAtPosition.y = lookAtJointTransform.position.y;

                lookAtPosition.z = player.hmdTransform.position.z;

 

                lookAtJointTransform.LookAt(lookAtPosition);

            }

        }

 

        public override bool ShouldActivate(Vector3 playerPosition){}

        public override bool ShouldMovePlayer(){}

        public override void Highlight(bool highlight){}

        public override void UpdateVisuals(){}

         public override void SetAlpha(float tintAlpha, float alphaPercent){}

 

        public void SetMeshMaterials(Material material, Color textColor){}

        public void TeleportToScene(){}

        public void GetRelevantComponents(){}

        public void ReleaseRelevantComponents(){}

        public void UpdateVisualsInEditor(){}

 

        #if UNITY_EDITOR

            [CustomEditor(typeof(TeleportPoint))]

            public class TeleportPointEditor : Editor{

                void OnEnable(){}

                public override void OnInspectorGUI(){}

            }    //立钻哥哥:public class TeleportPointEditor:Editor{}

        #endif

 

    }    //立钻哥哥:public class TeleportPoint:TeleportMarkerBase{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++TeleportArc(传送弧)

++++立钻哥哥:This draws the arc for the teleport pointer and does the physics trace for the teleport system.这将为传送端口指针绘制弧线,并为传送端口系统进行物理跟踪

++++\Assets\SteamVR\InteractionSystem\Teleport\Scripts\TeleportArc.cs

//Purpose: Displays the arc lines for teleporting and does the traces.(立钻哥哥:用途:显示用于远程传送的弧线并进行跟踪

using UnityEngine;

 

namespace Valve.VR.InteractionSystem{

    public class TeleportArc : MonoBehaviour{

        public int segmentCount = 60;

        public float thickness = 0.01f;

 

        void Start(){

            arcTimeOffset = Time.time;

        }

 

        void Update(){}

 

        private void CreateLineRendererObjects(){}

 

        public void SetArcData(Vector3 position, Vector3 velocity, bool gravity, bool pointerAtBadAngle){

            startPos = position;

            projectileVelocity = velocity;

            useGravity = gravity;

            arcTimeOffset = Time.time;

            arcInvalid = pointerAtBadAngle;

        }

 

        public void Show(){}

        public void Hide(){}

 

        //Draws each segment of the arc individually.(立钻哥哥:分别画出弧的每一段

        public bool DrawArc(out RaycastHit hitInfo){}

 

        private void DrawArcSegment(int index, float startTime, float endTime){}

 

        public void SetColor(Color color){}

 

        private float FindProjectileCollision(out RaycastHit hitInfo){}

 

        public Vector3 GetArcPositionAtTime(float time){}

 

        private void HideLineSegments(int startSegment, int endSegment){}

 

    }    //立钻哥哥:public class TeleportArc:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++AllowTeleportWhileAttachedToHand(容许传送时附加在手)

++++立钻哥哥:By default you cant teleport using a hand that has something attached to it. Adding this component to an attached object bypasses that rule.默认状况下,你不能用一只手来传送东西。将此组件添加到附加对象能够绕过该规则

++++This is used by the BlankController and longbow Arrow objects so that the player can teleport even while they are attched to the hand.立钻哥哥:这是使用空白控制器和长弓箭对象,以便玩家能够传送,即便他们是链接到手上.

++++\Assets\SteamVR\InteractionSystem\Teleport\Scripts\AllowTeleportWhileAttachedToHand.cs

//Purpose: Adding this component to an object will allow the player to initiate teleporting while that object is attached to their hand.(立钻哥哥:目的:将这个组件添加到一个对象将容许玩家在该对象与他们的手链接时启动传送

using UnityEngine;

 

namespace Valve.VR.InteractionSystem{

    public class AllowTeleportWhileAttachedToHand : MonoBehaviour{

        public bool teleportAllowed = true;

        public bool overrideHoverLock = true;

    }    //立钻哥哥:public class AllowTeleportWhileAttachedToHand:MonoBehaviour{}

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++IgnoreTeleportTrace(忽略传送跟踪)

++++立钻哥哥:Adding this to an object with a collider will allow the teleport trace to pass through it.将其添加到带有碰撞体的对象将容许传送跟踪经过它

++++A different way of dealing with this would be to put that object on a different layer that the TeleportArc doesnt check against.立钻哥哥:另外一种处理方法是将该对象放在TeleportArc不检查的另外一个层上

++++This is used on the longbow Arrow to allow the teleport trace to pass through the arrow tip.立钻哥哥:这是用于长弓箭容许传送跟踪经过箭头尖

++++\Assets\SteamVR\InteractionSystem\Teleport\Scripts\IgnoreTeleportTrace.cs

//Purpose: Allows the teleport arc trace to pass through any colliders on this object.(立钻哥哥:目的:容许传送弧跟踪经过该对象上的任何碰撞器

using UnityEngine;

using System.Collections;

 

namespace Valve.VR.InteractionSystem{

    public class IgnoreTeleportTrace : MonoBehaviour{

    }    //立钻哥哥:public class IgnoreTeleportTrace:MonoBehaviour{}

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++Teleporting(Prefab)(传送预制体)

++++立钻哥哥:This prefab sets up the entire teleport system.这个预置设置了整个传送系统

++++Dragging this into your scene will give you the ability to bring up the teleport pointer in your game.立钻哥哥:拖拽这个到你的场景中会让你在游戏中打开传送指针.

++++All of the visuals and sounds of the teleport system can be changed by modifying the properties of this prefab.立钻哥哥:全部的传送系统的视觉和声音能够经过修改这个预制的属性来改变

 

++TeleportPoint(Prefab)(传送点预制体)

++++立钻哥哥:Add these to your scene to add locations that the player can teleport to.将这些添加到场景中,以添加玩家能够传送到的位置

++++Note: The names of some of the objects in this scene are hard-coded and some of the code will need to be modified if you want to change the models.立钻哥哥:注意:此场景中的一些对象的名称是硬编码的,若是您想更改模型,则须要修改其中的一些代码.

 

++Render Model(渲染模型)

++++立钻哥哥:Unlike the SteamVR_Render_Model component this Render_Model component inside the Interaction System handles both controller models as well as hand models and enabling/disabling them individually.与“SteamVR_Render_Model”组件不一样,“交互系统”中的“Render_Model”组件同时处理控制器模型和手动模型,并分别启用/禁用它们

++++\Assets\SteamVR\InteractionSystem\Core\Scripts\RenderModel.cs

using UnityEngine;

using System.Collections;

using System;

 

namespace Valve.VR.InteractionSystem{

    public class RenderModel : MonoBehaviour{

        public GameObject handPrefab;

 

        protected GameObject handInstance;

        protected Renderer[] handRenderers;

        protected SteamVR_Behaviour_Skeleton handSkeleton;

        protected Animator handAnimator;

 

        protected void Awake(){

            renderModelLoadedAction = SteamVR_Events.RenderModelLoadedAction(OnRenderModelLoaded);

            InitializeHand();

            InitializeController();

       }

 

        protected void InitializeHand(){}

        protected void InitializeController(){}

        protected virtual void DestroyHand(){}

        protected virtual void OnSkeletonActiveChange(SteamVR_Action_Skeleton changedAction, bool newState){}

        protected void OnEnable(){}

        protected void OnDisable(){}

        protected void OnDestroy(){}

 

        public SteamVR_Behaviour_Skeleton GetSkeleton(){}

        public virtual void SetInputSource(SteamVR_Input_Sources newInputSource){}

        public virtual void OnHandInitialized(int deviceIndex){}

        public void MatchHandToTransform(Transform match){}

        public void SetHandPosition(Vector3 newPosition){}

        public void SetHandRotation(Quaternion newRotation){}

        public Vector3 GetHandPosition(){}

        public Quaternion GetHandRotation(){}

 

        private void OnRenderModelLoaded(SteamVR_RenderModel loadedRenderModel, bool success){}

 

        public void SetVisibility(bool state, bool overrideDefault=false){}

        public void Show(bool overrideDefault=false){}

        public void Hide(){}

        public virtual void SetMaterial(Material material){}

        public void SetControllerMaterial(Material material){}

        public void SetHandMaterial(Material material){}

        public void SetControllerVisibility(bool state, bool permanent=false){}

        public void SetHandVisibility(bool state, bool permanent=false){}

        public void IsHandVisible(){}

        public void IsControllerVisibile(){}

        public Transform GetBone(int boneIndex){}

        public Vector3 GetBonePosition(int boneIndex, bool local=false){}

        public Vector3 GetControllerPosition(string componentName=null){}

        public Quaternion GetBoneRotation(int boneIndex, bool local=false){}

        public void SetSkeletonRangeOfMotion(EVRSkeletalMotionRange newRangeOfMotion, float blendOverSeconds=0.1f){}

 

        public EVRSkeletalMotionRange GetSkeletonRangeOfMotion{}

 

        public void SetTemporarySkeletonRangeOfMotion(SkeletalMotionRangeChange temporaryRangeOfMotionChange, float blendOverSeconds=0.1f){}

        public void ResetTemporarySkeletonRangeOfMotion(float blendOverSeconds=0.1f){}

        public void SetAnimationState(int stateValue){}

        public void StopAnimation(){}

        private bool CheckAnimatorInit(){}

 

    }    //立钻哥哥:public class RenderModel:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++Hints(提示)

++++立钻哥哥:The hint system shows hints on the controllers.提示系统在控制器上显示提示

++++The hints are set up in a way where each button on the controller can be called out separately.立钻哥哥:提示的设置方式是,控制器上的每一个按钮均可以单独调用.

++++There is also the ability to show text hints associated with each button.立钻哥哥:还能够显示与每一个按钮关联的文本提示.

 

++ControllerButtonHints(控制器按钮提示)

++++立钻哥哥:This hints are set up based on the render model of the controller.这个提示是基于控制器的呈现模型创建的

++++SteamVR provides a mapping from render model components to button IDs. This mapping is used to figure out what part of the controller corresponds to which button.立钻哥哥:SteamVR”提供了从渲染模型组件到按钮id的映射。这个映射用于找出控制器的哪一个部分对应于哪一个按钮

++++Once a hint for a button is activated, that button will keep flashing on the controller model until the hint is turned off.立钻哥哥:一旦一个按钮的提示被激活,该按钮将继续在控制器模型上闪烁,直到提示被关闭.

++++Hints can be for buttons only or with an optional text hint associated with the button.立钻哥哥:提示只能用于按钮,也能够与与按钮关联的可选文本提示一块儿使用

++++There are a few static methods that are used to interface with the hint system:立钻哥哥:这里有一些静态方法,用于与提示系统接口:

----[ShowButtonHint]: Flashes the specified button on the specified hand.立钻哥哥:[ShowButtonHint]:在指定的手上闪烁指定的按钮.

----[HideButtonHint]: Stops flashing the specified button on the specified hand.立钻哥哥:[HideButtonHint]:中止在指定的手上闪烁指定的按钮.

----[HideAllButtonHints]: Stops flashing all the buttons on the specified hand.立钻哥哥:[hideallbuttonhint]:中止闪烁指定手的全部按钮.

----[IsButtonHintActive]: Checked if a specified button is flashing on the specified hand.立钻哥哥:[IsButtonHintActive]:检查指定的按钮是否在指定的手上闪烁.

----[ShowTextHint]: Shows a text hint with the passed in string associated with the specified button on the specified hand.立钻哥哥:[ShowTextHint]:显示与指定手的指定按钮相关联的传入字符串的文本提示.

----[HideTextHint]: Hides the text hint for the specified hand on the specified button.立钻哥哥:[HideTextHint]:隐藏指定按钮上指定手的文本提示.

----[HideAllTextHints]: Hides all the text hints that are currently active on the specified hand.立钻哥哥:[HideAllTextHints]:隐藏当前在指定指针上活动的全部文本提示.

----[GetActiveHintText]: Gets the active hint text for a specified button.立钻哥哥:[GetActiveHintText]:获取指定按钮的活动提示文本.

 

++++\Assets\SteamVR\InteractionSystem\Hints\Scripts\ControllerButtonHints.cs

//Purpose: Displays text and button hints on the controllers.(立钻哥哥:用途:在控制器上显示文本和按钮提示.

using UnityEngine;

using System.Collections;

using System.Collections.Generic;

using UnityEngine.UI;

using System.Text;

 

namespace Valve.VR.InteractionSystem{

    public class ControllerButtonHints : MonoBehaviour{

        public Material controllerMaterial;

        public Color flashColor = new Color(1.0f, 0.557f, 0.0f);

        public GameObject textHintPrefab;

 

        private enum OffsetType{

            Up,

            Right,

            Forward,

            Back

        }

 

        //Info for each of the buttons.(立钻哥哥:每一个按钮的信息

        private class ActionHintInfo{

            public string componentName;

            public List<MeshRenderer> renderers;

            public Transform localTransform;

 

            public GameObject textHintObject;

            public Text text;

        }

 

        private Dictionary<ISteamVR_Action_In_Source, ActionHintInfo> actionHintInfos;

 

        SteamVR_Events.Action renderModelLoadedAction;

 

        protected SteamVR_Input_Sources inputSource;

 

        void Awake(){

            renderModelLoadedAction = SteamVR_Events.RenderModelLoadedAction(OnRenderModelLoaded);

            colorID = Shader.PropertyToID(_Color);

        }

 

        void Start(){  player = Player.instance;  }

 

        private void HintDebugLog(string msg){}

 

        void OnDisable(){}

 

        private void OnParentHandInputFocusLost(){

            //Hide all the hints when the controller is no longer the primary attached object.(立钻哥哥:当控制器再也不是主要附加对象时隐藏全部提示

            HideAllButtonHints();

            HideAllText();

        }

 

        public virtual void SetInputSource(SteamVR_Input_Sources newInputSource){}

 

        //Gets called when the hand has been initialized and a render model has been set.(立钻哥哥:在初始化手并设置呈现模型时调用

        private void OnHandInitialized(int deviceIndex){}

 

        private Dictionary<string, Transform> componentTransformMap = new Dictionary<string, Transform>();

 

        void OnRenderModelLoaded(SteamVR_RenderModel renderModel, bool suceess){}

 

        private IEnumerator DoInitialize(SteamVR_RenderModel renderModel){}

        private void CreateAndAddButtonInfo(ISteamVR_Action_In action, SteamVR_Input_Sources inputSource){}

        private void ComputeTextEndTransforms(){}

        private void ShowButtonHint(params ISteamVR_Action_In_Source[] actions){}

        private void HideAllButtonHints(){}

        private void HideButtonHint(params ISteamVR_Action_In_Source[] actions){}

        private bool IsButtonHintActive(ISteamVR_Action_In_Source action){}

        private IEnumerator TestButtonHints(){}

        private IEnumerator TestTextHints(){}

 

        void Update(){}

 

        private void UpdateTextHint(ActionHintInfo hintInfo){}

 

        private void Clear(){

            renderers.Clear();

            flashingRenderers.Clear();

        }

 

        private void ShowText(ISteamVR_Action_In_Source action, string text, bool highlightButton=true){}

        private void HideText(ISteamVR_Action_In_Source action){}

        private void HideAllText(){}

        private string GetActiveHintText(ISteamVR_Action_In_Source action){}

 

        private static ControllerButtonHints GetControllerButtonHints(Hand hand){}

        private static void ShowButtonHint(Hand hand, params ISteamVR_Action_In_Source[] actions){}

        public static void HideButtonHint(Hand hand, params ISteamVR_Action_In_Source[] actions){}

        public static void HideAllButtonHints(Hand hand){}

        public static bool IsButtonHintActive(Hand hand, ISteamVR_Action_In_Source action){}

        public static void ShowTextHint(Hand hand, ISteamVR_Action_In_Source action, string text, bool highlightButton=true){}

        public static void HideTextHint(Hand hand, ISteamVR_Action_In_Source action){}

        public static void HideAllTextHints(Hand hand){}

        public static string GetActiveHintText(Hand hand, ISteamVR_Action_In_Source action){}

 

    }    //立钻哥哥:public class ControllerButtonHints:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++Longbow(长弓)

++++立钻哥哥:The Longbow is an example of a complex game mechanic created using the interaction system.“长弓”是一个使用交互系统建立的复杂游戏机制的例子

++++The version included here is exactly the same one that we shipped in The Lab, including all the models, materials and sounds.立钻哥哥:这里包含的版本与咱们在“实验室”中提供的版本彻底相同,包括全部的模型、材质和声音

++++The Longbow is built using the ItemPackage system. It is comprised of the LongbowItemPackage prefab which spawns the Longbow prefab in the main hand and the ArrowHand prefab in the other hand.立钻哥哥:“长弓”是使用“ItemPackage”系统构建的。它由“LongbowItemPackage”预制块和“ArrowHand”预制块组成,前者在主手端生成“Longbow”预制块,后者在另外一只手端生成“ArrowHand”预制块.

++++The ArrowHand prefab then spawns a new arrow in the hand every time one is fired.立钻哥哥:ArrowHand”预置而后产生一个新的箭头在手中每次发射.

++++All of the bow and arrow logic is present in the following scripts.立钻哥哥:全部的弓箭逻辑都出如今下面的脚本中.

 

++Longbow.cs(长弓逻辑脚本)

++++立钻哥哥:It handles the logic of how the bow controls in nocked and un-nocked modes.它处理的逻辑如何控制弓在不在弦模式.

++++It also keeps track of how far the bow string is pulled.立钻哥哥:它还能记录弓弦被拉了多远.

++++\Assets\SteamVR\InteractionSystem\Longbow\Scripts\Longbow.cs

//Purpose: The bow.(立钻哥哥:目的:弓)

using UnityEngine;

using System.Collections;

using System.Collections.Generic;

 

namespace Valve.VR.InteractionSystem{

    [RequireComponent(typeof(Interactable))]

    public class Longbow : MonoBehaviour{

        public enum Handedness{  Left,  Right  };

 

        private Hand hand;

        private ArrowHand arrowHand;

 

        SteamVR_Events.Action newPosesAppliedAction;

 

        private void OnAttachedToHand(Hand attachedHand){}

        private void HandAttachedUpdate(Hand hand){}

 

        public void ArrowReleased(){}

 

        private IEnumerator ResetDrawAnim(){}

    

        public float GetArrowVelocity(){}

        public void StartRotationLerp(){}

        public void StartNock(ArrowHand currentArrowHand){}

       

        private void EvaluateHandedness(){}

        private void DoHandednessCheck(){}

 

        public void ArrowInPosition(){}

        public void ReleaseNock(){}

 

        private void ShutDown(){}

        private void OnHandFocusLost(Hand hand){}

        private void OnHandFocusAcquired(Hand hand){}

        private void OnDetachedFromHand(Hand hand){}

 

        void OnDestroy(){}

 

    }    //立钻哥哥:public class Longbow:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++ArrowHand.cs(箭在手脚本)

++++立钻哥哥:Handles nocking and firing the arrow based on its position and the controller buttons.根据箭头的位置和控制器按钮处理搭接和发射弓箭。

++++Handles spawing an arrow in the hand when needed.立钻哥哥:处理在须要时在手上生成弓箭。

++++\Assets\SteamVR\InteractionSystem\Longbow\Scripts\ArrowHand.cs

//Purpose: The object attached to the players hand that spawns and fires the arrow.(立钻哥哥:目的:附加在玩家手上的物品,用来生成和发射箭

using UnityEngine;

using System.Collections;

using System.Collections.Generic;

 

namespace Valve.VR.InteractionSystem{

    public class ArrowHand : MonoBehaviour{

        private Hand hand;

        private Longbow bow;

 

        private GameObject currentArrow;

        public GameObject arrowPrefab;

 

        public SoundPlayOneShot arrowSpawnSound;

 

        private List<GameObject> arrowList;

 

        void Awake(){

            allowTeleport = GetComponent<AllowTeleportWhileAttachedToHand>();

            //allowTeleport.teleportAllowed = true;

            allowTeleport.overrideHoverLock = false;

            arrowList = new List<GameObject>();

        }

 

        private void OnAttachedToHand(Hand attachedHand){

            hand = attachedHand;

            FindBow();

        }

 

        private GameObject InstantiateArrow(){

            GameObject arrow = Instantiate(arrowPrefab, arrowNockTransform.position, arrowNockTransform.rotation) as GameObject;

            arrow.name = 立钻牌Bow Arrow;

            arrow.transform.parent = arrowNockTransform;

            Util.ResetTransform(arrow.transform);

 

            arrowList.Add(arrow);

 

            while(arrowList.Count > maxArrowCount){

                GameObject oldArrow = arrowList[0];

                arrowList.RemoveAt(0);

                if(oldArrow){

                    Destroy(oldArrow);

                }

            }

 

            return arrow;

        }    //立钻哥哥:private GameObject InstantiateArrow(){}

 

        private void HandAttachedUpdate(Hand hand){}

        private void OnDetachedFromHand(Hand hand){}

        private void FireArrow(){}

        private void EnableArrowSpawn(){}

        private IEnumerator ArrowReleaseHaptics(){}

        private void OnHandFocusLost(Hand hand){}

        private void OnHandFocusAcquired(Hand hand){}

        private void FindBow(){}

 

    }    //立钻哥哥:public class ArrowHand:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++Arrow.cs(弓箭)

++++立钻哥哥:The actual arrow that gets fired.实际射出的箭

++++This script handles all the in-flight logic for the arrow including collision detection and deciding when to stick in to targets.立钻哥哥:这个脚本处理箭的全部飞行中的逻辑,包括碰撞检测和决定什么时候插入目标

++++\Assets\SteamVR\InteractionSystem\Longbow\Scripts\Arrow.cs

//Purpose: The arrow for the longbow.(立钻哥哥:用途:用于长弓的箭

using UnityEngine;

using System.Collections;

 

namespace Valve.VR.InteractionSystem{

    public class Arrow : MonoBehaviour{

        public ParticleSystem glintParticle;

        public Rigidbody arrowHeadRB;

        public Rigidbody shaftRB;

 

        public PlaySound hitGroundSound;

 

        void Start(){

            Physics.IgnoreCollision(shaftRB.GetComponent<Collider>(), Player.instance.headCollider);

        }

 

        void FixedUpdate(){}

 

        public void ArrowReleased(float inputVelocity){}

 

        protected void SetCollisionMode(CollisionDetectionMode newMode, bool force=false){}

 

        void OnCollisionEnter(Collision collision){}

 

        private void StickInTarget(Collision collision, bool bSkipRayCast){}

 

        void OnDestroy(){}

 

    }    //立钻哥哥:public class Arrow:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++ArrowheadRotation.cs(箭头旋转)

++++立钻哥哥:Rotates the arrowhead randomly every time a new arrow is spawned.每次生成一个新箭时,随机旋转箭头

++++\Assets\SteamVR\InteractionSystem\Longbow\Scripts\ArrowheadRotation.cs

//Purpose: Sets a random rotation for the arrow head.(立钻哥哥:目的:设置箭头的随机旋转.

using UnityEngine;

using System.Collections;

 

namespace Valve.VR.InteractionSystem{

    public class ArrowheadRotation : MonoBehaviour{

        void Start(){

            float randX = Random.Range(0f, 180f);

            transform.localEulerAngles = new Vector3(randX, -90f, 90f);

        }

 

    }    //立钻哥哥:public class ArrowheadRotation:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++SoundBowClick.cs(拉弓的声音)

++++立钻哥哥:Plays the sounds of the bow string being pulled.播放弓弦被拉的声音

++++The other scripts in the Longbow folder handle the logic for the longbow targets.立钻哥哥:“Longbow”文件夹中的其余脚本处理“longbow”目标的逻辑

++++\Assets\SteamVR\InteractionSystem\Longbow\Scripts\SoundBowClick.cs

//Purpose: Sounds for the bow pulling back.(立钻哥哥:用途:用于拉弓的声音

using UnityEngine;

using System.Collections;

 

namespace Valve.VR.InteractionSystem{

    public class SoundBowClick : MonoBehaviour{

        public AudoClip bowClick;

        public AnimationCurve pitchTensionCurve;

        public float minPitch;

        public float maxPitch;

 

        AudioSource thisAudioSource;

 

        void Awake(){

            thisAudioSource = GetComponent<AudioSource>();

        }

 

        public void PlayBowTensionClicks(float normalizedTension){

            //Tension is a float between 0 and 1.1 being max tension and 0 being to tension.(立钻哥哥:张力是介于0和1.1之间的浮动,最大张力为0,最大张力为0

            float y = pitchTensionCurve.Evaluate(normalizedTension);

 

            thisAudioSource.pitch = ((maxPitch - minPitch) * y) + minPitch;

            thisAudioSource.PlayOneShot(bowClick);

        }

 

    }    //立钻哥哥:public class SoundBowClick:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++ArcheryTarget.cs(射箭的目标)

++++立钻哥哥:This is the script for a generic archery target.这是一个普通射箭目标的脚本

++++It invokes a UnityEvent when hit by an arrow.立钻哥哥:当被箭头击中时,它调用一个“UnityEvent”.

++++\Assets\SteamVR\InteractionSystem\Longbow\Scripts\ArcheryTarget.cs

//Purpose: Target that sends events when hit by an arrow.(立钻哥哥:目的:当被箭头击中时发送事件的目标.

using UnityEngine;

using UnityEngine.Events;

using System.Collections;

 

namespace Valve.VR.InteractionSystem{

    public class ArcheryTarget : MonoBehaviour{

        public UnityEvent onTakeDamage;

    

        public bool onceOnly = false;

        public Transform targetCenter;

    

        private void ApplyDamage(){}

        private void FireExposure(){}

        private void OnDamageTaken(){}

 

        private IEnumerator FallDown(){

            if(baseTransform){

                Quaternion startingRot = baseTransform.rotation;

            

                float startTiem = Time.time;

                float rotLerp = 0f;

 

                while(rotLerp < 1){

                    rotLerp = Util.RemapNumberClamped(Time.time, startTime, startTime + fallTime, 0f, 1f);

                    baseTransform.rotation = Quaternion.Lerp(startingRot, fallenDownTransform.rotation, rotLerp);

                    yield return null;

                }

            }    //立钻哥哥:if(baseTransform){}

 

            yield return null;

        }    //立钻哥哥:private IEnumerator FallDown(){}

 

    }    //立钻哥哥:public class ArcheryTarget:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++FireSource.cs(着火点)

++++立钻哥哥:Indicates an object that can be set on fire. Once on fire this object can then spread fire when it comes in contact with another FireSource.指示能够设置为着火的对象。一旦着火,当它与另外一个FireSource接触时,这个对象就会传播火焰

++++\Assets\SteamVR\InteractionSystem\Longbow\Scripts\FireSource.cs

//Purpose: This object can be set on fire.(立钻哥哥:用途:这个物体能够被点燃

using UnityEngine;

using System.Collections;

 

namespace Valve.VR.InteractionSystem{

    public class FireSource : MonoBehaviour{

        public GameObject fireParticlePrefab;

        public bool startActive;

        private GameObject fireObject;

 

        public ParticleSystem customParticles;

 

        void Start(){}

        void Update(){}

        void OnTriggerEnter(Collider other){}

 

        private void FireExposure(){}

        private void StartBurning(){}

 

    }    //立钻哥哥:public class FireSource:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++ExplosionWobble.cs(爆炸摆动)

++++立钻哥哥:Used to make the archery target wobble.用于使箭靶摇摆

++++\Assets\SteamVR\InteractionSystem\Longbow\Scripts\ExplosionWobble.cs

//Purpose: Makes the weeble wobble.(立钻哥哥:目的:使weeble抖动

using UnityEngine;

using System.Collections;

 

namespace Valve.VR.InteractionSystem{

    public class ExplosionWobble : MonoBehaviour{

        var rb = GetComponent<Rigidbody>();

        if(rb){

            rb.AddExplosionForce(2000, explosionPos, 10.0f);

        }

    }    //立钻哥哥:public class ExplosionWobble:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++Balloon.cs(气球)

++++立钻哥哥:\Assets\SteamVR\InteractionSystem\Longbow\Scripts\Balloon.cs

//Purpose: BALLOONS!!(立钻哥哥:目的:气球!

using UnityEngine;

using System.Collections;

 

namespace Valve.VR.InteractionSystem{

    public class Balloon : MonoBehaviour{

        public enum BalloonColor{

            Red,

            OrangeRed,

            Orange,

            YellowOrange,

            Yellow,

            GreenYellow,

            Green,

            BlueGreen,

            Blue,

            VioletBlue,

            Violet,

            RedViolet,

            LightGray,

            DarkGray,

            Random

        }    //立钻哥哥:public enum BalloonColor{}

 

        private Hand hand;

 

        public GameObject popPrefab;

 

        private Rigidbody balloonRigidbody;

 

        void Start(){

            destructTime = Time.time + lifetime + Random.value;

            hand = GetComponentInParent<Hand>();

            balloonRigidbody = GetComponent<Rigidbody>();

        }

 

        void Update(){}

 

        private void SpawnParticles(GameObject particlePrefab, SoundPlayOneshot sound){}

 

        void FixedUpdate(){}

 

        private void ApplyDamage(){}

 

        void OnCollisionEnter(Collision collision){}

 

        public void SetColor(BalloonColor color){}

 

        private Color BalloonColorToRGB(BalloonColor balloonColorVar){}

 

    }    //立钻哥哥:public class Balloon:MonoBehaviour{}

 

}     //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++BalloonColliders.cs(气球碰撞体)

++++立钻哥哥:\Assets\SteamVR\InteractionSystem\Longbow\Scripts\BalloonColliders.cs

//Purpose: Can be attached to the controller to collide with the balloons.(立钻哥哥:用途:可附加在控制器上与气球相撞

using UnityEngine;

using System.Collections;

 

namespace Valve.VR.InteractionSystem{

    public class BalloonColliders : MonoBehaviour{

        public GameObject[] colliders;

        private Vector3[] colliderLocalPositions;

        private Quaternion[] colliderLocalRotations;

        private Rigidbody rb;

 

        void Awake(){

            rb = GetComponent<Rigidbody>();

     

            colliderLocalPositions = new Vector3[colliders.Length];

            colliderLocalRotations = new Quaternion[colliders.Length];

            for(int i = 0;  i < colliders.Length;  ++i){

                colliderLocalPositions[i] = colliders[i].transform.localPosition;

                colliderLocalRotations[i] = colliders[i].transform.localRotation;

 

                colliders[i].name = gameObject.name + . +colliders[i].name;

            }

        }    //立钻哥哥:void Awake(){}

 

        void OnEnable(){}

        void OnDisable(){}

        void OnDestroy(){}

 

    }    //立钻哥哥:public class BalloonColliders:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++BalloonHapticBump.cs(气球触觉碰撞)

++++立钻哥哥:\Assets\SteamVR\InteractionSystem\Longbow\Scripts\BalloonHapticBump.cs

//Purpose: Provides a haptic bump when colliding with balloons.(立钻哥哥:用途:与气球碰撞时产生触感碰撞

using UnityEngine;

using System.Collections;

 

namespace Valve.VR.InteractionSystem{

    public class BalloonHapticBump : MonoBehaviour{

        public GameObject physParent;

    

        void OnCollisionEnter(Collision other){

            Balloon contactBalloon = other.collider.GetComponentInParent<Balloon>();

            if(contactBalloon != null){

                Hand hand = physParent.GetComponentInParent<Hand>();

                if(hand != null){

                    hand.TriggerHapticPulse(500);

                }

            }

        }    //立钻哥哥:void OnCollisionEnter(Collision other){}

 

    }    //立钻哥哥:public class BalloonHapticBump:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++BalloonSpawner.cs(气球卵生器)

++++立钻哥哥:These scripts handle the logic for the balloons that spawn when the weeble is hit with an arrow.这些脚本处理当weeble被箭头击中时生成的气球的逻辑

++++\Assets\SteamVR\InteractionSystem\Longbow\Scripts\BalloonSpawner.cs

//Purpose: Spawns balloons.(立钻哥哥:目的:产生气球

using UnityEngine;

using System.Collections;

 

namespace Valve.VR.InteractionSystem{

    public class BalloonSpawner : MonoBehaviour{

        public GameObject balloonPrefab;

        public Transform spawnDirectionTransform;

 

        void Start(){}

        void Update(){}

 

        public GameObject SpawnBalloon(Balloon.BalloonColor color=Balloon.BalloonColor.Red){}

        public void SpawnBalloonFromEvent(int color){}

 

    }    //立钻哥哥:public class BalloonSpawner:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem{}

 

++Samples(例子)

++++立钻哥哥:There are a few classes that were created specifically to show some examples in the sample scene.有几个类是专门为在示例场景中显示一些示例而建立的

++++[ControllerHintsExample.cs]:This class shows how to use the hint system.立钻哥哥:[ControllerHintsExample.cs]:这个类展现了如何使用提示系统.

++++[InteractableExample.cs]:This class shows a very simple example of receiving and responding to messages from the hand.立钻哥哥:[InteractableExample.cs]:这类显示了一个很是简单的示例接收来自手的响应信息.

 

++ControllerHintsExample(提示系统)

++++立钻哥哥:This class shows how to use the hint system.这个类展现了如何使用提示系统

//Purpose: Demonstrates the use of the controller hint system.(立钻哥哥:用途:演示控制器提示系统的使用

using UnityEngine;

using System.Collections;

using Valve.VR;

 

namespace Valve.VR.InteractionSystem.Smaple{

    public class ControllerHintsExample : MonoBehaviour{

        private Coroutine buttonHintCoroutine;

        private Coroutine textHintCoroutine;

 

        public void ShowButtonHints(Hand hand){}

        public void ShowTextHints(Hand hand){}

        public void DisableHints(){}

 

        //Cycles through all the button hints on the controller.(立钻哥哥:循环遍历控制器上的全部按钮提示

    private IEnumerator TestButtonHints(Hand hand){}

 

        //Cycles through all the text hints on the controller.(立钻哥哥:循环遍历控制器上的全部文本提示

        private IEnumerator TestTextHints(Hand hand){}

 

    }    //立钻哥哥:public class ControllerHintsExample:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem.Sample{}

 

++InteractableExample(交互例子)

++++立钻哥哥:This class shows a very simple example of receiving and responding to message from the hand.这个类展现了一个很是简单的接收和响应来自手的消息的例子

++++\Assets\SteamVR\InteractionSystem\Samples\Scripts\InteractableExample.cs

//Purpose: Demonstrates how to create a simple interactable object.(立钻哥哥:目的:演示如何建立一个简单的可交互对象

using UnityEngine;

using System.Collections;

 

namespace Valve.VR.InteractionSystem.Sample{

    [RequireComponent(typeof(Interactable))]

    public class InteractableExample : MonoBehaviour{

        private TextMesh generalText;

        private TextMesh hoveringText;

        private Vector3 oldPositon;

        private Quaternion oldRotation;

 

        private Interactable interactable;

 

        void Awake(){

            var textMeshs = GetComponentsInChildren<TextMesh>();

            generalText = textMeshs[0];

            hoveringText = textMeshs[1];

 

            generalText.text = No Hand Hovering;

            hoveringText.text = Hovering: False;

 

            interactable = this.GetComponent<Interactable>();

        }    //立钻哥哥:void Awake(){}

 

        private void OnHandHoverBegin(Hand hand){}

        private void OnHandHoverEnd(Hand hand){}

 

        //Called every Update() while a Hand is hovering over this object.(立钻哥哥:当一只手悬停在此对象上时调用每一个Update()

        private void HandHoverUpdate(Hand hand){}

 

        private void OnAttachedToHand(Hand hand){}

        private void OnDetachedFromHand(Hand hand){}

        private void HandAttachedUpdate(Hand hand){}

 

        private bool lastHovering = false;

        private void Update(){}

 

        private void OnHandFocusAcquired(Hand hand){}

        private void OnHandFocusLost(Hand hand){}

 

    }    //立钻哥哥:public class InteractableExample:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR.InteractionSystem.Sample{}

 

 

 

 

 

 

##A.六、Skeleton Poser

##A.六、Skeleton Poser

++A.六、Skeleton Poser

++++立钻哥哥:The SteamVR_Skeleton_Poser script is designed to function independently from the SteamVR Interaction System and can be added to your own systems, but the SteamVR Interaction system works with it right out of the box and is a great way to quickly try it out.“SteamVR_Skeleton_Poser”脚本是独立于“SteamVR交互系统”而设计的,能够添加到您本身的系统中,可是“SteamVR交互系统”能够开箱即用地使用它,这是快速试用它的好方法

++++https://valvesoftware.github.io/steamvr_unity_plugin/articles/Skeleton-Poser.html

 

++The Basics(基本需求)

++++立钻哥哥:SteamVR_Skeleton_Poses are ScriptableObjects that contain a particular hand pose and some per-finger animation info.SteamVR_Skeleton_Poses”是“脚本化对象”,包含特定的手部姿式和一些每一个手指的动画信息

++++Multiple poses can be added to and modified via the SteamVR_Skeleton_Poser script with its handy UI. You can add any number of poses to one Poser, but you will likely only need a few at most. Using the buttons in the pose editor, new poses can be created, pose data can be copied between poses, pose data can be mirrored, poses can be reset to a variety of bases, and changes to skeletons in the scene view can be saved as changes to a pose. You can also add per-finger additive animation via the finger movement dropdowns. This lets the fingers move based on the skeleton input while remaining constrained to the pose. There are several types of finger movement:立钻哥哥:多个姿式能够经过“SteamVR_Skeleton_Poser”脚本及其方便的UI添加和修改。你能够在一个姿态的动做中加入任意数量的姿式,但你可能最多只须要几个。使用姿态编辑器中的按钮,能够建立新的姿态,能够在不一样的姿态之间复制姿态数据,能够镜像姿态数据,能够将姿态重置为各类基底,还能够将场景视图中对骨骼的更改保存为对姿态的更改。您还能够经过手指移动下拉菜单添加每一个手指的附加动画。这使得手指能够根据骨骼输入移动,同时保持姿式不变。手指运动有几种类型:

----[Static]: on finger movement. Only use pose.立钻哥哥:[静态]:手指运动。只使用姿式.

----[Free]: free finger movement. Ignore pose.立钻哥哥:[自由]:手指自由活动。忽略的姿式.

----[Extend]: fingers can lift up to a fully extended position, but not curl any farther down than where the pose has them.立钻哥哥:[伸展]:手指能够抬起到一个彻底伸展的位置,但不能弯曲到比这个姿式下更深的地方.

----[Contract]: fingers can curl to a fully contracted position, but cannot open any further than where the pose has them.立钻哥哥:[收缩]:手指能够弯曲成彻底收缩的姿式,但不能在超过这个姿式的任何地方张开.

++++Using the Posers Blending Editor tab, you can set up blending behaviours to mix and stack multiple poses in complex ways. Think of the blending editor as an animator controller, and the poses as animations. There are three types of blending behaviours you can add: Manual, analog action, or boolean action. Manual behaviours will have to be driven by code, with an easy call of: (立钻哥哥:使用“Poser的混合编辑器”选项卡,您能够设置混合行为,以复杂的方式混合和堆叠多个姿式。将混合编辑器看做是动画控制器,而将姿态看做是动画。您能够添加三种类型的混合行为:手动操做、模拟操做或布尔操做。手动行为将必须由代码驱动,很容易调用:

Poser.SetBlendingBehaviourValue(string behaviourName, float value);

++++Analog and boolean action behaviours, on the other hand, are automatically driven by a chosen action. The smoothing value will be the speed of smoothing applied to them, with 0 for none. Smoothing is not required for analog actions, but it recommended for Boolean-driven behaviours as they will look much smoother.立钻哥哥:另外一方面,模拟和布尔操做行为是由选择的操做自动驱动的。平滑值将是应用于它们的平滑速度,0表示没有。平滑不是模拟动做所必需的,但它推荐“布尔驱动”的行为,由于它们看起来会更平滑.

 

++Using the Skeleton Poser with Your Own Framework(在您本身的框架中使用“Skeleton Poser”)

++++立钻哥哥:As also mentioned before, the SteamVR_Skeleton_Poser script is designed to funciton independently from the SteamVR Interaction System. If you are using the SteamVR_Behaviour_Skeleton script to animate your hand, you can tell it to blend to the output of a particular poser with a call of BlendToPoser();(立钻哥哥:如前所述,“SteamVR_Skeleton_Poser”脚本被设计成独立于“SteamVR交互系统”运行。若是您使用“SteamVR_Behavior _Skeleton”脚本使您的手动起来,您能够经过调用“BlendToPoser()”告诉它混合到特定poser的输出.

++++If you are using a different solution to animate your skeleton, the Poser can generate poses on command in the format of the SteamVR_Skeleton_PoseSnapshot dataclass, which holds object offset and position/rotation for all the bones. Call poser.GetBlendedPose, passing either a SteamVR_Behaviour_Skeleton or a SteamVR_Action_Skeleton and SteamVR_Input_Sources hand identifier. This will give you a fully composited pose according to the various behaviours and options on that particular poser, which you can apply freely to your skeleton.立钻哥哥:若是您使用不一样的解决方案来动画您的骨骼,“Poser”能够根据命令生成“SteamVR_Skeleton_PoseSnapshot”数据类格式的pose,该数据类保存全部骨骼的对象偏移量和位置/旋转。调用poser.GetBlendedPose,传递一个“Steamvr_Behavior_Skeleton”或一个“SteamVR_Action_Skeleton”和“SteamVR_Input_Sources”手动标识符。这将给你一个彻底合成的姿式,根据不一样的行为和选择的特定姿式,你能够自由地应用到你的骨骼.

++++\Assets\SteamVR\Input\SteamVR_Behaviour_Pose.cs

using System;

using System.Threading;

using UnityEngine;

using UnityEngine.Events;

using Valve.VR;

 

namespace Valve.VR{

    //This component simplifies the use of Pose actions. Adding it to a gameobject will auto set that transforms position and rotation every update to match the pose.  Advanced velocity estimation is handled through a buffer of the last 30 updates.(立钻哥哥:这个组件简化了姿式动做的使用。将其添加到gameobject将自动设置转换位置并在每次更新时旋转以匹配该姿态。高级速度估计是经过最近30次更新的缓冲区来处理的

    public class SteamVR_Behaviour_Pose : MonoBehaviour{

        public SteamVR_Action_Pose poseAction = SteamVR_Input.GetAction<SteamVR_Action_Pose>(Pose);

        public SteamVR_Input_Sources inputSource;

        public Transform origin;

 

        protected virtual void Start(){}

        protected virtual void OnEnable(){}

        protected virtual void OnDisable(){}

 

        private void SteamVR_Behaviour_Pose_OnUpdate(SteamVR_Action_Pose fromAction, SteamVR_Input_Sources fromSource){}

        protected virtual void UpdateTransform(){}

        private void SteamVR_Behaviour_Pose_OnChange(SteamVR_Action_Pose fromAction, SteamVR_Input_Sources fromSources){}

        protected virtual void OnDeviceConnectedChanged(SteamVR_Action_Pose changedAction, SteamVR_Input_Sources changedSource, bool connected){}

        protected virtual void OnTrackingChanged(SteamVR_Action_Pose changedAction, SteamVR_Input_Sources changedSource, ETrackingResult trackingChanged){}

        protected virtual void CheckDeviceIndex(){}

 

        //Returns the device index of the device bound to the pose.(立钻哥哥:返回绑定到姿式的设备的设备索引

        public int GetDeviceIndex(){}

 

        //Returns the current velocity of the pose (as of the last update).(立钻哥哥:返回姿式的当前速度(截至上次更新时)

        public Vector3 GetAngularVelocity(){}

 

        //Returns the velocities of the pose at the time specified. Can predict in the future or return past values.(立钻哥哥:返回指定时刻的姿式速度。能够预测将来或返回过去的值

        public bool GetVelocitiesAtTimeOffset(float secondsFromNow, out Vector3 velocity, out Vector3 angularVelocity){}

 

        //Uses previously recorded values to find the peak speed of the pose and returns the corresponding velocity and angular velocity.(立钻哥哥:使用以前记录的值来查找姿式的峰值速度,并返回相应的速度和角速度

        public void GetEstimatedPeakVelocites(out Vector3 velocity, out Vector3 angularVelocity){}

 

        protected int lastFrameUpdated.

        protected void UpdateHistoryBuffer(){}

 

        //Gets the localized name of the device that the action corresponds to.(立钻哥哥:获取操做对应的设备的本地化名称

        public string GetLocalizedName(params EVRInputStringBits[] localizeParts){}

 

        public deleate void ActiveChangeHandler(SteamVR_Behaviour_Pose fromAction, SteamVR_Input_Sources fromSource, bool active){}

        public delegate void ChangeHandler(SteamVR_Behaviour_Pose fromAction, SteamVR_Input_Sources fromSouce){}

        public delegate void UpdateHandler(SteamVR_Behaviour_Pose fromAction, SteamVR_Input_Sources fromSource){}

        public delegate void TrackingChangeHandler(SteamVR_Behaviour_Pose fromAction, SteamVR_Input_Sources fromSource, ETrackingResult trackingState){}

        public delegate void ValidPoseChangeHandler(SteamVR_Behaviour_Pose fromAction, SteamVR_Input_Sources fromSource, bool validPose){}

        public delegate void DeviceConnectedChangeHandler(SteamVR_Behaviour_Pose fromAction, SteamVR_Input_Sources fromSource, bool deviceConnected){}

        public delegate void DeviceIndexChangedHandler(SteamVR_Behaviour_Pose fromAction, SteamVR_Input_Sources fromSource, int newDeviceIndex){}

 

    }    //立钻哥哥:public class SteamVR_Behaviour_Pose:MonoBehaviour{}

 

}    //立钻哥哥:namespace Valve.VR{}

 

 

 

 

#####====@@@@《快速入门:大结局》@@@===###

++++SteamVR2.2.0快速入门http://www.javashuo.com/article/p-fcmbsvpm-gb.html

++++SteamVR2.2.0交互系统http://www.javashuo.com/article/p-ocssrxuq-gd.html

++++SteamVR2.2.0传送机制http://www.javashuo.com/article/p-ophuaicg-gh.html

@@@@@因为篇幅太长,因此拆成了三篇!

++++SteamVR:https://blog.csdn.net/vrunsoftyanlz/article/category/8582642

 

 

 

【XR游戏开发QQ群:784477094

++立钻哥哥推荐的拓展学习连接(Link_Url)

立钻哥哥推荐的拓展学习连接(Link_Url)

++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz/

++++虚拟现实VR资讯: http://www.javashuo.com/article/p-fqrqdjkb-w.html

++++HTC_VIVE开发基础http://www.javashuo.com/article/p-mhcdmelt-bt.html

++++Oculus杂谈http://www.javashuo.com/article/p-unmgvyjw-ce.html

++++Oculus安装使用http://www.javashuo.com/article/p-ulvvimkb-cr.html

++++Unity+SteamVR=>VRhttp://www.javashuo.com/article/p-asetqfsg-da.html

++++Unity减小VR晕眩症http://www.javashuo.com/article/p-cendayuh-dt.html

++++SteamVR简介http://www.javashuo.com/article/p-awcwwcaq-ea.html

++++SteamVR脚本功能分析http://www.javashuo.com/article/p-ajqgwdev-ek.html

++++SteamVR2.0开发指南http://www.javashuo.com/article/p-wgdghzsl-er.html

++++SteamVR2.2.0开发指南http://www.javashuo.com/article/p-hguaxolf-ew.html

++++SteamVR2.2.0快速入门http://www.javashuo.com/article/p-fcmbsvpm-gb.html

++++SteamVR2.2.0交互系统http://www.javashuo.com/article/p-ocssrxuq-gd.html

++++SteamVR2.2.0传送机制http://www.javashuo.com/article/p-ophuaicg-gh.html

++++SteamVR2.2.0官方教程http://www.javashuo.com/article/p-gblmlsya-gp.html

++++SteamVR/Extrashttp://www.javashuo.com/article/p-qrebqbra-he.html

++++SteamVR/Inputhttp://www.javashuo.com/article/p-avbvrjff-ga.html

++++OpenXR简介http://www.javashuo.com/article/p-qgsgcamr-eu.html

++++VRTK杂谈http://www.javashuo.com/article/p-gsryrkjk-eb.html

++++VRTK快速入门(杂谈)http://www.javashuo.com/article/p-bgvfnmia-cm.html

++++VRTK官方示例(目录)http://www.javashuo.com/article/p-dsnjffvq-ea.html

++++VRTK代码结构(目录)http://www.javashuo.com/article/p-wfilzqyd-es.html

++++VRTK(SceneResources)http://www.javashuo.com/article/p-ryptqvzl-hm.html

++++VRTK_ControllerEventshttp://www.javashuo.com/article/p-sciqvywx-hv.html

++++VRTK_InteractTouchhttp://www.javashuo.com/article/p-ggucvtwz-hq.html

++++虚拟现实行业应用http://www.javashuo.com/article/p-dtgguvvf-ec.html

++++Steam平台上的VRhttp://www.javashuo.com/article/p-wuvvtohn-bo.html

++++Steam平台热销VRhttp://www.javashuo.com/article/p-uyiidcdy-ba.html

++++VR实验:以太网帧的构成http://www.javashuo.com/article/p-fnfhdcgt-bp.html

++++实验四:存储器扩展实验http://www.javashuo.com/article/p-hutumxis-dd.html

++++FrameVR示例V0913http://www.javashuo.com/article/p-xnlrngai-cw.html

++++FrameVR示例V1003http://www.javashuo.com/article/p-ztazxpkv-bd.html

++++SwitchMachineV1022http://www.javashuo.com/article/p-tqkoklov-s.html

++++PlaySceneManagerV1022http://www.javashuo.com/article/p-tqkoklov-s.html

++++Unity5.x用户手册http://www.javashuo.com/article/p-ufnzpmga-s.html

++++Unity面试题ABChttp://www.javashuo.com/article/p-mwacxwca-gm.html

++++Unity面试题Dhttp://www.javashuo.com/article/p-wuwcrclr-s.html

++++Unity面试题Ehttp://www.javashuo.com/article/p-hmabbtmc-ba.html

++++Unity面试题Fhttp://www.javashuo.com/article/p-olslkfao-cq.html

++++Cocos2dx面试题http://www.javashuo.com/article/p-daozmsii-cz.html

++++禅道[zentao]http://www.javashuo.com/article/p-rqsvjwtk-cz.html

++++Lua快速入门篇(Xlua拓展):http://www.javashuo.com/article/p-rrszijom-cm.html

++++Lua快速入门篇(XLua教程):http://www.javashuo.com/article/p-pduvmusb-ho.html

++++Lua快速入门篇(基础概述)http://www.javashuo.com/article/p-shernvtt-u.html

++++框架知识点http://www.javashuo.com/article/p-eufbowgf-u.html

++++游戏框架(UI框架夯实篇)http://www.javashuo.com/article/p-cvemoigb-cu.html

++++游戏框架(初探篇)http://www.javashuo.com/article/p-zfpoilbc-hy.html

++++.Net框架设计http://www.javashuo.com/article/p-bvqhwwfm-cu.html

++++从零开始学架构http://www.javashuo.com/article/p-xbebwfbh-gd.html

++++设计模式简单整理http://www.javashuo.com/article/p-rngqugib-hg.html

++++专题:设计模式(精华篇)http://www.javashuo.com/article/p-nbohnaya-hw.html

++++U3D小项目参考https://blog.csdn.net/vrunsoftyanlz/article/details/80141811

++++Unity小游戏算法分析http://www.javashuo.com/article/p-stddpwad-eg.html

++++Unity案例(Vehicle)http://www.javashuo.com/article/p-wxnfscgy-dy.html

++++UML类图http://www.javashuo.com/article/p-sxberuew-bm.html

++++PowerDesigner简介http://www.javashuo.com/article/p-deknpwxv-cu.html

++++Unity知识点0001http://www.javashuo.com/article/p-ryvdxxjr-ep.html

++++Unity知识点0008http://www.javashuo.com/article/p-kxgstxls-gu.html

++++U3D_Shader编程(第一篇:快速入门篇)http://www.javashuo.com/article/p-kyppgrac-gz.html

++++U3D_Shader编程(第二篇:基础夯实篇)http://www.javashuo.com/article/p-qkyowtli-hv.html

++++Unity引擎基础http://www.javashuo.com/article/p-beommoeb-ka.html

++++Unity面向组件开发http://www.javashuo.com/article/p-eigmuvut-dt.html

++++Unity物理系统http://www.javashuo.com/article/p-nqvvciwv-kd.html

++++Unity2D平台开发http://www.javashuo.com/article/p-ycaagdtj-hs.html

++++UGUI基础http://www.javashuo.com/article/p-rukxwckw-mc.html

++++UGUI进阶http://www.javashuo.com/article/p-wcatruhq-gt.html

++++UGUI综合http://www.javashuo.com/article/p-dkccmqii-gg.html

++++Unity动画系统基础http://www.javashuo.com/article/p-mbrdouxy-dq.html

++++Unity动画系统进阶http://www.javashuo.com/article/p-aqaqpbkh-bp.html

++++Navigation导航系统http://www.javashuo.com/article/p-dswwllas-t.html

++++Unity特效渲染http://www.javashuo.com/article/p-ckojjyfj-bp.html

++++Unity数据存储http://www.javashuo.com/article/p-bvlzynso-m.html

++++Unity中Sqlite数据库http://www.javashuo.com/article/p-ejutsbxl-ca.html

++++WWW类和协程http://www.javashuo.com/article/p-dbwmhsav-cy.html

++++Unity网络http://www.javashuo.com/article/p-sqrlntgh-dw.html

++++Unity资源加密http://www.javashuo.com/article/p-qbtlzpck-bo.html

++++PhotonServer简介http://www.javashuo.com/article/p-cjotdrlu-z.html

++++编写Photon游戏服务器http://www.javashuo.com/article/p-mrqkaqlj-dn.html

++++C#事件http://www.javashuo.com/article/p-zmwruvql-gm.html

++++C#委托http://www.javashuo.com/article/p-uozpymaf-gh.html

++++C#集合http://www.javashuo.com/article/p-sfqfdqsf-ex.html

++++C#泛型http://www.javashuo.com/article/p-xrttqngo-ee.html

++++C#接口http://www.javashuo.com/article/p-vhlfplgv-dm.html

++++C#静态类https://blog.csdn.net/vrunsoftyanlz/article/details/78630979

++++C#中System.String类http://www.javashuo.com/article/p-olslkfao-cq.html

++++C#数据类型http://www.javashuo.com/article/p-hmabbtmc-ba.html

++++Unity3D默认的快捷键http://www.javashuo.com/article/p-wuwcrclr-s.html

++++游戏相关缩写http://www.javashuo.com/article/p-mwacxwca-gm.html

++++UnityAPI.Rigidbody刚体http://www.javashuo.com/article/p-phaztrtw-w.html

++++UnityAPI.Material材质http://www.javashuo.com/article/p-ntyoqcng-q.html

++++UnityAPI.Android安卓http://www.javashuo.com/article/p-fyyfgkck-q.html

++++UnityAPI.AndroidJNI安卓JNIhttp://www.javashuo.com/article/p-kvxjsnzf-w.html

++++UnityAPI.Transform变换http://www.javashuo.com/article/p-bfgrrhxl-cq.html

++++UnityAPI.WheelCollider轮碰撞器http://www.javashuo.com/article/p-smnaoooi-cn.html

++++UnityAPI.Resources资源http://www.javashuo.com/article/p-utqnokva-bu.html

++++JSON数据结构http://www.javashuo.com/article/p-dljbtddn-g.html

++++CocosStudio快速入门http://www.javashuo.com/article/p-qldbaqqa-v.html

++++Unity企业内训(目录)http://www.javashuo.com/article/p-oefbctlf-mn.html

++++Unity企业内训(第1讲)http://www.javashuo.com/article/p-ehlblkrj-mc.html

++++Unity企业内训(第2讲)http://www.javashuo.com/article/p-tiecmlwc-ma.html

++++Unity企业内训(第3讲)http://www.javashuo.com/article/p-mlpucjnv-ma.html

++++Unity企业内训(第4讲)http://www.javashuo.com/article/p-vfalurum-kz.html

++++Unity企业内训(第5讲)http://www.javashuo.com/article/p-ncrckqey-kv.html

++++Unity企业内训(第6讲)http://www.javashuo.com/article/p-gcrucvtb-ku.html

++++钻哥带您了解产品原型http://www.javashuo.com/article/p-hhgxuwjv-kt.html

++++插件<Obi Rope>http://www.javashuo.com/article/p-rmhegsmj-kr.html

++++计算机组成原理(教材篇)http://www.javashuo.com/article/p-sejaldpf-kr.html

++++5G接入:云计算和雾计算http://www.javashuo.com/article/p-yqdivhsk-km.html

++++云计算通俗讲义http://www.javashuo.com/article/p-rkzxxaay-mc.html

++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz/

--_--VRunSoft:lovezuanzuan--_--ww4ww--_--