Загрузка XR и URP

This commit is contained in:
LikhenkoVG
2024-12-07 22:53:11 +03:00
parent 0aefa7da4f
commit a194af17f9
253 changed files with 57145 additions and 11 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ac3833452a6cb0d4bae148ab912d320a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Unity.XR.CoreUtils.Editor;
using UnityEngine.XR.Interaction.Toolkit;
namespace UnityEditor.XR.Interaction.Toolkit.Samples
{
/// <summary>
/// Unity Editor class which registers Project Validation rules for the Starter Assets sample package.
/// </summary>
class StarterAssetsSampleProjectValidation
{
const string k_Category = "XR Interaction Toolkit";
const string k_StarterAssetsSampleName = "Starter Assets";
const string k_TeleportLayerName = "Teleport";
const int k_TeleportLayerIndex = 31;
static readonly BuildTargetGroup[] s_BuildTargetGroups =
((BuildTargetGroup[])Enum.GetValues(typeof(BuildTargetGroup))).Distinct().ToArray();
static readonly List<BuildValidationRule> s_BuildValidationRules = new List<BuildValidationRule>();
[InitializeOnLoadMethod]
static void RegisterProjectValidationRules()
{
// In the Player Settings UI we have to delay the call one frame to let the settings provider get initialized
// since we need to access the settings asset to set the rule's non-delegate properties (FixItAutomatic).
EditorApplication.delayCall += AddRules;
}
static void AddRules()
{
if (s_BuildValidationRules.Count == 0)
{
s_BuildValidationRules.Add(
new BuildValidationRule
{
Category = k_Category,
Message = $"[{k_StarterAssetsSampleName}] Interaction Layer {k_TeleportLayerIndex} should be set to '{k_TeleportLayerName}' for teleportation locomotion.",
FixItMessage = $"XR Interaction Toolkit samples reserve Interaction Layer {k_TeleportLayerIndex} for teleportation locomotion. Set Interaction Layer {k_TeleportLayerIndex} to '{k_TeleportLayerName}' to prevent conflicts.",
HelpText = "Please note Interaction Layers are unique to the XR Interaction Toolkit and can be found in Edit > Project Settings > XR Plug-in Management > XR Interaction Toolkit",
FixItAutomatic = InteractionLayerSettings.Instance.IsLayerEmpty(k_TeleportLayerIndex) || IsInteractionLayerTeleport(),
Error = false,
CheckPredicate = IsInteractionLayerTeleport,
FixIt = () =>
{
if (InteractionLayerSettings.Instance.IsLayerEmpty(k_TeleportLayerIndex) || DisplayTeleportDialog())
InteractionLayerSettings.Instance.SetLayerNameAt(k_TeleportLayerIndex, k_TeleportLayerName);
else
SettingsService.OpenProjectSettings(XRInteractionToolkitSettingsProvider.k_SettingsPath);
},
});
}
foreach (var buildTargetGroup in s_BuildTargetGroups)
{
BuildValidator.AddRules(buildTargetGroup, s_BuildValidationRules);
}
}
static bool IsInteractionLayerTeleport()
{
return string.Equals(InteractionLayerSettings.Instance.GetLayerNameAt(k_TeleportLayerIndex), k_TeleportLayerName, StringComparison.OrdinalIgnoreCase);
}
static bool DisplayTeleportDialog()
{
return EditorUtility.DisplayDialog(
"Fixing Teleport Interaction Layer",
$"Interaction Layer {k_TeleportLayerIndex} for teleportation locomotion is currently set to '{InteractionLayerSettings.Instance.GetLayerNameAt(k_TeleportLayerIndex)}' instead of '{k_TeleportLayerName}'",
"Automatically Replace",
"Cancel");
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ef67ceb22b2224643a2d5004fc2a678a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
{
"name": "Unity.XR.Interaction.Toolkit.Samples.StarterAssets.Editor",
"rootNamespace": "",
"references": [
"Unity.XR.Interaction.Toolkit",
"Unity.XR.Interaction.Toolkit.Editor",
"Unity.XR.CoreUtils",
"Unity.XR.CoreUtils.Editor"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9233538b711383d449a485633568d17c
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: