资源简介
新版本的VRTK,解决了U3D资源商店2.3版本与Unity2018.1x版本不兼容的问题
代码片段和文件信息
//======= Copyright (c) Valve Corporation All rights reserved. ===============
//
// Purpose: Custom inspector display for SteamVR_Camera
//
//=============================================================================
using UnityEngine;
using UnityEditor;
using System.IO;
[CustomEditor(typeof(SteamVR_Camera)) CanEditMultipleobjects]
public class SteamVR_Editor : Editor
{
int bannerHeight = 150;
Texture logo;
SerializedProperty script wireframe;
string GetResourcePath()
{
var ms = Monoscript.Fromscriptableobject(this);
var path = AssetDatabase.GetAssetPath(ms);
path = Path.GetDirectoryName(path);
return path.Substring(0 path.Length - “Editor“.Length) + “Textures/“;
}
void OnEnable()
{
var resourcePath = GetResourcePath();
logo = AssetDatabase.LoadAssetAtPath(resourcePath + “logo.png“);
script = serializedobject.FindProperty(“m_script“);
wireframe = serializedobject.FindProperty(“wireframe“);
foreach (SteamVR_Camera target in targets)
target.ForceLast();
}
public override void OnInspectorGUI()
{
serializedobject.Update();
var rect = GUILayoutUtility.GetRect(Screen.width - 38 bannerHeight GUI.skin.box);
if (logo)
GUI.DrawTexture(rect logo ScaleMode.ScaleToFit);
if (!Application.isPlaying)
{
var expand = false;
var collapse = false;
foreach (SteamVR_Camera target in targets)
{
if (AssetDatabase.Contains(target))
continue;
if (target.isExpanded)
collapse = true;
else
expand = true;
}
if (expand)
{
GUILayout.BeginHorizontal();
if (GUILayout.Button(“Expand“))
{
foreach (SteamVR_Camera target in targets)
{
if (AssetDatabase.Contains(target))
continue;
if (!target.isExpanded)
{
target.Expand();
EditorUtility.SetDirty(target);
}
}
}
GUILayout.Space(18);
GUILayout.EndHorizontal();
}
if (collapse)
{
GUILayout.BeginHorizontal();
if (GUILayout.Button(“Collapse“))
{
foreach (SteamVR_Camera target in targets)
{
if (AssetDatabase.Contains(target))
continue;
if (target.isExpanded)
{
target.Collapse();
EditorUtility.SetDirty(target);
}
}
}
GUILayout.Space(18);
GUILayout.EndHorizontal();
}
}
EditorGUILayout.PropertyField(script);
EditorGUILayout.PropertyField(wireframe);
serializedobject.ApplyModifiedProperties();
}
public static void ExportPackage()
{
AssetDatabase.ExportPackage(new string[] {
“Assets/SteamVR“
“Assets/Plugins/openvr_api.cs“
“Assets/Plugins/openvr_api.bundle“
“Assets/Plugins/x86/openvr_api.dll“
“Assets/Plugins/x86/steam_api.dll“
“Assets/Plugins/x86/libsteam_api.so“
“Assets/Plugins/x86_64/openvr_api.dll“
“Assets/Plugins/x86_64/steam_api.dll“
“Assets/Plugins/x86_64/libsteam_api.so
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-10-14 13:57 VRTK-master\
文件 181 2018-09-27 01:55 VRTK-master\.editorconfig
目录 0 2018-10-14 13:32 VRTK-master\.github\
文件 3469 2018-09-27 01:55 VRTK-master\.github\CODE_OF_CONDUCT.md
文件 8720 2018-09-27 01:55 VRTK-master\.github\CONTRIBUTING.md
文件 1219 2018-09-27 01:55 VRTK-master\.github\ISSUE_TEMPLATE.md
文件 190 2018-09-27 01:55 VRTK-master\.github\SUPPORT.md
文件 1457 2018-09-27 01:55 VRTK-master\.gitignore
目录 0 2018-10-14 13:50 VRTK-master\Assets\
目录 0 2018-10-14 13:49 VRTK-master\Assets\SteamVR\
目录 0 2018-10-14 13:49 VRTK-master\Assets\SteamVR\Editor\
文件 3153 2018-01-11 02:24 VRTK-master\Assets\SteamVR\Editor\SteamVR_Editor.cs
文件 207 2018-01-11 02:24 VRTK-master\Assets\SteamVR\Editor\SteamVR_Editor.cs.me
文件 1379 2018-01-11 02:23 VRTK-master\Assets\SteamVR\Editor\SteamVR_Preferences.cs
文件 276 2018-01-11 02:23 VRTK-master\Assets\SteamVR\Editor\SteamVR_Preferences.cs.me
文件 3106 2018-01-11 02:24 VRTK-master\Assets\SteamVR\Editor\SteamVR_RenderModelEditor.cs
文件 276 2018-01-11 02:24 VRTK-master\Assets\SteamVR\Editor\SteamVR_RenderModelEditor.cs.me
文件 23294 2018-01-11 02:26 VRTK-master\Assets\SteamVR\Editor\SteamVR_Settings.cs
文件 276 2018-01-11 02:26 VRTK-master\Assets\SteamVR\Editor\SteamVR_Settings.cs.me
文件 13374 2018-01-11 02:25 VRTK-master\Assets\SteamVR\Editor\SteamVR_SkyboxEditor.cs
文件 276 2018-01-11 02:25 VRTK-master\Assets\SteamVR\Editor\SteamVR_SkyboxEditor.cs.me
文件 4482 2018-01-11 02:25 VRTK-master\Assets\SteamVR\Editor\SteamVR_Update.cs
文件 276 2018-01-11 02:25 VRTK-master\Assets\SteamVR\Editor\SteamVR_Update.cs.me
文件 133 2018-01-11 02:26 VRTK-master\Assets\SteamVR\Editor.me
目录 0 2018-10-14 13:49 VRTK-master\Assets\SteamVR\Extras\
文件 2637 2018-01-11 02:24 VRTK-master\Assets\SteamVR\Extras\SteamVR_GazeTracker.cs
文件 276 2018-01-11 02:24 VRTK-master\Assets\SteamVR\Extras\SteamVR_GazeTracker.cs.me
文件 4329 2018-01-11 02:26 VRTK-master\Assets\SteamVR\Extras\SteamVR_LaserPointer.cs
文件 276 2018-01-11 02:26 VRTK-master\Assets\SteamVR\Extras\SteamVR_LaserPointer.cs.me
文件 3169 2018-01-11 02:23 VRTK-master\Assets\SteamVR\Extras\SteamVR_Teleporter.cs
文件 276 2018-01-11 02:23 VRTK-master\Assets\SteamVR\Extras\SteamVR_Teleporter.cs.me
............此处省略6204个文件信息
相关资源
- unity4.0官方正式版
- Behavior Designer 1.6.3(u2018.3.0).unitypa
- Unity纪念碑谷.rar
- A Pathfinding Project Pro v4.2.2.rar
- Unity 声音播放插件,支持将字符串转
- Gaia 1.7.2
- Unity3d实现扭动挤压浏览效果
- UnityShader卷轴效果
- 爱酱(绊爱Kizuna)模型
- 遗传算法越野小车unity5.5
- unity 3D 百度语音合成 并播放
- unity案例入门坦克大战源码
- Graph And Chart 1.91.unitypackage
- Animated Steel Coaster 1.51.rar
- Unity3D游戏开发.pdf 宣雨松著完整高清
- Unity3D版水果忍者
- unity3d爆炸特效包
- unity3d_见缝插针源码及报告.zip
- Unity3d车库场景模型
- unity3d 警察动画模型
- unity20多种烟雾以及爆炸特效
- unity博物馆.zip
- burpsuite_community社区版x86系统
- unity3D 新手引导遮罩,支持圆形和矩形
- 兼容unity的System.Drawing.dll
- unity3d枪支武器包FPS第一人称射击游戏
- UniWebView 3.unitypackage
- unity2D猛禽战机空战游戏完整源码
- Final IK 1.9
- ChangeSkin.rar
评论
共有 条评论