Add ultimate xr
This commit is contained in:
BIN
Assets/UltimateXR/Editor/Readme/ReadmeHeader.png
Normal file
BIN
Assets/UltimateXR/Editor/Readme/ReadmeHeader.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
146
Assets/UltimateXR/Editor/Readme/ReadmeHeader.png.meta
Normal file
146
Assets/UltimateXR/Editor/Readme/ReadmeHeader.png.meta
Normal file
@@ -0,0 +1,146 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 75b8aad0da34cc74c886a68bfc14dd12
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMasterTextureLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Windows Store Apps
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
38
Assets/UltimateXR/Editor/Readme/UxrReadme.Credit.cs
Normal file
38
Assets/UltimateXR/Editor/Readme/UxrReadme.Credit.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="Readme.Credit.cs" company="VRMADA">
|
||||
// Copyright (c) VRMADA, All rights reserved.
|
||||
// </copyright>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UltimateXR.Editor.Readme
|
||||
{
|
||||
public partial class UxrReadme
|
||||
{
|
||||
[Serializable]
|
||||
public class Credit
|
||||
{
|
||||
#region Inspector Properties/Serialized Fields
|
||||
|
||||
[SerializeField] private string _name;
|
||||
[SerializeField] private string _role;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Types & Data
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
public string Name => _name;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the role.
|
||||
/// </summary>
|
||||
public string Role => _role;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/UltimateXR/Editor/Readme/UxrReadme.Credit.cs.meta
Normal file
3
Assets/UltimateXR/Editor/Readme/UxrReadme.Credit.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2c1e53e9336940f7ac7a3f8432668c4b
|
||||
timeCreated: 1656867374
|
||||
50
Assets/UltimateXR/Editor/Readme/UxrReadme.Section.cs
Normal file
50
Assets/UltimateXR/Editor/Readme/UxrReadme.Section.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="Readme.Section.cs" company="VRMADA">
|
||||
// Copyright (c) VRMADA, All rights reserved.
|
||||
// </copyright>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UltimateXR.Editor.Readme
|
||||
{
|
||||
public partial class UxrReadme
|
||||
{
|
||||
[Serializable]
|
||||
public class Section
|
||||
{
|
||||
#region Inspector Properties/Serialized Fields
|
||||
|
||||
[SerializeField] private string _heading;
|
||||
[SerializeField] private string _text;
|
||||
[SerializeField] private string _linkText;
|
||||
[SerializeField] private string _url;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Types & Data
|
||||
|
||||
/// <summary>
|
||||
/// Gets the heading.
|
||||
/// </summary>
|
||||
public string Heading => _heading;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the main text.
|
||||
/// </summary>
|
||||
public string Text => _text;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the link text.
|
||||
/// </summary>
|
||||
public string LinkText => _linkText;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the link URL.
|
||||
/// </summary>
|
||||
public string URL => _url;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f60bfb58c2f74e5492846b32e84ad764
|
||||
timeCreated: 1656867386
|
||||
44
Assets/UltimateXR/Editor/Readme/UxrReadme.cs
Normal file
44
Assets/UltimateXR/Editor/Readme/UxrReadme.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="UxrReadme.cs" company="VRMADA">
|
||||
// Copyright (c) VRMADA, All rights reserved.
|
||||
// </copyright>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UltimateXR.Editor.Readme
|
||||
{
|
||||
/// <summary>
|
||||
/// Readme data drawn using the custom UxrReadmeEditor inspector script.
|
||||
/// </summary>
|
||||
//[CreateAssetMenu(fileName = "Readme", menuName = "UltimateXR/Readme", order = 1)]
|
||||
public partial class UxrReadme : ScriptableObject
|
||||
{
|
||||
#region Inspector Properties/Serialized Fields
|
||||
|
||||
[SerializeField] private Texture2D _headerImage;
|
||||
[SerializeField] private List<Section> _sections = new List<Section>();
|
||||
[SerializeField] private List<Credit> _credits = new List<Credit>();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Types & Data
|
||||
|
||||
/// <summary>
|
||||
/// Gets the header image.
|
||||
/// </summary>
|
||||
public Texture2D HeaderImage => _headerImage;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the section information.
|
||||
/// </summary>
|
||||
public IReadOnlyList<Section> Sections => _sections;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the credits.
|
||||
/// </summary>
|
||||
public IReadOnlyList<Credit> Credits => _credits;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
11
Assets/UltimateXR/Editor/Readme/UxrReadme.cs.meta
Normal file
11
Assets/UltimateXR/Editor/Readme/UxrReadme.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d6597a4f2b4fc545bf356a7b195076a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
160
Assets/UltimateXR/Editor/Readme/UxrReadmeEditor.cs
Normal file
160
Assets/UltimateXR/Editor/Readme/UxrReadmeEditor.cs
Normal file
@@ -0,0 +1,160 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="UxrReadmeEditor.cs" company="VRMADA">
|
||||
// Copyright (c) VRMADA, All rights reserved.
|
||||
// </copyright>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
using UltimateXR.Core;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UltimateXR.Editor.Readme
|
||||
{
|
||||
/// <summary>
|
||||
/// Custom inspector for the readme file. Based on Unity's Readme inspector.
|
||||
/// </summary>
|
||||
[CustomEditor(typeof(UxrReadme))]
|
||||
public class UxrReadmeEditor : UnityEditor.Editor
|
||||
{
|
||||
#region Inspector Properties/Serialized Fields
|
||||
|
||||
[SerializeField] private GUIStyle _linkStyle;
|
||||
[SerializeField] private GUIStyle _titleStyle;
|
||||
[SerializeField] private GUIStyle _headingStyle;
|
||||
[SerializeField] private GUIStyle _bodyStyle;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Unity
|
||||
|
||||
/// <summary>
|
||||
/// Draws the <see cref="UxrReadme" /> graphics.
|
||||
/// </summary>
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
UxrReadme readme = (UxrReadme)target;
|
||||
Initialize();
|
||||
|
||||
if (readme.HeaderImage != null)
|
||||
{
|
||||
GUI.DrawTexture(new Rect(Mathf.Max(0.0f, (EditorGUIUtility.currentViewWidth - readme.HeaderImage.width) * 0.5f), 0.0f, readme.HeaderImage.width, readme.HeaderImage.height), readme.HeaderImage);
|
||||
GUILayout.Space(readme.HeaderImage.height + SectionSpacing);
|
||||
}
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
GUILayout.Label($"Version {UxrConstants.Version}", _bodyStyle);
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(SectionSpacing);
|
||||
|
||||
foreach (var section in readme.Sections)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(section.Heading))
|
||||
{
|
||||
GUILayout.Label(section.Heading, _headingStyle);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(section.Text))
|
||||
{
|
||||
GUILayout.Label(section.Text, _bodyStyle);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(section.LinkText))
|
||||
{
|
||||
if (LinkLabel(new GUIContent(section.LinkText)))
|
||||
{
|
||||
if (section.URL.EndsWith(".unity"))
|
||||
{
|
||||
EditorSceneManager.OpenScene(section.URL);
|
||||
}
|
||||
else
|
||||
{
|
||||
Application.OpenURL(section.URL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GUILayout.Space(SectionSpacing);
|
||||
}
|
||||
|
||||
if (readme.Credits.Count > 0)
|
||||
{
|
||||
GUILayout.Label("Credits", _headingStyle);
|
||||
|
||||
foreach (var credit in readme.Credits)
|
||||
{
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label($"{credit.Name}:", _bodyStyle, GUILayout.ExpandWidth(false));
|
||||
GUILayout.Label($"{credit.Role}", _bodyStyle, GUILayout.ExpandWidth(true));
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Creates the GUI styles.
|
||||
/// </summary>
|
||||
private void Initialize()
|
||||
{
|
||||
if (_initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_bodyStyle = new GUIStyle(EditorStyles.label);
|
||||
_bodyStyle.wordWrap = true;
|
||||
_bodyStyle.fontSize = 14;
|
||||
_bodyStyle.richText = true;
|
||||
|
||||
_titleStyle = new GUIStyle(_bodyStyle);
|
||||
_titleStyle.fontSize = 26;
|
||||
|
||||
_headingStyle = new GUIStyle(_bodyStyle);
|
||||
_headingStyle.fontStyle = FontStyle.Bold;
|
||||
_headingStyle.fontSize = 18;
|
||||
|
||||
_linkStyle = new GUIStyle(_bodyStyle);
|
||||
_linkStyle.wordWrap = false;
|
||||
|
||||
_linkStyle.normal.textColor = new Color(0x00 / 255f, 0x78 / 255f, 0xDA / 255f, 1f);
|
||||
_linkStyle.stretchWidth = false;
|
||||
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws and handles a link label as a button.
|
||||
/// </summary>
|
||||
/// <param name="label">Label</param>
|
||||
/// <param name="options">Layout options</param>
|
||||
/// <returns>Whether the link was clicked the current frame</returns>
|
||||
private bool LinkLabel(GUIContent label, params GUILayoutOption[] options)
|
||||
{
|
||||
var position = GUILayoutUtility.GetRect(label, _linkStyle, options);
|
||||
|
||||
Handles.BeginGUI();
|
||||
Handles.color = _linkStyle.normal.textColor;
|
||||
Handles.DrawLine(new Vector3(position.xMin, position.yMax), new Vector3(position.xMax, position.yMax));
|
||||
Handles.color = Color.white;
|
||||
Handles.EndGUI();
|
||||
|
||||
EditorGUIUtility.AddCursorRect(position, MouseCursor.Link);
|
||||
|
||||
return GUI.Button(position, label, _linkStyle);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Types & Data
|
||||
|
||||
private const float SectionSpacing = 16.0f;
|
||||
|
||||
private bool _initialized;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
11
Assets/UltimateXR/Editor/Readme/UxrReadmeEditor.cs.meta
Normal file
11
Assets/UltimateXR/Editor/Readme/UxrReadmeEditor.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7841cfc8a4b017c4aabedbde8ce34a77
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user