This commit is contained in:
dldydtn9755-crypto
2026-07-23 17:58:02 +09:00
parent 3618615ea8
commit be755323fc
62 changed files with 304 additions and 76 deletions

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4f700f5d9e372c94785bf583ebcfcca0
guid: f5bb6bc142720604d917bab67223e7d1
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 2338e4f6802bdb845a01bd8b4c3da77d
guid: bec4576b1ba9ede4db6fba9bafc7a05a
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -67,7 +67,7 @@ TextureImporter:
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
@@ -80,7 +80,7 @@ TextureImporter:
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
@@ -93,7 +93,7 @@ TextureImporter:
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
@@ -106,7 +106,7 @@ TextureImporter:
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
- serializedVersion: 3
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
@@ -119,24 +119,10 @@ TextureImporter:
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: VisionOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
@@ -146,8 +132,6 @@ TextureImporter:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e22d037d5d9286644b4b81a8b91b5ee5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -67,7 +67,7 @@ TextureImporter:
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
@@ -80,7 +80,7 @@ TextureImporter:
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
@@ -93,7 +93,7 @@ TextureImporter:
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
@@ -106,7 +106,7 @@ TextureImporter:
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
- serializedVersion: 3
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
@@ -119,24 +119,10 @@ TextureImporter:
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: VisionOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
@@ -146,8 +132,6 @@ TextureImporter:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0

View File

@@ -16,6 +16,8 @@ ModelImporter:
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:

View File

@@ -16,6 +16,8 @@ ModelImporter:
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:

View File

@@ -16,6 +16,8 @@ ModelImporter:
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:

View File

@@ -16,6 +16,8 @@ ModelImporter:
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c8146e7694b9541089b8dbaa8a7d59d9
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using UnityEngine.Serialization;
@@ -114,9 +115,18 @@ public VelocityType velocityType
}
XRHandSubsystem m_Subsystem;
public XRHandSubsystem subsystem
{
get => m_Subsystem;
}
HandGameObjects m_LeftHandGameObjects;
HandGameObjects m_RightHandGameObjects;
public Action<XRHandSubsystem> subsystemSubscribed;
public Action<XRHandSubsystem> subsystemUnsubscribed;
XRHandSubsystem.UpdateSuccessFlags m_CombinedSuccessFlags;
static readonly List<XRHandSubsystem> s_SubsystemsReuse = new List<XRHandSubsystem>();
/// <summary>
@@ -254,6 +264,9 @@ void SubscribeHandSubsystem()
m_Subsystem.trackingAcquired += OnTrackingAcquired;
m_Subsystem.trackingLost += OnTrackingLost;
m_Subsystem.updatedHands += OnUpdatedHands;
if (subsystemSubscribed != null)
subsystemSubscribed.Invoke(m_Subsystem);
}
void UnsubscribeHandSubsystem()
@@ -261,6 +274,9 @@ void UnsubscribeHandSubsystem()
if (m_Subsystem == null)
return;
if (subsystemUnsubscribed != null)
subsystemUnsubscribed.Invoke(m_Subsystem);
m_Subsystem.trackingAcquired -= OnTrackingAcquired;
m_Subsystem.trackingLost -= OnTrackingLost;
m_Subsystem.updatedHands -= OnUpdatedHands;
@@ -309,6 +325,7 @@ void OnUpdatedHands(XRHandSubsystem subsystem, XRHandSubsystem.UpdateSuccessFlag
// We have no game logic depending on the Transforms, so early out here
// (add game logic before this return here, directly querying from
// subsystem.leftHand and subsystem.rightHand using GetJoint on each hand)
m_CombinedSuccessFlags |= updateSuccessFlags;
if (updateType == XRHandSubsystem.UpdateType.Dynamic)
return;
@@ -338,15 +355,19 @@ void OnUpdatedHands(XRHandSubsystem subsystem, XRHandSubsystem.UpdateSuccessFlag
m_LeftHandGameObjects.UpdateJoints(
subsystem.leftHand,
(updateSuccessFlags & XRHandSubsystem.UpdateSuccessFlags.LeftHandJoints) != 0,
(m_CombinedSuccessFlags & XRHandSubsystem.UpdateSuccessFlags.LeftHandJoints) != 0,
m_DebugDrawJoints,
m_VelocityType);
m_RightHandGameObjects.UpdateJoints(
subsystem.rightHand,
(updateSuccessFlags & XRHandSubsystem.UpdateSuccessFlags.RightHandJoints) != 0,
(m_CombinedSuccessFlags & XRHandSubsystem.UpdateSuccessFlags.RightHandJoints) != 0,
m_DebugDrawJoints,
m_VelocityType);
// Reset the combined flags after the BeforeRender phase
if (updateType == XRHandSubsystem.UpdateType.BeforeRender)
m_CombinedSuccessFlags = XRHandSubsystem.UpdateSuccessFlags.None;
}
class HandGameObjects

View File

@@ -1,5 +1,6 @@
using UnityEngine.Rendering;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
#endif
@@ -10,16 +11,23 @@ namespace UnityEngine.XR.Hands.Samples.VisualizerSample
[InitializeOnLoad]
static class RenderPipelineValidation
{
/// <summary>
/// Manually refreshes all Material Pipeline Handler scriptable objects.
/// </summary>
static void RefreshMaterialPipelineHandlers()
{
foreach (var pipelineHandler in GetAllInstances())
{
pipelineHandler.AutoRefreshPipelineShaders();
}
}
static RenderPipelineValidation()
{
// Use delayCall to ensure this runs after the editor is fully initialized and all assets are imported.
// Without delayCall, this script may execute before new assets (such as newly imported samples)
// are registered in the AssetDatabase, so they won't be found or converted.
EditorApplication.delayCall += () =>
{
foreach (var pipelineHandler in GetAllInstances())
pipelineHandler.AutoRefreshPipelineShaders();
};
EditorApplication.delayCall += () => RefreshMaterialPipelineHandlers();
}
static List<MaterialPipelineHandler> GetAllInstances()
@@ -72,6 +80,8 @@ public class MaterialPipelineHandler : ScriptableObject
[Tooltip("If true, the shaders will be refreshed automatically when the editor opens and when this scriptable object instance is enabled.")]
bool m_AutoRefreshShaders = true;
bool m_SaveAssetsPending;
#if UNITY_EDITOR
void OnEnable()
{
@@ -92,12 +102,16 @@ public void AutoRefreshPipelineShaders()
/// </summary>
public void SetPipelineShaders()
{
// Already updated materials, waiting on the save to finish.
if (m_SaveAssetsPending)
return;
if (m_ShaderContainers == null)
return;
bool isBuiltinRenderPipeline = GraphicsSettings.currentRenderPipeline == null;
bool isModified = false;
int modifiedCount = 0;
foreach (var info in m_ShaderContainers)
{
@@ -123,6 +137,7 @@ public void SetPipelineShaders()
info.material.SetColor("_Color", originalColor);
MarkMaterialModified(info.material);
isModified = true;
modifiedCount++;
}
else if (!isBuiltinRenderPipeline && srpShader != null && currentShader != srpShader)
{
@@ -130,19 +145,34 @@ public void SetPipelineShaders()
info.material.SetColor("_BaseColor", originalColor);
MarkMaterialModified(info.material);
isModified = true;
modifiedCount++;
}
}
if (isModified)
{
#if UNITY_EDITOR
// This ensures the material changes are saved immediately,
Debug.Log($"Material Pipeline Handlers have updated {modifiedCount} material asset(s).", this);
// Invoking `AssetDatabase.SaveAssets` ensures the material changes are saved immediately,
// otherwise they won't be saved until the next domain reload.
AssetDatabase.SaveAssets();
// Calls to AssetDatabase.SaveAssets are restricted during asset importing,
// so schedule it for the next Editor frame.
m_SaveAssetsPending = true;
EditorApplication.delayCall -= OnDelayCall;
EditorApplication.delayCall += OnDelayCall;
#endif
}
}
#if UNITY_EDITOR
void OnDelayCall()
{
m_SaveAssetsPending = false;
AssetDatabase.SaveAssets();
}
#endif
static void MarkMaterialModified(Material material)
{
#if UNITY_EDITOR