• 大小: 66.25MB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-12-28
  • 语言: 其他
  • 标签: Unity  VRTK  SteamVR  

资源简介

新版本的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.meta
     文件        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.meta
     文件        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.meta
     文件       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.meta
     文件       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.meta
     文件        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.meta
     文件         133  2018-01-11 02:26  VRTK-master\Assets\SteamVR\Editor.meta
     目录           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.meta
     文件        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.meta
     文件        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.meta
............此处省略6204个文件信息

评论

共有 条评论