添加缺失插件
This commit is contained in:
8
Assets/Asset Usage Finder.meta
Normal file
8
Assets/Asset Usage Finder.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 780c836a7014ad24ea989f9567d59296
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
15
Assets/Asset Usage Finder/AssetUsageFinder.asmdef
Normal file
15
Assets/Asset Usage Finder/AssetUsageFinder.asmdef
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "AssetUsageFinder",
|
||||
"references": [],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": false,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
7
Assets/Asset Usage Finder/AssetUsageFinder.asmdef.meta
Normal file
7
Assets/Asset Usage Finder/AssetUsageFinder.asmdef.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 78166de3938470b4da415a0209d69308
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/Asset Usage Finder/Editor.meta
Normal file
9
Assets/Asset Usage Finder/Editor.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6cb38742b49c2543b9129cc5bc1959f
|
||||
folderAsset: yes
|
||||
timeCreated: 1464798283
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
42
Assets/Asset Usage Finder/Editor/AUFUtils.cs
Normal file
42
Assets/Asset Usage Finder/Editor/AUFUtils.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
public static class AufUtils {
|
||||
public static Object[] LoadAllAssetsAtPath (string assetPath) {
|
||||
// prevents error "Do not use readobjectthreaded on scene objects!"
|
||||
return typeof (SceneAsset) == AssetDatabase.GetMainAssetTypeAtPath (assetPath)
|
||||
? new[] { AssetDatabase.LoadMainAssetAtPath (assetPath) }
|
||||
: AssetDatabase.LoadAllAssetsAtPath (assetPath);
|
||||
}
|
||||
|
||||
public static T FirstOfType<T> () where T : Object {
|
||||
var typeName = typeof (T).Name;
|
||||
|
||||
var guids = AssetDatabase.FindAssets (string.Format ("t:{0}", typeName));
|
||||
if (!guids.Any ()) {
|
||||
AssetDatabase.Refresh (ImportAssetOptions.ForceUpdate);
|
||||
}
|
||||
|
||||
if (guids.Length == 0) {
|
||||
Asr.Fail ();
|
||||
Report (typeName);
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach (var guid in guids) {
|
||||
var path = AssetDatabase.GUIDToAssetPath (guid);
|
||||
var asset = (T)AssetDatabase.LoadAssetAtPath (path, typeof (T));
|
||||
return asset;
|
||||
}
|
||||
|
||||
Report (typeName);
|
||||
return null;
|
||||
}
|
||||
|
||||
static void Report (string typeName) {
|
||||
Debug.LogError (string.Format ("Cannot find '{0}' (AUF style resource). Please try to remove AUF and import again, or restart Unity", typeName));
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Asset Usage Finder/Editor/AUFUtils.cs.meta
Normal file
11
Assets/Asset Usage Finder/Editor/AUFUtils.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 67f83d816cd4ba344a82ea0cf924e446
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
38
Assets/Asset Usage Finder/Editor/Asr.cs
Normal file
38
Assets/Asset Usage Finder/Editor/Asr.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Diagnostics;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Assertions;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
static class FLAGS {
|
||||
public const string DEBUG = "DEBUG1"; //todo rename in release
|
||||
}
|
||||
|
||||
static class Asr {
|
||||
#line hidden
|
||||
[Conditional(FLAGS.DEBUG)]
|
||||
public static void AreEqual(int a, int b) {
|
||||
Assert.AreEqual(a, b);
|
||||
}
|
||||
|
||||
[Conditional(FLAGS.DEBUG)]
|
||||
public static void IsTrue(bool b, string format = null) {
|
||||
Assert.IsTrue(b, format);
|
||||
}
|
||||
|
||||
[Conditional(FLAGS.DEBUG)]
|
||||
public static void IsFalse(bool b, string format = null) {
|
||||
Assert.IsFalse(b, format);
|
||||
}
|
||||
|
||||
[Conditional(FLAGS.DEBUG)]
|
||||
public static void Fail(string format = null) {
|
||||
throw new AssertionException("Failed", format);
|
||||
}
|
||||
|
||||
[Conditional(FLAGS.DEBUG)]
|
||||
public static void IsNotNull(Object target, string str) {
|
||||
Assert.IsNotNull(target, str);
|
||||
}
|
||||
#line default
|
||||
}
|
||||
}
|
||||
3
Assets/Asset Usage Finder/Editor/Asr.cs.meta
Normal file
3
Assets/Asset Usage Finder/Editor/Asr.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28cd7f324901405696fa9c87c25a1d2b
|
||||
timeCreated: 1587623743
|
||||
9
Assets/Asset Usage Finder/Editor/Content.meta
Normal file
9
Assets/Asset Usage Finder/Editor/Content.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2181b913e8042f54db8354b4302d01f2
|
||||
folderAsset: yes
|
||||
timeCreated: 1467572757
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
740
Assets/Asset Usage Finder/Editor/Content/Style.asset
Normal file
740
Assets/Asset Usage Finder/Editor/Content/Style.asset
Normal file
@@ -0,0 +1,740 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2a8038d7a393d814b887bec61ad77979, type: 3}
|
||||
m_Name: Style
|
||||
m_EditorClassIdentifier:
|
||||
Pro:
|
||||
LookupBtn:
|
||||
Content:
|
||||
m_Text:
|
||||
m_Image: {fileID: 2800000, guid: 93880ab424857034481dd201068f1f3c, type: 3}
|
||||
m_Tooltip: Look for dependencies in Project
|
||||
Style:
|
||||
m_Name: button
|
||||
m_Normal:
|
||||
m_Background: {fileID: 7619082074131061878, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.7058824, g: 0.7058824, b: 0.7058824, a: 1}
|
||||
m_Hover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Active:
|
||||
m_Background: {fileID: 5631187574603569090, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.7058824, g: 0.7058824, b: 0.7058824, a: 1}
|
||||
m_Focused:
|
||||
m_Background: {fileID: 5631187574603569090, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.7058824, g: 0.7058824, b: 0.7058824, a: 1}
|
||||
m_OnNormal:
|
||||
m_Background: {fileID: -4685157240802103863, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.9411765, g: 0.9411765, b: 0.9411765, a: 1}
|
||||
m_OnHover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_OnActive:
|
||||
m_Background: {fileID: 4047951448802137905, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_OnFocused:
|
||||
m_Background: {fileID: 8556163245987529883, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Border:
|
||||
m_Left: 6
|
||||
m_Right: 6
|
||||
m_Top: 4
|
||||
m_Bottom: 4
|
||||
m_Margin:
|
||||
m_Left: 4
|
||||
m_Right: 4
|
||||
m_Top: 3
|
||||
m_Bottom: 3
|
||||
m_Padding:
|
||||
m_Left: 1
|
||||
m_Right: 1
|
||||
m_Top: 1
|
||||
m_Bottom: 3
|
||||
m_Overflow:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 1
|
||||
m_Font: {fileID: 0}
|
||||
m_FontSize: 0
|
||||
m_FontStyle: 0
|
||||
m_Alignment: 4
|
||||
m_WordWrap: 0
|
||||
m_RichText: 0
|
||||
m_TextClipping: 1
|
||||
m_ImagePosition: 2
|
||||
m_ContentOffset: {x: 0, y: 0}
|
||||
m_FixedWidth: 20
|
||||
m_FixedHeight: 20
|
||||
m_StretchWidth: 0
|
||||
m_StretchHeight: 0
|
||||
TabBreadcrumb0:
|
||||
m_Name: GUIEditor.BreadcrumbLeft
|
||||
m_Normal:
|
||||
m_Background: {fileID: 8645626873510801130, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_Hover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_Active:
|
||||
m_Background: {fileID: -4071144489119945478, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_Focused:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_OnNormal:
|
||||
m_Background: {fileID: -3855161947729212693, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_OnHover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_OnActive:
|
||||
m_Background: {fileID: 4626433863934729146, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_OnFocused:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_Border:
|
||||
m_Left: 3
|
||||
m_Right: 10
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Margin:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Padding:
|
||||
m_Left: 5
|
||||
m_Right: 11
|
||||
m_Top: 2
|
||||
m_Bottom: 0
|
||||
m_Overflow:
|
||||
m_Left: 6
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Font: {fileID: 0}
|
||||
m_FontSize: 0
|
||||
m_FontStyle: 0
|
||||
m_Alignment: 3
|
||||
m_WordWrap: 0
|
||||
m_RichText: 1
|
||||
m_TextClipping: 1
|
||||
m_ImagePosition: 0
|
||||
m_ContentOffset: {x: 0, y: -1}
|
||||
m_FixedWidth: 0
|
||||
m_FixedHeight: 18
|
||||
m_StretchWidth: 0
|
||||
m_StretchHeight: 0
|
||||
TabBreadcrumb1:
|
||||
m_Name: GUIEditor.BreadcrumbMid
|
||||
m_Normal:
|
||||
m_Background: {fileID: -5572395043393670061, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_Hover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_Active:
|
||||
m_Background: {fileID: 7619446805891711926, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_Focused:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_OnNormal:
|
||||
m_Background: {fileID: -465409310786048726, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_OnHover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_OnActive:
|
||||
m_Background: {fileID: 5201657687025341418, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_OnFocused:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.705, g: 0.705, b: 0.705, a: 1}
|
||||
m_Border:
|
||||
m_Left: 10
|
||||
m_Right: 10
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Margin:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Padding:
|
||||
m_Left: 10
|
||||
m_Right: 10
|
||||
m_Top: 2
|
||||
m_Bottom: 0
|
||||
m_Overflow:
|
||||
m_Left: 10
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Font: {fileID: 0}
|
||||
m_FontSize: 0
|
||||
m_FontStyle: 0
|
||||
m_Alignment: 3
|
||||
m_WordWrap: 0
|
||||
m_RichText: 1
|
||||
m_TextClipping: 1
|
||||
m_ImagePosition: 0
|
||||
m_ContentOffset: {x: 0, y: -1}
|
||||
m_FixedWidth: 0
|
||||
m_FixedHeight: 18
|
||||
m_StretchWidth: 0
|
||||
m_StretchHeight: 0
|
||||
RowMainAssetBtn:
|
||||
m_Name: button
|
||||
m_Normal:
|
||||
m_Background: {fileID: 7619082074131061878, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.7058824, g: 0.7058824, b: 0.7058824, a: 1}
|
||||
m_Hover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Active:
|
||||
m_Background: {fileID: -660027063019260353, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.7058824, g: 0.7058824, b: 0.7058824, a: 1}
|
||||
m_Focused:
|
||||
m_Background: {fileID: 6868133616650823125, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.7058824, g: 0.7058824, b: 0.7058824, a: 1}
|
||||
m_OnNormal:
|
||||
m_Background: {fileID: -4685157240802103863, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.9411765, g: 0.9411765, b: 0.9411765, a: 1}
|
||||
m_OnHover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_OnActive:
|
||||
m_Background: {fileID: 568729325262407274, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.7058824, g: 0.7058824, b: 0.7058824, a: 1}
|
||||
m_OnFocused:
|
||||
m_Background: {fileID: 5631187574603569090, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.7058824, g: 0.7058824, b: 0.7058824, a: 1}
|
||||
m_Border:
|
||||
m_Left: 6
|
||||
m_Right: 6
|
||||
m_Top: 4
|
||||
m_Bottom: 4
|
||||
m_Margin:
|
||||
m_Left: 4
|
||||
m_Right: 4
|
||||
m_Top: 3
|
||||
m_Bottom: 3
|
||||
m_Padding:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Overflow:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 1
|
||||
m_Font: {fileID: 0}
|
||||
m_FontSize: 0
|
||||
m_FontStyle: 0
|
||||
m_Alignment: 3
|
||||
m_WordWrap: 0
|
||||
m_RichText: 0
|
||||
m_TextClipping: 1
|
||||
m_ImagePosition: 0
|
||||
m_ContentOffset: {x: 0, y: 0}
|
||||
m_FixedWidth: 0
|
||||
m_FixedHeight: 20
|
||||
m_StretchWidth: 1
|
||||
m_StretchHeight: 0
|
||||
Size: {x: 400, y: 800}
|
||||
RowLabel:
|
||||
m_Name: label
|
||||
m_Normal:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0.7058824, g: 0.7058824, b: 0.7058824, a: 1}
|
||||
m_Hover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Active:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Focused:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_OnNormal:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_OnHover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_OnActive:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_OnFocused:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Border:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Margin:
|
||||
m_Left: 4
|
||||
m_Right: 4
|
||||
m_Top: 2
|
||||
m_Bottom: 2
|
||||
m_Padding:
|
||||
m_Left: 2
|
||||
m_Right: 2
|
||||
m_Top: 1
|
||||
m_Bottom: 2
|
||||
m_Overflow:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Font: {fileID: 3459068928204737762, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_FontSize: 0
|
||||
m_FontStyle: 0
|
||||
m_Alignment: 0
|
||||
m_WordWrap: 0
|
||||
m_RichText: 0
|
||||
m_TextClipping: 1
|
||||
m_ImagePosition: 0
|
||||
m_ContentOffset: {x: 0, y: 0}
|
||||
m_FixedWidth: 0
|
||||
m_FixedHeight: 0
|
||||
m_StretchWidth: 1
|
||||
m_StretchHeight: 0
|
||||
Personal:
|
||||
LookupBtn:
|
||||
Content:
|
||||
m_Text:
|
||||
m_Image: {fileID: 2800000, guid: 48b12aa9f8e67a5419b212fcae22754b, type: 3}
|
||||
m_Tooltip: Look for dependencies in Project
|
||||
Style:
|
||||
m_Name: button
|
||||
m_Normal:
|
||||
m_Background: {fileID: -573041650897247223, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Hover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Active:
|
||||
m_Background: {fileID: -7527060558648309217, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Focused:
|
||||
m_Background: {fileID: 7832598784815925287, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_OnNormal:
|
||||
m_Background: {fileID: -4454209017672384243, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_OnHover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_OnActive:
|
||||
m_Background: {fileID: 4047951448802137905, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_OnFocused:
|
||||
m_Background: {fileID: 8556163245987529883, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Border:
|
||||
m_Left: 6
|
||||
m_Right: 6
|
||||
m_Top: 4
|
||||
m_Bottom: 4
|
||||
m_Margin:
|
||||
m_Left: 4
|
||||
m_Right: 4
|
||||
m_Top: 3
|
||||
m_Bottom: 3
|
||||
m_Padding:
|
||||
m_Left: 1
|
||||
m_Right: 1
|
||||
m_Top: 1
|
||||
m_Bottom: 3
|
||||
m_Overflow:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 1
|
||||
m_Font: {fileID: 0}
|
||||
m_FontSize: 0
|
||||
m_FontStyle: 0
|
||||
m_Alignment: 4
|
||||
m_WordWrap: 0
|
||||
m_RichText: 0
|
||||
m_TextClipping: 1
|
||||
m_ImagePosition: 2
|
||||
m_ContentOffset: {x: 0, y: 0}
|
||||
m_FixedWidth: 20
|
||||
m_FixedHeight: 20
|
||||
m_StretchWidth: 0
|
||||
m_StretchHeight: 0
|
||||
TabBreadcrumb0:
|
||||
m_Name: GUIEditor.BreadcrumbLeft
|
||||
m_Normal:
|
||||
m_Background: {fileID: -8730859949539617441, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Hover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Active:
|
||||
m_Background: {fileID: 3607839988326647129, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Focused:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_OnNormal:
|
||||
m_Background: {fileID: -2909435724611740479, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_OnHover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_OnActive:
|
||||
m_Background: {fileID: 658594365626841568, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_OnFocused:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Border:
|
||||
m_Left: 3
|
||||
m_Right: 10
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Margin:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Padding:
|
||||
m_Left: 5
|
||||
m_Right: 11
|
||||
m_Top: 2
|
||||
m_Bottom: 0
|
||||
m_Overflow:
|
||||
m_Left: 6
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Font: {fileID: 0}
|
||||
m_FontSize: 0
|
||||
m_FontStyle: 0
|
||||
m_Alignment: 3
|
||||
m_WordWrap: 0
|
||||
m_RichText: 1
|
||||
m_TextClipping: 1
|
||||
m_ImagePosition: 0
|
||||
m_ContentOffset: {x: 0, y: -1}
|
||||
m_FixedWidth: 0
|
||||
m_FixedHeight: 18
|
||||
m_StretchWidth: 0
|
||||
m_StretchHeight: 0
|
||||
TabBreadcrumb1:
|
||||
m_Name: GUIEditor.BreadcrumbMid
|
||||
m_Normal:
|
||||
m_Background: {fileID: 298390163510713244, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Hover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Active:
|
||||
m_Background: {fileID: -5694940394960273964, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Focused:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_OnNormal:
|
||||
m_Background: {fileID: 4917697211602105510, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_OnHover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_OnActive:
|
||||
m_Background: {fileID: 2726902712204841013, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_OnFocused:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Border:
|
||||
m_Left: 10
|
||||
m_Right: 10
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Margin:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Padding:
|
||||
m_Left: 10
|
||||
m_Right: 10
|
||||
m_Top: 2
|
||||
m_Bottom: 0
|
||||
m_Overflow:
|
||||
m_Left: 10
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Font: {fileID: 0}
|
||||
m_FontSize: 0
|
||||
m_FontStyle: 0
|
||||
m_Alignment: 3
|
||||
m_WordWrap: 0
|
||||
m_RichText: 1
|
||||
m_TextClipping: 1
|
||||
m_ImagePosition: 0
|
||||
m_ContentOffset: {x: 0, y: -1}
|
||||
m_FixedWidth: 0
|
||||
m_FixedHeight: 18
|
||||
m_StretchWidth: 0
|
||||
m_StretchHeight: 0
|
||||
RowMainAssetBtn:
|
||||
m_Name: button
|
||||
m_Normal:
|
||||
m_Background: {fileID: -573041650897247223, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Hover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Active:
|
||||
m_Background: {fileID: -7527060558648309217, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Focused:
|
||||
m_Background: {fileID: 7832598784815925287, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_OnNormal:
|
||||
m_Background: {fileID: -4454209017672384243, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_OnHover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_OnActive:
|
||||
m_Background: {fileID: 4047951448802137905, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_OnFocused:
|
||||
m_Background: {fileID: 8556163245987529883, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Border:
|
||||
m_Left: 6
|
||||
m_Right: 6
|
||||
m_Top: 4
|
||||
m_Bottom: 4
|
||||
m_Margin:
|
||||
m_Left: 4
|
||||
m_Right: 4
|
||||
m_Top: 3
|
||||
m_Bottom: 3
|
||||
m_Padding:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Overflow:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 1
|
||||
m_Font: {fileID: 0}
|
||||
m_FontSize: 0
|
||||
m_FontStyle: 0
|
||||
m_Alignment: 3
|
||||
m_WordWrap: 0
|
||||
m_RichText: 0
|
||||
m_TextClipping: 1
|
||||
m_ImagePosition: 0
|
||||
m_ContentOffset: {x: 0, y: 0}
|
||||
m_FixedWidth: 0
|
||||
m_FixedHeight: 20
|
||||
m_StretchWidth: 1
|
||||
m_StretchHeight: 0
|
||||
Size: {x: 400, y: 800}
|
||||
RowLabel:
|
||||
m_Name: label
|
||||
m_Normal:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Hover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Active:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Focused:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 0.01960784}
|
||||
m_OnNormal:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_OnHover:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_OnActive:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 0.01960784}
|
||||
m_OnFocused:
|
||||
m_Background: {fileID: 0}
|
||||
m_ScaledBackgrounds: []
|
||||
m_TextColor: {r: 0, g: 0, b: 0, a: 0.01960784}
|
||||
m_Border:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Margin:
|
||||
m_Left: 4
|
||||
m_Right: 4
|
||||
m_Top: 2
|
||||
m_Bottom: 2
|
||||
m_Padding:
|
||||
m_Left: 2
|
||||
m_Right: 2
|
||||
m_Top: 1
|
||||
m_Bottom: 2
|
||||
m_Overflow:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_Font: {fileID: 3459068928204737762, guid: 0000000000000000d000000000000000,
|
||||
type: 0}
|
||||
m_FontSize: 0
|
||||
m_FontStyle: 0
|
||||
m_Alignment: 3
|
||||
m_WordWrap: 0
|
||||
m_RichText: 0
|
||||
m_TextClipping: 1
|
||||
m_ImagePosition: 0
|
||||
m_ContentOffset: {x: 0, y: 0}
|
||||
m_FixedWidth: 0
|
||||
m_FixedHeight: 0
|
||||
m_StretchWidth: 1
|
||||
m_StretchHeight: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 939dee46ae9eef044b454d9a2f64719d
|
||||
timeCreated: 1467571796
|
||||
licenseType: Store
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Asset Usage Finder/Editor/Content/lookup.png
(Stored with Git LFS)
Normal file
BIN
Assets/Asset Usage Finder/Editor/Content/lookup.png
(Stored with Git LFS)
Normal file
Binary file not shown.
57
Assets/Asset Usage Finder/Editor/Content/lookup.png.meta
Normal file
57
Assets/Asset Usage Finder/Editor/Content/lookup.png.meta
Normal file
@@ -0,0 +1,57 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48b12aa9f8e67a5419b212fcae22754b
|
||||
timeCreated: 1487778797
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 7
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
allowsAlphaSplitting: 0
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
outline: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Asset Usage Finder/Editor/Content/lookup_pro.png
(Stored with Git LFS)
Normal file
BIN
Assets/Asset Usage Finder/Editor/Content/lookup_pro.png
(Stored with Git LFS)
Normal file
Binary file not shown.
57
Assets/Asset Usage Finder/Editor/Content/lookup_pro.png.meta
Normal file
57
Assets/Asset Usage Finder/Editor/Content/lookup_pro.png.meta
Normal file
@@ -0,0 +1,57 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93880ab424857034481dd201068f1f3c
|
||||
timeCreated: 1467572760
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 7
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
allowsAlphaSplitting: 0
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
outline: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/Asset Usage Finder/Editor/Data.meta
Normal file
9
Assets/Asset Usage Finder/Editor/Data.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: acc929cd151e60c4eaec2a88e8c36274
|
||||
folderAsset: yes
|
||||
timeCreated: 1488097356
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
25
Assets/Asset Usage Finder/Editor/Data/AssetDependencies.cs
Normal file
25
Assets/Asset Usage Finder/Editor/Data/AssetDependencies.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
[Serializable]
|
||||
public class AssetDependencies {
|
||||
public string[] DependencyGuids;
|
||||
public string HashString;
|
||||
|
||||
[NonSerialized] Hash128 _hashCache;
|
||||
|
||||
public Hash128 DependencyHash {
|
||||
get { return _hashCache.Equals(default(Hash128)) ? Hash128.Parse(HashString) : _hashCache; }
|
||||
set {
|
||||
_hashCache = value;
|
||||
HashString = value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public bool Contains(string guid) {
|
||||
return DependencyGuids.Any(d => StringComparer.InvariantCultureIgnoreCase.Equals(guid, d));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b4b690bbffa63544f9cc84b6b0bcbf18
|
||||
timeCreated: 1486474181
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
131
Assets/Asset Usage Finder/Editor/Data/CacheManager.cs
Normal file
131
Assets/Asset Usage Finder/Editor/Data/CacheManager.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
public class CacheManager {
|
||||
Dictionary<string, AssetDependencies> _dict;
|
||||
HashSet<string> _used;
|
||||
|
||||
// [MenuItem("Tools/LogPath")]
|
||||
static void Log() {
|
||||
Debug.Log(Application.temporaryCachePath);
|
||||
}
|
||||
|
||||
public CacheManager() {
|
||||
_dict = new Dictionary<string, AssetDependencies>(StringComparer.InvariantCultureIgnoreCase);
|
||||
_used = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
public void Init() {
|
||||
var serializable = Deserialize();
|
||||
_dict = serializable.OnDeserialize();
|
||||
}
|
||||
|
||||
static SerializableData Deserialize() {
|
||||
SerializableData data;
|
||||
string json;
|
||||
|
||||
if (!File.Exists(Path)) {
|
||||
// not exists - write new
|
||||
data = SerializableData.Empty();
|
||||
json = JsonUtility.ToJson(data);
|
||||
File.WriteAllText(Path, json);
|
||||
}
|
||||
else {
|
||||
// exists
|
||||
json = File.ReadAllText(Path);
|
||||
|
||||
if (string.IsNullOrEmpty(json)) {
|
||||
// but corrupted - overwrite with new
|
||||
data = SerializableData.Empty();
|
||||
json = JsonUtility.ToJson(data);
|
||||
File.WriteAllText(Path, json);
|
||||
}
|
||||
|
||||
data = JsonUtility.FromJson<SerializableData>(json);
|
||||
if (!SerializableData.Valid(data)) {
|
||||
// but corrupted - overwrite with new
|
||||
data = SerializableData.Empty();
|
||||
json = JsonUtility.ToJson(data);
|
||||
File.WriteAllText(Path, json);
|
||||
}
|
||||
// todo assert valid
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
static string Path => $"{Application.temporaryCachePath}/AssetUsageFinder4.json";
|
||||
|
||||
public void Serialize() {
|
||||
var data = SerializableData.OnSerialize(_dict);
|
||||
var json = JsonUtility.ToJson(data);
|
||||
File.WriteAllText(Path, json);
|
||||
}
|
||||
|
||||
internal AssetDependencies Get(string path, string guid) {
|
||||
_used.Add(guid);
|
||||
if (_dict.TryGetValue(guid, out var res)) {
|
||||
var assetDependencyHash = AssetDatabase.GetAssetDependencyHash(path);
|
||||
|
||||
if (assetDependencyHash.isValid && res.DependencyHash == assetDependencyHash) {
|
||||
return res;
|
||||
}
|
||||
|
||||
res = HashByPath();
|
||||
_dict[guid] = res;
|
||||
return res;
|
||||
}
|
||||
|
||||
res = HashByPath();
|
||||
_dict.Add(guid, res);
|
||||
return res;
|
||||
|
||||
AssetDependencies HashByPath() {
|
||||
var dependencyPaths = AssetDatabase.GetDependencies(path, recursive: false);
|
||||
var guids = dependencyPaths.Select(AssetDatabase.AssetPathToGUID).ToArray();
|
||||
return new AssetDependencies {
|
||||
DependencyGuids = guids,
|
||||
DependencyHash = AssetDatabase.GetAssetDependencyHash(path),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class SerializableData {
|
||||
public const int CurrentVersion = 7; // for cache invalidation
|
||||
|
||||
public int Version;
|
||||
public string[] Keys;
|
||||
public AssetDependencies[] Values;
|
||||
|
||||
public static SerializableData Empty() => new SerializableData() {
|
||||
Keys = new string[0],
|
||||
Values = new AssetDependencies[0],
|
||||
Version = CurrentVersion,
|
||||
};
|
||||
|
||||
public static SerializableData OnSerialize(Dictionary<string, AssetDependencies> dict) {
|
||||
return new SerializableData() {
|
||||
Keys = dict.Keys.ToArray(),
|
||||
Values = dict.Values.ToArray(),
|
||||
Version = CurrentVersion,
|
||||
};
|
||||
}
|
||||
|
||||
public Dictionary<string, AssetDependencies> OnDeserialize() {
|
||||
var res = new Dictionary<string, AssetDependencies>(StringComparer.InvariantCultureIgnoreCase);
|
||||
var keysLength = Keys.Length;
|
||||
for (var i = 0; i < keysLength; i++) res.Add(Keys[i], Values[i]);
|
||||
return res;
|
||||
}
|
||||
|
||||
public static bool Valid(SerializableData that) =>
|
||||
that != null && CurrentVersion == that.Version && that.Keys != null && that.Values != null && that.Keys.Length == that.Values.Length;
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/Asset Usage Finder/Editor/Data/CacheManager.cs.meta
Normal file
12
Assets/Asset Usage Finder/Editor/Data/CacheManager.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e70f0d094b7379b45a36f7fc76809b0a
|
||||
timeCreated: 1486465336
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
[Serializable]
|
||||
abstract class DependencyAbstractFinder {
|
||||
public SearchTarget Target;
|
||||
public ResultRow[] Dependencies;
|
||||
public GUIContent TabContent;
|
||||
public DependencyAbstractFinder Parent;
|
||||
public string Title = "";
|
||||
|
||||
public List<DependencyAbstractFinder> Parents() {
|
||||
var res = new List<DependencyAbstractFinder>();
|
||||
for (var cur = this; cur != null; cur = cur.Parent)
|
||||
res.Add(cur);
|
||||
return res;
|
||||
}
|
||||
|
||||
public IEnumerable<ResultRow> Group(IEnumerable<ResultRow> inScenePro) {
|
||||
ResultRow cur = null;
|
||||
var res = new List<ResultRow>();
|
||||
var list = inScenePro.OrderBy(t => t.Main.GetInstanceID());
|
||||
var modificationsString = "Object.Modification.Modifications";
|
||||
var correpsondingString = "CorrespondingSourceObject";
|
||||
var gameObjectString = "GameObject";
|
||||
foreach (var source in list.ToList()) {
|
||||
if (cur == null || cur.Main != source.Main) {
|
||||
cur = source;
|
||||
var buf = source.Properties.Where(p =>
|
||||
!p.Content.text.Contains(gameObjectString) &&
|
||||
!p.Content.text.Contains(modificationsString) &&
|
||||
!p.Content.text.Contains(correpsondingString)).ToList();
|
||||
cur.Properties = buf;
|
||||
res.Add(cur);
|
||||
}
|
||||
else {
|
||||
foreach (var item in source.Properties) {
|
||||
if (
|
||||
!item.Content.text.Contains(gameObjectString) &&
|
||||
!item.Content.text.Contains(modificationsString) &&
|
||||
!item.Content.text.Contains(correpsondingString) &&
|
||||
!cur.Properties.Any(p =>
|
||||
p.Content.text == item.Content.text &&
|
||||
p.Content.tooltip == p.Content.tooltip)) {
|
||||
cur.Properties.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public abstract void FindDependencies();
|
||||
public abstract DependencyAbstractFinder Nest(Object o);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25951e74c3fd1cd40863089a51c157ce
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
381
Assets/Asset Usage Finder/Editor/Data/DependencyFinderEngine.cs
Normal file
381
Assets/Asset Usage Finder/Editor/Data/DependencyFinderEngine.cs
Normal file
@@ -0,0 +1,381 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Animations;
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
static class DependencyFinderEngine {
|
||||
#region Private
|
||||
|
||||
const string AssetsRootPath = "Assets/";
|
||||
static double _cachedTime;
|
||||
|
||||
static bool NeedsUpdate {
|
||||
get {
|
||||
var t = _cachedTime;
|
||||
_cachedTime = EditorApplication.timeSinceStartup;
|
||||
var result = _cachedTime - t > 0.03;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
static Option<ResultRow> GenerateResultRowByObject(SearchTarget target, Object c, bool isScene = true) {
|
||||
var so = new SerializedObject(c);
|
||||
var sp = so.GetIterator();
|
||||
ResultRow row = null;
|
||||
while (sp.Next(enterChildren: true)) {
|
||||
string transformPath = string.Empty;
|
||||
if (sp.propertyType != SerializedPropertyType.ObjectReference) continue;
|
||||
if (!target.Check(sp.objectReferenceValue)) continue;
|
||||
if (row == null) {
|
||||
row = new ResultRow {
|
||||
Root = c,
|
||||
Target = c,
|
||||
SerializedObject = so
|
||||
};
|
||||
|
||||
if (isScene) {
|
||||
var component = c as Component;
|
||||
if (component) {
|
||||
row.Main = component.gameObject;
|
||||
}
|
||||
else {
|
||||
var o = c as GameObject;
|
||||
if (o != null) {
|
||||
row.Main = o;
|
||||
}
|
||||
}
|
||||
|
||||
var go = row.Main as GameObject;
|
||||
// Assert.NotNull(go);
|
||||
row.LabelContent.text = AnimationUtility.CalculateTransformPath(go.transform, null);
|
||||
row.LabelContent.image = AssetPreview.GetMiniThumbnail(go);
|
||||
}
|
||||
else {
|
||||
var path = AssetDatabase.GetAssetPath(c);
|
||||
row.Main = AssetDatabase.LoadMainAssetAtPath(path);
|
||||
|
||||
var mainType = PrefabUtility.GetPrefabAssetType(row.Main);
|
||||
|
||||
if (mainType != PrefabAssetType.NotAPrefab) {
|
||||
var comp = row.Target as Component;
|
||||
if (comp) {
|
||||
try {
|
||||
transformPath = string.Format("{0}/", AnimationUtility.CalculateTransformPath(comp.transform, null)).Replace("/", "/\n");
|
||||
}
|
||||
catch {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
row.LabelContent.text = path.Replace(AssetsRootPath, string.Empty);
|
||||
row.LabelContent.image = AssetDatabase.GetCachedIcon(path);
|
||||
}
|
||||
}
|
||||
|
||||
Texture2D miniTypeThumbnail = row.Main == c ? null : AssetPreview.GetMiniThumbnail(c);
|
||||
|
||||
row.Properties.Add(new ResultRow.PropertyData {
|
||||
Property = sp.Copy(),
|
||||
Content = new GUIContent {
|
||||
image = miniTypeThumbnail,
|
||||
text = Nicify(sp, sp.serializedObject.targetObject, row.Main, target),
|
||||
tooltip = string.Format("{2}{0}.{1}", sp.serializedObject.targetObject.GetType().Name, sp.propertyPath, transformPath)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (row == null)
|
||||
so.Dispose();
|
||||
return row;
|
||||
}
|
||||
|
||||
|
||||
public static IEnumerable<(int state, string crumbs)> Traverse(AnimatorController controller) {
|
||||
for (var index = 0; index < controller.layers.Length; index++) {
|
||||
var controllerLayer = controller.layers[index];
|
||||
foreach (var i in Inner(controllerLayer.stateMachine, $"{controllerLayer.name}({index})"))
|
||||
yield return i;
|
||||
}
|
||||
}
|
||||
|
||||
static IEnumerable<(int state, string crumbs)> Inner(AnimatorStateMachine f, string crumbs) {
|
||||
foreach (var state in f.states)
|
||||
yield return (state.state.GetInstanceID(), crumbs);
|
||||
|
||||
foreach (var child in f.stateMachines) {
|
||||
foreach (var tuple in Inner(child.stateMachine, $"{crumbs}/{child.stateMachine.name}"))
|
||||
yield return tuple;
|
||||
}
|
||||
}
|
||||
|
||||
// todo use GetInstanceID instead of unityobj refs
|
||||
static Dictionary<int, Dictionary<int, string>> _animCache = new Dictionary<int, Dictionary<int, string>>();
|
||||
|
||||
static string GetBread(AnimatorController c, AnimatorState state) {
|
||||
if (!_animCache.TryGetValue(c.GetInstanceID(), out var res)) {
|
||||
res = new Dictionary<int, string>();
|
||||
_animCache.Add(c.GetInstanceID(), res);
|
||||
foreach (var (stateId, crumbs) in Traverse(c))
|
||||
res.Add(stateId, crumbs);
|
||||
}
|
||||
|
||||
if (res.TryGetValue(state.GetInstanceID(), out var crumb))
|
||||
return $"{crumb}/";
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
static string Nicify(SerializedProperty sp, Object o, Object main, SearchTarget target) {
|
||||
// return sp.propertyPath;
|
||||
|
||||
string nice = string.Empty;
|
||||
switch (o) {
|
||||
case AnimatorController _: {
|
||||
return Nice(sp.propertyPath);
|
||||
}
|
||||
|
||||
case BlendTree blendTree: {
|
||||
return $"{blendTree.name}({o.GetType().Name})";
|
||||
}
|
||||
|
||||
case AnimatorState animatorState: {
|
||||
if (main is AnimatorController animatorController) {
|
||||
var bread = GetBread(animatorController, animatorState);
|
||||
return $"{bread}{animatorState.name}";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case StateMachineBehaviour smb: {
|
||||
var ctx = AnimatorController.FindStateMachineBehaviourContext(smb);
|
||||
if (ctx.Length == 0)
|
||||
break;
|
||||
|
||||
var first = ctx[0];
|
||||
var bread = string.Empty;
|
||||
switch (first.animatorObject) {
|
||||
case AnimatorStateMachine _:
|
||||
// nothing
|
||||
break;
|
||||
case AnimatorState ast: {
|
||||
bread = GetBread(first.animatorController, ast);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $"{bread}{first.animatorObject.name}";
|
||||
}
|
||||
case Material _:
|
||||
nice = sp.displayName;
|
||||
break;
|
||||
default: {
|
||||
nice = Nice(sp.propertyPath);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
nice = string.Format("{0}.{1}", o.GetType().Name, nice);
|
||||
return nice;
|
||||
}
|
||||
|
||||
static string Nice(string path) {
|
||||
var nice = path.Replace(".Array.data", string.Empty);
|
||||
if (nice.IndexOf(".m_PersistentCalls.m_Calls", StringComparison.Ordinal) > 0) {
|
||||
nice = nice.Replace(".m_PersistentCalls.m_Calls", string.Empty)
|
||||
.Replace(".m_Target", string.Empty);
|
||||
}
|
||||
|
||||
|
||||
if (nice.StartsWith("m_", StringComparison.Ordinal))
|
||||
nice = nice.Replace("m_", string.Empty);
|
||||
|
||||
nice = nice.Split('.').Select(t => ObjectNames.NicifyVariableName(t).Replace(" ", string.Empty)).Aggregate((a, b) => a + "." + b);
|
||||
return nice;
|
||||
}
|
||||
|
||||
public static IEnumerable<T> AsEnumerable<T>(T o) {
|
||||
yield return o;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Project
|
||||
|
||||
static HashSet<string> GetDependencies(Object activeObject) {
|
||||
var targetPath = AssetDatabase.GetAssetPath(activeObject);
|
||||
var targetGuid = AssetDatabase.AssetPathToGUID(targetPath);
|
||||
var objectGuids = AssetDatabase.FindAssets("t:Object");
|
||||
var results = new HashSet<string>(StringComparer.Ordinal);
|
||||
var total = objectGuids.LongLength;
|
||||
var cache = Globals<CacheManager>.Get();
|
||||
try {
|
||||
for (int i = 0; i < total; i++) {
|
||||
var path = AssetDatabase.GUIDToAssetPath(objectGuids[i]);
|
||||
var res = cache.Get(path, objectGuids[i]);
|
||||
|
||||
if (path.Contains(".unity"))
|
||||
continue;
|
||||
|
||||
if (res.Contains(targetGuid))
|
||||
results.Add(path);
|
||||
|
||||
if (!NeedsUpdate) continue;
|
||||
|
||||
if (EditorUtility.DisplayCancelableProgressBar("Generating cache", "Searching for file usages", (float) i / total))
|
||||
break;
|
||||
}
|
||||
}
|
||||
finally {
|
||||
cache.Serialize();
|
||||
EditorUtility.ClearProgressBar();
|
||||
}
|
||||
|
||||
results.Remove(targetPath);
|
||||
return results;
|
||||
}
|
||||
|
||||
public static IEnumerable<ResultRow> GetFilesThatReference(SearchTarget target) {
|
||||
return GetDependencies(target.Target)
|
||||
.SelectMany(p => AssetDatabase.LoadAllAssetsAtPath(p))
|
||||
.Where(t => t && !(t is DefaultAsset) && !(t is Transform))
|
||||
.Select(asset => GenerateResultRowByObject(target, asset, false))
|
||||
.Where(row => row.HasValue)
|
||||
.Select(r => r.GetOrFail());
|
||||
}
|
||||
|
||||
public static HashSet<string> GetScenesThatContain(Object activeObject) {
|
||||
var targetPath = AssetDatabase.GetAssetPath(activeObject);
|
||||
var targetGuid = AssetDatabase.AssetPathToGUID(targetPath);
|
||||
|
||||
var results = new HashSet<string>(StringComparer.Ordinal);
|
||||
var sceneGuids = AssetDatabase.FindAssets("t:Scene");
|
||||
|
||||
var total = sceneGuids.LongLength;
|
||||
|
||||
var cache = Globals<CacheManager>.Get();
|
||||
try {
|
||||
for (int i = 0; i < total; i++) {
|
||||
var path = AssetDatabase.GUIDToAssetPath(sceneGuids[i]);
|
||||
var res = cache.Get(path, sceneGuids[i]);
|
||||
|
||||
if (res.Contains(targetGuid))
|
||||
results.Add(path);
|
||||
|
||||
if (!NeedsUpdate) continue;
|
||||
|
||||
if (EditorUtility.DisplayCancelableProgressBar("Searching for file usages in scenes..", path, (float) i / total))
|
||||
break;
|
||||
}
|
||||
}
|
||||
finally {
|
||||
cache.Serialize();
|
||||
EditorUtility.ClearProgressBar();
|
||||
}
|
||||
|
||||
EditorUtility.ClearProgressBar();
|
||||
results.Remove(targetPath);
|
||||
return results;
|
||||
}
|
||||
|
||||
#endregion Project
|
||||
|
||||
public static IEnumerable<ResultRow> GetDependenciesInScene(SearchTarget target) {
|
||||
var referencedBy = new List<ResultRow>();
|
||||
|
||||
for (int ii = 0; ii < SceneManager.sceneCount; ii++) {
|
||||
var currentScene = SceneManager.GetSceneAt(ii);
|
||||
|
||||
if (!currentScene.IsValid() || !currentScene.isLoaded)
|
||||
continue;
|
||||
|
||||
var allObjects = currentScene
|
||||
.GetRootGameObjects()
|
||||
.SelectMany(g => {
|
||||
if (g != target.Target)
|
||||
return g.GetComponentsInChildren<Component>(true)
|
||||
.Where(FilterComponents).Union(AsEnumerable(g as Object));
|
||||
return g.GetComponentsInChildren<Component>(true).Where(FilterComponents);
|
||||
})
|
||||
.Where(t => t)
|
||||
.ToArray();
|
||||
var total = allObjects.Length;
|
||||
|
||||
var step = total / 5;
|
||||
|
||||
try {
|
||||
if (target.Nested.TryGet(out var nested))
|
||||
foreach (var n in nested) {
|
||||
var searchTarget = SearchTarget.CreateSceneNested(n);
|
||||
for (var i = 0; i < total; i++) {
|
||||
var comp = allObjects[i];
|
||||
if (!GenerateResultRowByObject(target, comp).TryGet(out var res))
|
||||
continue;
|
||||
|
||||
if (res != null && target.Target != res.Main)
|
||||
referencedBy.Add(res);
|
||||
|
||||
if (!GenerateResultRowByObject(searchTarget, comp).TryGet(out var resultNested))
|
||||
continue;
|
||||
|
||||
if (resultNested != null && searchTarget.Target != resultNested.Main)
|
||||
referencedBy.Add(resultNested);
|
||||
|
||||
if (step == 0) continue;
|
||||
if (i % step != 0) continue;
|
||||
if (EditorUtility.DisplayCancelableProgressBar("Searching for file usages in current scene..", target.Target.name, (float) i / total))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
EditorUtility.ClearProgressBar();
|
||||
}
|
||||
}
|
||||
|
||||
return referencedBy.Distinct().ToList();
|
||||
}
|
||||
|
||||
static bool FilterComponents(Component c) {
|
||||
switch (c) {
|
||||
case Transform _:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<ResultRow> GetDependenciesInStage(SearchTarget target, UnityEditor.SceneManagement.PrefabStage stage) {
|
||||
var referencedBy = new List<ResultRow>();
|
||||
|
||||
var allObjects = stage.scene
|
||||
.GetRootGameObjects()
|
||||
.SelectMany(g => {
|
||||
if (g != target.Target)
|
||||
return g.GetComponentsInChildren<Component>(true).Where(FilterComponents).Union(AsEnumerable(g as Object));
|
||||
return g.GetComponentsInChildren<Component>(true).Where(FilterComponents);
|
||||
}).ToArray();
|
||||
var total = allObjects.Length;
|
||||
for (int i = 0; i < total; i++) {
|
||||
var comp = allObjects[i];
|
||||
if (!GenerateResultRowByObject(target, comp).TryGet(out var res))
|
||||
continue;
|
||||
|
||||
referencedBy.Add(res);
|
||||
|
||||
if (EditorUtility.DisplayCancelableProgressBar("Searching for file usages in current scene..", target.Target.name, (float) i / total))
|
||||
break;
|
||||
}
|
||||
|
||||
EditorUtility.ClearProgressBar();
|
||||
|
||||
|
||||
return referencedBy;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8a6622c947e860548bd95915e407658e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
using UnityEngine.Assertions;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
[Serializable]
|
||||
sealed class FileDependencyFinder : DependencyAbstractFinder {
|
||||
public class Pair {
|
||||
public string NicifiedPath;
|
||||
public string Path;
|
||||
}
|
||||
|
||||
public Pair[] ScenePaths;
|
||||
|
||||
public FileDependencyFinder(Object target) {
|
||||
Asr.IsTrue(target, "Asset you're trying to search is corrupted");
|
||||
Target = SearchTarget.CreateFile(target);
|
||||
FindDependencies();
|
||||
var path = AssetDatabase.GetAssetPath(Target.Target);
|
||||
Title = path;
|
||||
TabContent = new GUIContent {
|
||||
text = target.name,
|
||||
image = AssetDatabase.GetCachedIcon(path)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public override void FindDependencies() {
|
||||
var files = DependencyFinderEngine.GetFilesThatReference(Target);
|
||||
Dependencies = Group(files.Where(f => !(f.Target is SceneAsset)))
|
||||
.OrderBy(t => t.LabelContent.text, StringComparer.Ordinal)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
public override DependencyAbstractFinder Nest(Object o) {
|
||||
return new FileDependencyFinder(o) {Parent = this};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2c4b883461f4461438dae02eba435811
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
21
Assets/Asset Usage Finder/Editor/Data/Globals.cs
Normal file
21
Assets/Asset Usage Finder/Editor/Data/Globals.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
static class Globals<T> where T : class {
|
||||
static T _instance;
|
||||
|
||||
public static void TryInit(Func<T> ctor) {
|
||||
if (_instance != null) return;
|
||||
_instance = ctor.Invoke();
|
||||
}
|
||||
|
||||
public static T Get() => _instance;
|
||||
|
||||
public static T GetOrCreate(Func<T> ctor) {
|
||||
TryInit(ctor);
|
||||
return _instance;
|
||||
}
|
||||
|
||||
public static void Set(T value) => _instance = value;
|
||||
}
|
||||
}
|
||||
3
Assets/Asset Usage Finder/Editor/Data/Globals.cs.meta
Normal file
3
Assets/Asset Usage Finder/Editor/Data/Globals.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2dee75149ff4451a979163c53566150c
|
||||
timeCreated: 1587621466
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
[Serializable]
|
||||
sealed class InSceneDependencyFinder : DependencyAbstractFinder {
|
||||
[SerializeField] string _scenePath;
|
||||
|
||||
public InSceneDependencyFinder(Object target, string scenePath) {
|
||||
Target = SearchTarget.CreateScene(target, scenePath);
|
||||
_scenePath = scenePath;
|
||||
Title = scenePath;
|
||||
|
||||
var name = target is Component ? target.GetType().Name : target.name;
|
||||
|
||||
TabContent = new GUIContent {
|
||||
text = name,
|
||||
image = AssetPreview.GetMiniTypeThumbnail(Target.Target.GetType()) ?? AssetPreview.GetMiniThumbnail(Target.Target)
|
||||
};
|
||||
|
||||
FindDependencies();
|
||||
}
|
||||
|
||||
public override void FindDependencies() {
|
||||
var dependenciesInScene = DependencyFinderEngine.GetDependenciesInScene(Target);
|
||||
Dependencies = Group(dependenciesInScene).ToArray();
|
||||
}
|
||||
|
||||
|
||||
public override DependencyAbstractFinder Nest(Object o) {
|
||||
return new InSceneDependencyFinder(o, _scenePath) {Parent = this};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 925da3bd0dee034418ecb5cf800a3526
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
[Serializable]
|
||||
sealed class InStageDependencyFinder : DependencyAbstractFinder {
|
||||
[SerializeField] string _stagePath;
|
||||
[SerializeField] UnityEditor.SceneManagement.PrefabStage _stage;
|
||||
|
||||
public InStageDependencyFinder(Object target, string stagePath) {
|
||||
Target = SearchTarget.CreateStage(target, stagePath);
|
||||
_stagePath = stagePath;
|
||||
_stage = Target.Stage;
|
||||
Title = stagePath;
|
||||
|
||||
var name = target is Component ? target.GetType().Name : target.name;
|
||||
|
||||
TabContent = new GUIContent {
|
||||
text = name,
|
||||
image = AssetPreview.GetMiniTypeThumbnail(Target.Target.GetType()) ?? AssetPreview.GetMiniThumbnail(Target.Target)
|
||||
};
|
||||
|
||||
FindDependencies();
|
||||
}
|
||||
|
||||
public override void FindDependencies() {
|
||||
Dependencies = Group(DependencyFinderEngine.GetDependenciesInStage(Target, _stage)).ToArray();
|
||||
}
|
||||
|
||||
|
||||
public override DependencyAbstractFinder Nest(Object o) {
|
||||
return new InStageDependencyFinder(o, _stagePath) {Parent = this};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 584109c30c0a0d849bbc12ec89d8c597
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
24
Assets/Asset Usage Finder/Editor/Data/ResultRow.cs
Normal file
24
Assets/Asset Usage Finder/Editor/Data/ResultRow.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
[Serializable]
|
||||
class ResultRow {
|
||||
[Serializable]
|
||||
public class PropertyData {
|
||||
public SerializedProperty Property;
|
||||
public GUIContent Content;
|
||||
}
|
||||
|
||||
public Object Target;
|
||||
public SerializedObject SerializedObject;
|
||||
public List<PropertyData> Properties = new List<PropertyData>();
|
||||
public Object Root;
|
||||
public GUIContent LabelContent = new GUIContent();
|
||||
public GUIContent PropertyFieldContent = new GUIContent();
|
||||
public Object Main;
|
||||
}
|
||||
}
|
||||
12
Assets/Asset Usage Finder/Editor/Data/ResultRow.cs.meta
Normal file
12
Assets/Asset Usage Finder/Editor/Data/ResultRow.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40006b038ab829f4698bcebf3c1508f1
|
||||
timeCreated: 1467625979
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
119
Assets/Asset Usage Finder/Editor/Data/SearchTarget.cs
Normal file
119
Assets/Asset Usage Finder/Editor/Data/SearchTarget.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.Assertions;
|
||||
using UnityEngine.SceneManagement;
|
||||
using static AssetUsageFinder.PrefabUtilities;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
[Serializable]
|
||||
class SearchTarget {
|
||||
public static SearchTarget CreateStage(Object target, string sceneOrStagePath = null) {
|
||||
return new SearchTarget(target, FindModeEnum.Stage, sceneOrStagePath);
|
||||
}
|
||||
|
||||
public static SearchTarget CreateFile(Object target, string sceneOrStagePath = null) {
|
||||
return new SearchTarget(target, FindModeEnum.File, sceneOrStagePath);
|
||||
}
|
||||
|
||||
public static SearchTarget CreateScene(Object target, string sceneOrStagePath = null) {
|
||||
return new SearchTarget(target, FindModeEnum.Scene, sceneOrStagePath);
|
||||
}
|
||||
|
||||
public static SearchTarget CreateSceneNested(Object target) {
|
||||
return new SearchTarget(target, FindModeEnum.Scene) {IsNested = true};
|
||||
}
|
||||
|
||||
public Object Target;
|
||||
public Option<Object[]> Nested;
|
||||
public Object Root;
|
||||
public Scene Scene;
|
||||
public UnityEditor.SceneManagement.PrefabStage Stage;
|
||||
public bool IsNested;
|
||||
|
||||
SearchTarget(Object target, FindModeEnum findMode, string sceneOrStagePath = null) {
|
||||
Asr.IsNotNull(target, "Asset you're trying to search is corrupted");
|
||||
Target = target;
|
||||
var path = sceneOrStagePath ?? AssetDatabase.GetAssetPath(Target);
|
||||
switch (findMode) {
|
||||
case FindModeEnum.File: {
|
||||
Asr.IsTrue(string.IsNullOrEmpty(sceneOrStagePath));
|
||||
Root = AssetDatabase.LoadMainAssetAtPath(path);
|
||||
if (!IsNested)
|
||||
Nested = AufUtils.LoadAllAssetsAtPath(path);
|
||||
if (AssetDatabase.GetMainAssetTypeAtPath(path).IsAssignableFrom(typeof(SceneAsset)))
|
||||
Scene = SceneManager.GetSceneByPath(path);
|
||||
}
|
||||
break;
|
||||
case FindModeEnum.Scene:
|
||||
case FindModeEnum.Stage: {
|
||||
Root = Target;
|
||||
var asset = AssetDatabase.GetAssetPath(target);
|
||||
if (Target is GameObject go) {
|
||||
switch (PrefabUtility.GetPrefabAssetType(go)) {
|
||||
case PrefabAssetType.Regular:
|
||||
case PrefabAssetType.Variant: {
|
||||
if (!IsNested)
|
||||
Nested = string.IsNullOrEmpty(asset) ? go.GetComponents<Component>() : AssetDatabase.LoadAllAssetsAtPath(asset);
|
||||
|
||||
break;
|
||||
}
|
||||
case PrefabAssetType.Model: {
|
||||
if (!IsNested)
|
||||
Nested = AssetDatabase.LoadAllAssetsAtPath(asset);
|
||||
break;
|
||||
}
|
||||
case PrefabAssetType.MissingAsset:
|
||||
case PrefabAssetType.NotAPrefab:
|
||||
if (!IsNested)
|
||||
Nested = go.GetComponents<Component>().Union(Enumerable.Repeat(Target, 1)).ToArray();
|
||||
break;
|
||||
}
|
||||
|
||||
Stage = UnityEditor.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
|
||||
if (findMode == FindModeEnum.Scene) {
|
||||
if (string.IsNullOrEmpty(sceneOrStagePath))
|
||||
sceneOrStagePath = go.scene.path;
|
||||
Scene = SceneManager.GetSceneByPath(sceneOrStagePath);
|
||||
}
|
||||
}
|
||||
else if (Target is Component c) {
|
||||
// prefab instance
|
||||
Nested = default;
|
||||
if (findMode == FindModeEnum.Scene) {
|
||||
if (string.IsNullOrEmpty(sceneOrStagePath))
|
||||
sceneOrStagePath = c.gameObject.scene.path;
|
||||
Scene = SceneManager.GetSceneByPath(sceneOrStagePath);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!IsNested)
|
||||
Nested = AssetDatabase.LoadAllAssetsAtPath(asset);
|
||||
|
||||
if (AssetDatabase.GetMainAssetTypeAtPath(path).IsAssignableFrom(typeof(SceneAsset)))
|
||||
Scene = SceneManager.GetSceneByPath(path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Asr.IsTrue(!IsNested || !Nested.HasValue);
|
||||
}
|
||||
|
||||
public bool Check(Object arg) {
|
||||
if (arg == null || Target == null) return false;
|
||||
if (arg == Target) return true;
|
||||
if (!Nested.TryGet(out var n)) return false;
|
||||
|
||||
var length = n.Length;
|
||||
for (var i = 0; i < length; i++)
|
||||
if (n[i] == arg)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/Asset Usage Finder/Editor/Data/SearchTarget.cs.meta
Normal file
12
Assets/Asset Usage Finder/Editor/Data/SearchTarget.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f500aea056165bb4294b484f1c9623d3
|
||||
timeCreated: 1467656394
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
266
Assets/Asset Usage Finder/Editor/DependencyWindow.cs
Normal file
266
Assets/Asset Usage Finder/Editor/DependencyWindow.cs
Normal file
@@ -0,0 +1,266 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.SceneManagement;
|
||||
using Object = UnityEngine.Object;
|
||||
using System.Linq;
|
||||
using AssetUsageFinder.Styles;
|
||||
using UnityEditor.SceneManagement;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
class DependencyWindow : EditorWindow {
|
||||
Vector2 _scrollPos;
|
||||
[SerializeField] DependencyAbstractFinder _data;
|
||||
[SerializeField] protected FindModeEnum _findMode;
|
||||
bool _expandFiles = true;
|
||||
bool _expandScenes = true;
|
||||
static GUIContent _sceneIcon;
|
||||
Rect _popupButtonRect;
|
||||
PrevClick _click;
|
||||
List<Action> _postponedActions;
|
||||
|
||||
[Serializable]
|
||||
public class Style {
|
||||
public ContentStylePair LookupBtn = new ContentStylePair();
|
||||
public GUIStyle TabBreadcrumb0 = new GUIStyle();
|
||||
public GUIStyle TabBreadcrumb1 = new GUIStyle();
|
||||
public GUIStyle RowMainAssetBtn = new GUIStyle();
|
||||
public Vector2 Size = new Vector2(250f, 800f);
|
||||
public GUIStyle RowLabel = new GUIStyle();
|
||||
|
||||
public static Style FindSelf() {
|
||||
var res = AufUtils.FirstOfType<WindowStyleAsset>();
|
||||
return EditorGUIUtility.isProSkin ? res.Pro : res.Personal;
|
||||
}
|
||||
}
|
||||
|
||||
public static Style StyleInstance => Globals<Style>.GetOrCreate(Style.FindSelf);
|
||||
|
||||
void OnEnable() {
|
||||
_postponedActions = new List<Action>();
|
||||
}
|
||||
|
||||
void BreadCrumbs() {
|
||||
var parents = _data.Parents();
|
||||
parents.Reverse();
|
||||
var w = 0f;
|
||||
{
|
||||
using (new EditorGUILayout.VerticalScope()) {
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
for (var i = 0; i < parents.Count; i++) {
|
||||
var parent = parents[i];
|
||||
var style = i == 0 ? StyleInstance.TabBreadcrumb0 : StyleInstance.TabBreadcrumb1;
|
||||
|
||||
var styleWidth = style.CalcSize(parent.TabContent).x;
|
||||
if (w > EditorGUIUtility.currentViewWidth - styleWidth) {
|
||||
w = 0f;
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
}
|
||||
|
||||
w += styleWidth;
|
||||
|
||||
if (i == parents.Count - 1) {
|
||||
var res = GUILayout.Toggle(true, parent.TabContent, style);
|
||||
if (!res)
|
||||
EditorGUIUtility.PingObject(parent.Target.Target);
|
||||
}
|
||||
else if (GUILayout.Button(parent.TabContent, style)) {
|
||||
EditorGUIUtility.PingObject(parent.Target.Target);
|
||||
_postponedActions.Add(() => { Init(parent); });
|
||||
}
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Update() {
|
||||
if (!_postponedActions.Any()) return;
|
||||
foreach (var a in _postponedActions)
|
||||
a();
|
||||
_postponedActions.Clear();
|
||||
}
|
||||
|
||||
void OnGUI() {
|
||||
if (_postponedActions == null || _data == null || (Event.current != null && Event.current.keyCode == KeyCode.Escape)) {
|
||||
_postponedActions = new List<Action>();
|
||||
_postponedActions.Add(() => Close());
|
||||
return;
|
||||
}
|
||||
|
||||
EditorGUILayout.BeginVertical();
|
||||
{
|
||||
BreadCrumbs();
|
||||
_scrollPos = EditorGUILayout.BeginScrollView(_scrollPos);
|
||||
{
|
||||
EditorGUILayout.Space();
|
||||
ShowDependencies(_data.Dependencies);
|
||||
}
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
EditorGUILayout.EndVertical();
|
||||
EditorGUILayout.Space();
|
||||
Footer();
|
||||
}
|
||||
|
||||
void Footer() {
|
||||
if (Event.current.type != EventType.Repaint) return;
|
||||
_popupButtonRect = GUILayoutUtility.GetLastRect();
|
||||
_popupButtonRect.position += position.position;
|
||||
}
|
||||
|
||||
public void Init(DependencyAbstractFinder d) {
|
||||
_data = d;
|
||||
// _labelMaxWidth = CalculateContentMaxWidth(EditorStyles.label, _data.Dependencies.SelectMany(dd => dd.Properties.Select(p => p.Content)));
|
||||
|
||||
// var t = new[] {_data.Target.Root};
|
||||
// if (_data.Target.Nested.TryGet(out var nested))
|
||||
|
||||
titleContent = new GUIContent($"{FindMode.GetWindowTitleByFindMode(_findMode)}");
|
||||
titleContent.tooltip = _data.Title;
|
||||
}
|
||||
|
||||
void ShowDependencies(ResultRow[] dependencies) {
|
||||
var nDeps = dependencies.Count();
|
||||
_expandFiles = EditorGUILayout.Foldout(_expandFiles, $"{FindMode.GetContentByFindMode(_findMode)}: [{nDeps}]");
|
||||
|
||||
if (_findMode == FindModeEnum.File) {
|
||||
if (_data.Target.Scene.IsValid() && !_data.Target.Scene.isLoaded)
|
||||
return;
|
||||
}
|
||||
|
||||
if (_expandFiles) {
|
||||
if (nDeps > 0) {
|
||||
foreach (var dependency in dependencies)
|
||||
if (dependency != null && dependency.SerializedObject != null && dependency.SerializedObject.targetObject != null)
|
||||
DrawRow(dependency);
|
||||
else
|
||||
this.Close();
|
||||
}
|
||||
else {
|
||||
EditorGUILayout.LabelField("No file dependencies found.");
|
||||
}
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
var fileDep = _data as FileDependencyFinder;
|
||||
|
||||
if (fileDep == null)
|
||||
return;
|
||||
|
||||
if (fileDep.ScenePaths == null) {
|
||||
fileDep.ScenePaths = DependencyFinderEngine.GetScenesThatContain(_data.Target.Target)
|
||||
.Select(p => new FileDependencyFinder.Pair {Path = p, NicifiedPath = p.Replace("Assets/", string.Empty)}).ToArray();
|
||||
}
|
||||
|
||||
var nScenes = fileDep.ScenePaths.Count();
|
||||
_expandScenes = EditorGUILayout.Foldout(_expandScenes, $"In Scenes: [{nScenes}]");
|
||||
|
||||
if (!_expandScenes) return;
|
||||
if (nScenes > 0) {
|
||||
foreach (var p in fileDep.ScenePaths) {
|
||||
using (new EditorGUILayout.HorizontalScope()) {
|
||||
SceneIcon.text = p.NicifiedPath;
|
||||
|
||||
if (GUILayout.Button(SceneIcon, EditorStyles.label, GUILayout.Height(16f), GUILayout.MaxWidth(20f + p.NicifiedPath.Length * 7f)))
|
||||
EditorGUIUtility.PingObject(AssetDatabase.LoadAssetAtPath<SceneAsset>(p.Path));
|
||||
|
||||
if (!GUILayout.Button("Open scene & search"))
|
||||
continue;
|
||||
|
||||
var sceneToOpen = SceneManager.GetSceneByPath(p.Path);
|
||||
if (sceneToOpen.isLoaded) {
|
||||
GuiManager.OpenSceneWindow(_data.Target.Target, p.Path);
|
||||
}
|
||||
else {
|
||||
var currentScene = EditorSceneManager.GetActiveScene();
|
||||
|
||||
if (currentScene.isDirty && EditorUtility.DisplayDialog(
|
||||
$"Unsaved changes",
|
||||
$"You are going to open and search in scene [{p.Path}]\n" +
|
||||
$"but you have unsaved changes at the scene [{currentScene.name}]",
|
||||
$"Stay at current scene and cancel search", $"Discard changes and search"))
|
||||
return;
|
||||
|
||||
EditorSceneManager.OpenScene(p.Path);
|
||||
GuiManager.OpenSceneWindow(_data.Target.Target, p.Path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
EditorGUILayout.LabelField("No scene dependencies found.");
|
||||
}
|
||||
}
|
||||
|
||||
struct PrevClick {
|
||||
Object _target;
|
||||
float _timeClicked;
|
||||
|
||||
public PrevClick(Object target) {
|
||||
_target = target;
|
||||
_timeClicked = Time.realtimeSinceStartup;
|
||||
}
|
||||
|
||||
const float DoubleClickTime = 0.5f;
|
||||
|
||||
public bool IsDoubleClick(Object o) {
|
||||
return _target == o && Time.realtimeSinceStartup - _timeClicked < DoubleClickTime;
|
||||
}
|
||||
}
|
||||
|
||||
void DrawRow(ResultRow dependency) {
|
||||
var id = dependency.Main.GetInstanceID();
|
||||
|
||||
using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox)) {
|
||||
using (new EditorGUILayout.HorizontalScope()) {
|
||||
if (GUILayout.Button(dependency.LabelContent, StyleInstance.RowMainAssetBtn)) {
|
||||
if (_click.IsDoubleClick(dependency.Main))
|
||||
Selection.activeObject = dependency.Main;
|
||||
else {
|
||||
EditorGUIUtility.PingObject(dependency.Main);
|
||||
}
|
||||
|
||||
_click = new PrevClick(dependency.Main);
|
||||
}
|
||||
|
||||
if (GUILayout.Button(StyleInstance.LookupBtn.Content, StyleInstance.LookupBtn.Style)) {
|
||||
_postponedActions.Add(() =>
|
||||
Init(_data.Nest(dependency.Main)));
|
||||
}
|
||||
}
|
||||
|
||||
dependency.SerializedObject.Update();
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
|
||||
if (dependency.Target) {
|
||||
foreach (var prop in dependency.Properties) {
|
||||
using (new EditorGUILayout.HorizontalScope()) {
|
||||
var locked = prop.Property.objectReferenceValue is MonoScript;
|
||||
var f = GUI.enabled;
|
||||
|
||||
if (locked) GUI.enabled = false;
|
||||
|
||||
EditorGUILayout.LabelField(prop.Content, StyleInstance.RowLabel, GUILayout.MaxWidth(this.position.width *.8f));
|
||||
EditorGUILayout.PropertyField(prop.Property, GUIContent.none, true, GUILayout.MinWidth(this.position.width *.2f));
|
||||
|
||||
if (locked) GUI.enabled = f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
dependency.SerializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
|
||||
static GUIContent SceneIcon {
|
||||
get { return _sceneIcon ?? (_sceneIcon = new GUIContent(AssetPreview.GetMiniTypeThumbnail(typeof(SceneAsset)))); }
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/Asset Usage Finder/Editor/DependencyWindow.cs.meta
Normal file
12
Assets/Asset Usage Finder/Editor/DependencyWindow.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bcd1862681e4b684abaa15975a54cecf
|
||||
timeCreated: 1464887183
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
7
Assets/Asset Usage Finder/Editor/FileDependencyWindow.cs
Normal file
7
Assets/Asset Usage Finder/Editor/FileDependencyWindow.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace AssetUsageFinder {
|
||||
class FileDependencyWindow : DependencyWindow {
|
||||
public FileDependencyWindow() {
|
||||
_findMode = FindModeEnum.File;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 227b60af61a13ef46ae80267f1a7626e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
42
Assets/Asset Usage Finder/Editor/FindModeEnum.cs
Normal file
42
Assets/Asset Usage Finder/Editor/FindModeEnum.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
public enum FindModeEnum {
|
||||
Unknown = 0,
|
||||
File = 1,
|
||||
Scene = 2,
|
||||
Stage = 3
|
||||
}
|
||||
|
||||
public static class FindMode {
|
||||
public static string GetWindowTitleByFindMode(FindModeEnum findMode) {
|
||||
switch (findMode) {
|
||||
case FindModeEnum.File:
|
||||
return "Usages in Project";
|
||||
case FindModeEnum.Scene:
|
||||
return "Usages in Scene";
|
||||
case FindModeEnum.Stage:
|
||||
return "Usages in Stage";
|
||||
default:
|
||||
return "Unknown Title!";
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetContentByFindMode(FindModeEnum findMode) {
|
||||
switch (findMode) {
|
||||
case FindModeEnum.File:
|
||||
return "In Project Files";
|
||||
case FindModeEnum.Scene:
|
||||
return "In Current Scene";
|
||||
case FindModeEnum.Stage:
|
||||
return "In Current Stage";
|
||||
default:
|
||||
return "Unknown Content!";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Asset Usage Finder/Editor/FindModeEnum.cs.meta
Normal file
11
Assets/Asset Usage Finder/Editor/FindModeEnum.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fef0947ab998ac34f8ab0f1e2eae5d37
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
169
Assets/Asset Usage Finder/Editor/GuiManager.cs
Normal file
169
Assets/Asset Usage Finder/Editor/GuiManager.cs
Normal file
@@ -0,0 +1,169 @@
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
[InitializeOnLoad]
|
||||
public class GuiManager : UnityEditor.AssetModificationProcessor {
|
||||
static string _version = "v4.0";
|
||||
|
||||
static GuiManager() {
|
||||
EditorSceneManager.sceneSaved += OnSceneSaved;
|
||||
}
|
||||
|
||||
static void OnSceneSaved(Scene scene) { }
|
||||
|
||||
public static string[] OnWillSaveAssets(string[] paths) {
|
||||
return paths;
|
||||
}
|
||||
|
||||
|
||||
static void InitCache() {
|
||||
Globals<CacheManager>.GetOrCreate(() => {
|
||||
var res = new CacheManager();
|
||||
res.Init();
|
||||
return res;
|
||||
});
|
||||
}
|
||||
|
||||
#region Menu
|
||||
|
||||
[MenuItem("Assets/− Find Usages in Project", false, 30)]
|
||||
static void FileMenu(MenuCommand command) {
|
||||
InitCache();
|
||||
|
||||
var continueFinding = DoYouWantToSaveScene();
|
||||
if (!continueFinding) return;
|
||||
|
||||
var pickupMessage = $"Please pick up a file from the project!";
|
||||
|
||||
var selected = Selection.activeObject;
|
||||
if (selected == null) return;
|
||||
|
||||
var type = selected.GetType();
|
||||
|
||||
if (selected == null ||
|
||||
type == typeof(DefaultAsset) ||
|
||||
type == typeof(SceneAsset)) {
|
||||
EditorUtility.DisplayDialog($"{_version}", $"{pickupMessage}", "Ok");
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == typeof(GameObject)) {
|
||||
var prefabProperties = PrefabUtilities.GetPrefabProperties(Selection.activeObject as GameObject);
|
||||
if (prefabProperties.IsPartOfStage || prefabProperties.IsSceneObject) {
|
||||
EditorUtility.DisplayDialog($"{_version}", $"{pickupMessage}", "Ok");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
EditorApplication.ExecuteMenuItem("File/Save Project");
|
||||
OpenFileWindow(selected);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
[MenuItem("GameObject/− Find Usages in Scene && Stage", false, -1)]
|
||||
public static void SceneOrStageMenu(MenuCommand data) {
|
||||
InitCache();
|
||||
|
||||
var message = $"Please pick up an object from the scene && stage!";
|
||||
|
||||
var selected = Selection.activeObject;
|
||||
if (selected == null) return;
|
||||
|
||||
if (selected == null || !(selected is GameObject)) {
|
||||
EditorUtility.DisplayDialog($"{_version}", $"{message}", "Ok");
|
||||
return;
|
||||
}
|
||||
|
||||
var continueFinding = DoYouWantToSaveScene();
|
||||
if (!continueFinding) return;
|
||||
|
||||
var prefabProperties = PrefabUtilities.GetPrefabProperties(Selection.activeObject as GameObject);
|
||||
|
||||
if (prefabProperties.IsPartOfStage) {
|
||||
OpenStageWindow(selected, prefabProperties.Path);
|
||||
}
|
||||
else if (prefabProperties.IsSceneObject) {
|
||||
OpenSceneWindow(selected, SceneManager.GetActiveScene().path);
|
||||
}
|
||||
else {
|
||||
EditorUtility.DisplayDialog($"{_version}", $"{message}", "Ok");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("CONTEXT/Component/− Find Usages of Component", false, 159)]
|
||||
public static void FindReferencesToComponent(MenuCommand data) {
|
||||
InitCache();
|
||||
|
||||
Object selected = data.context;
|
||||
if (!selected) return;
|
||||
|
||||
var continueFinding = DoYouWantToSaveScene();
|
||||
if (!continueFinding) return;
|
||||
|
||||
var scenePath = SceneManager.GetActiveScene().path;
|
||||
|
||||
OpenSceneWindow(selected, scenePath);
|
||||
}
|
||||
|
||||
static bool DoYouWantToSaveScene() {
|
||||
var scene = SceneManager.GetActiveScene();
|
||||
if (scene.isDirty || string.IsNullOrEmpty(scene.path)) {
|
||||
var response = EditorUtility.DisplayDialogComplex(
|
||||
title: "Asset Usage Finder v4.0",
|
||||
message: "Current scene is not saved yet!",
|
||||
ok: "Save scene and find usages",
|
||||
cancel: "Cancel usage finding",
|
||||
alt: "Find without saving");
|
||||
switch (response) {
|
||||
case 0: // ok
|
||||
EditorApplication.ExecuteMenuItem("File/Save");
|
||||
return true;
|
||||
case 1: // cancel
|
||||
return false;
|
||||
case 2: // find without saving
|
||||
return true;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion Menu
|
||||
|
||||
#region InitWindow
|
||||
|
||||
static void OpenFileWindow(Object selected) {
|
||||
var finder = new FileDependencyFinder(selected);
|
||||
|
||||
var window = ScriptableObject.CreateInstance<FileDependencyWindow>();
|
||||
window.Init(finder);
|
||||
var p = window.position;
|
||||
p.size = DependencyWindow.StyleInstance.Size;
|
||||
window.position = p;
|
||||
window.Show();
|
||||
}
|
||||
|
||||
public static void OpenSceneWindow(Object target, string scenePath) {
|
||||
var finder = new InSceneDependencyFinder(target, scenePath);
|
||||
var window = ScriptableObject.CreateInstance<SceneDependencyWindow>();
|
||||
window.Init(finder);
|
||||
window.Show();
|
||||
}
|
||||
|
||||
static void OpenStageWindow(Object target, string stagePath) {
|
||||
var finder = new InStageDependencyFinder(target, stagePath);
|
||||
var window = ScriptableObject.CreateInstance<StageDependencyWindow>();
|
||||
window.Init(finder);
|
||||
window.Show();
|
||||
}
|
||||
|
||||
#endregion InitWindow
|
||||
}
|
||||
}
|
||||
11
Assets/Asset Usage Finder/Editor/GuiManager.cs.meta
Normal file
11
Assets/Asset Usage Finder/Editor/GuiManager.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65b7b313ed4025e4bbdf4f16a5d423de
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
133
Assets/Asset Usage Finder/Editor/Option.cs
Normal file
133
Assets/Asset Usage Finder/Editor/Option.cs
Normal file
@@ -0,0 +1,133 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
public static class Option {
|
||||
public static Option<T> Some<T>(T value) => new Option<T>(value, true);
|
||||
public static Option<T> None<T>() => new Option<T>(default, false);
|
||||
|
||||
public static bool IsNotNull<T>(T t) {
|
||||
return Option<T>.IsValueType || t != null;
|
||||
}
|
||||
}
|
||||
|
||||
public struct Option<T> : IEquatable<Option<T>>, IComparable<Option<T>> {
|
||||
// ReSharper disable once StaticMemberInGenericType
|
||||
internal static readonly bool IsValueType;
|
||||
|
||||
public bool HasValue { get; }
|
||||
|
||||
T Value { get; }
|
||||
|
||||
public static implicit operator Option<T>(T arg) {
|
||||
if (!IsValueType) return ReferenceEquals(arg, null) ? new Option<T>() : Option.Some(arg);
|
||||
#if M_WARN
|
||||
if (arg.Equals(default(T)))
|
||||
Warn.Warning($"{arg} has default value");
|
||||
#endif
|
||||
return Option.Some(arg);
|
||||
}
|
||||
|
||||
static Option() {
|
||||
IsValueType = typeof(T).IsValueType;
|
||||
}
|
||||
|
||||
public void GetOrFail(out T value) {
|
||||
if (!TryGet(out value))
|
||||
Fail($"Option<{typeof(T).Name}> has no value");
|
||||
}
|
||||
|
||||
public T GetOrFail() {
|
||||
if (!TryGet(out var value))
|
||||
Fail($"Option<{typeof(T).Name}> has no value");
|
||||
return value;
|
||||
}
|
||||
|
||||
[Conditional("DEBUG1")]
|
||||
static void Fail(string format = null) {
|
||||
throw new Exception(format);
|
||||
}
|
||||
|
||||
public bool TryGet(out T value) {
|
||||
if (!HasValue) {
|
||||
value = default(T);
|
||||
return false;
|
||||
}
|
||||
|
||||
value = Value;
|
||||
return true;
|
||||
}
|
||||
|
||||
internal Option(T value, bool hasValue) {
|
||||
Value = value;
|
||||
HasValue = hasValue;
|
||||
}
|
||||
|
||||
public T ValueOr(T alternative) {
|
||||
return HasValue ? Value : alternative;
|
||||
}
|
||||
|
||||
// for debug purposes
|
||||
public override string ToString() {
|
||||
if (!HasValue) return "None";
|
||||
|
||||
return Value == null ? "Some(null)" : $"Some({Value})";
|
||||
}
|
||||
|
||||
#region eq comparers boilerplate
|
||||
|
||||
public bool Equals(Option<T> other) {
|
||||
if (!HasValue && !other.HasValue)
|
||||
return true;
|
||||
|
||||
if (HasValue && other.HasValue)
|
||||
return EqualityComparer<T>.Default.Equals(Value, other.Value);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj) {
|
||||
return obj is Option<T> && Equals((Option<T>) obj);
|
||||
}
|
||||
|
||||
public static bool operator ==(Option<T> left, Option<T> right) {
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator !=(Option<T> left, Option<T> right) {
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
if (!HasValue) return 0;
|
||||
|
||||
return Option.IsNotNull(Value) ? Value.GetHashCode() : 1;
|
||||
}
|
||||
|
||||
public int CompareTo(Option<T> other) {
|
||||
if (HasValue && !other.HasValue) return 1;
|
||||
if (!HasValue && other.HasValue) return -1;
|
||||
|
||||
return Comparer<T>.Default.Compare(Value, other.Value);
|
||||
}
|
||||
|
||||
public static bool operator <(Option<T> left, Option<T> right) {
|
||||
return left.CompareTo(right) < 0;
|
||||
}
|
||||
|
||||
public static bool operator <=(Option<T> left, Option<T> right) {
|
||||
return left.CompareTo(right) <= 0;
|
||||
}
|
||||
|
||||
public static bool operator >(Option<T> left, Option<T> right) {
|
||||
return left.CompareTo(right) > 0;
|
||||
}
|
||||
|
||||
public static bool operator >=(Option<T> left, Option<T> right) {
|
||||
return left.CompareTo(right) >= 0;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
3
Assets/Asset Usage Finder/Editor/Option.cs.meta
Normal file
3
Assets/Asset Usage Finder/Editor/Option.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae4b8392ac17499b9840c83d49357e45
|
||||
timeCreated: 1591797332
|
||||
85
Assets/Asset Usage Finder/Editor/PrefabUtilities.cs
Normal file
85
Assets/Asset Usage Finder/Editor/PrefabUtilities.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
#if UNITY_2018_3_OR_NEWER
|
||||
using UnityEditor;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace AssetUsageFinder {
|
||||
public static class PrefabUtilities {
|
||||
public class PrefabProperties {
|
||||
public bool IsPartOfStage;
|
||||
public bool IsStageRoot;
|
||||
public bool IsPartOfInstance;
|
||||
public bool IsInstanceRoot;
|
||||
public GameObject NearestInstanceRoot;
|
||||
public bool IsAssetRoot;
|
||||
public bool IsPartOfPrefabAsset;
|
||||
public string Path;
|
||||
public GameObject PrefabAssetRoot;
|
||||
|
||||
public bool IsSceneObject => (!IsPartOfPrefabAsset && !IsPartOfStage);
|
||||
public bool IsPartOfAnyPrefab => Path != null;
|
||||
public bool IsRootOfAnyPrefab => IsAssetRoot || IsInstanceRoot || IsStageRoot;
|
||||
}
|
||||
|
||||
public static PrefabProperties GetPrefabProperties (GameObject gameObject) {
|
||||
var p = new PrefabProperties ();
|
||||
|
||||
p.IsPartOfPrefabAsset = PrefabUtility.IsPartOfPrefabAsset (gameObject);
|
||||
|
||||
if (!p.IsPartOfPrefabAsset)
|
||||
p.IsPartOfPrefabAsset = !string.IsNullOrEmpty (AssetDatabase.GetAssetPath (gameObject));
|
||||
|
||||
GameObject nerestInstanceRoot = p.NearestInstanceRoot = PrefabUtility.GetNearestPrefabInstanceRoot (gameObject);
|
||||
p.IsPartOfInstance = (nerestInstanceRoot != null);
|
||||
p.IsInstanceRoot = (gameObject == nerestInstanceRoot);
|
||||
|
||||
if (p.IsPartOfPrefabAsset) {
|
||||
p.PrefabAssetRoot = gameObject.transform.root.gameObject;
|
||||
p.IsAssetRoot = (gameObject == p.PrefabAssetRoot);
|
||||
}
|
||||
|
||||
var editorPrefabStage = UnityEditor.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage ();
|
||||
if (editorPrefabStage != null) {
|
||||
if (p.IsPartOfPrefabAsset == false)
|
||||
p.IsPartOfStage = true;
|
||||
|
||||
if (p.IsPartOfStage && gameObject.transform.parent == null)
|
||||
p.IsStageRoot = true;
|
||||
}
|
||||
|
||||
if (p.IsRootOfAnyPrefab) {
|
||||
if (p.IsStageRoot) {
|
||||
p.Path = GetPath ();
|
||||
}
|
||||
else if (p.IsInstanceRoot) {
|
||||
p.Path = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot (gameObject);
|
||||
}
|
||||
else if (p.IsAssetRoot) {
|
||||
p.Path = AssetDatabase.GetAssetPath (gameObject);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (p.IsPartOfStage) {
|
||||
p.Path = GetPath ();
|
||||
}
|
||||
else if (p.IsPartOfInstance) {
|
||||
p.Path = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot (p.NearestInstanceRoot);
|
||||
}
|
||||
else if (p.IsPartOfPrefabAsset) {
|
||||
p.Path = AssetDatabase.GetAssetPath (gameObject.transform.root.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
return p;
|
||||
|
||||
string GetPath () {
|
||||
#if UNITY_2020_1_OR_NEWER
|
||||
return editorPrefabStage.assetPath;
|
||||
#else
|
||||
return editorPrefabStage.prefabAssetPath;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
11
Assets/Asset Usage Finder/Editor/PrefabUtilities.cs.meta
Normal file
11
Assets/Asset Usage Finder/Editor/PrefabUtilities.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40e15ba4381bc524f9aa96a02e671466
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace AssetUsageFinder {
|
||||
class SceneDependencyWindow : DependencyWindow {
|
||||
public SceneDependencyWindow() {
|
||||
_findMode = FindModeEnum.Scene;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6fa5c0e12d3f2d4eaeda43544061720
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace AssetUsageFinder {
|
||||
class StageDependencyWindow : DependencyWindow {
|
||||
public StageDependencyWindow() {
|
||||
_findMode = FindModeEnum.Stage;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e4dcf69ebb96d694883ee0b402596bb2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/Asset Usage Finder/Editor/Styles.meta
Normal file
9
Assets/Asset Usage Finder/Editor/Styles.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 479a256622980e149b2c447e4d2939fb
|
||||
folderAsset: yes
|
||||
timeCreated: 1470315057
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
10
Assets/Asset Usage Finder/Editor/Styles/ContentStylePair.cs
Normal file
10
Assets/Asset Usage Finder/Editor/Styles/ContentStylePair.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AssetUsageFinder.Styles {
|
||||
[Serializable]
|
||||
class ContentStylePair {
|
||||
public GUIContent Content = new GUIContent();
|
||||
public GUIStyle Style = new GUIStyle();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d89a773ebe3631a45968846ae15ffe67
|
||||
timeCreated: 1467636613
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
26
Assets/Asset Usage Finder/Editor/Styles/WindowStyleAsset.cs
Normal file
26
Assets/Asset Usage Finder/Editor/Styles/WindowStyleAsset.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using UnityEditor;
|
||||
using UnityEditorInternal;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AssetUsageFinder.Styles {
|
||||
class WindowStyleAsset : ScriptableObject {
|
||||
#pragma warning disable 0649
|
||||
public DependencyWindow.Style Pro;
|
||||
public DependencyWindow.Style Personal;
|
||||
#pragma warning restore
|
||||
|
||||
#if !false
|
||||
[CustomEditor(typeof (WindowStyleAsset))]
|
||||
class Editor : UnityEditor.Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
EditorGUI.BeginChangeCheck();
|
||||
base.OnInspectorGUI();
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
InternalEditorUtility.RepaintAllViews();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a8038d7a393d814b887bec61ad77979
|
||||
timeCreated: 1467571260
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
17
Assets/Asset Usage Finder/readme.txt
Normal file
17
Assets/Asset Usage Finder/readme.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
Asset Usage Finder v4.16
|
||||
|
||||
Importing new version of an asset:
|
||||
1) Delete an old version of the product - Assets/DependencyPro folder
|
||||
2) Import from Asset Store to Assets folder
|
||||
|
||||
IMPORTANT NOTICE:
|
||||
In order to initialize cache for a project, you need to:
|
||||
1) Run any usage search - File, Scene, Component
|
||||
2) Wait for it to finish. It will take 4x less time any search took in v2.0
|
||||
Benefits:
|
||||
- Every other search will take less than 2 seconds. On huge projects, it should take less than 5 seconds
|
||||
- Cache will be stored permanently and will be available after you close the project and turn off computer
|
||||
- In case of changes that were made after cache initialization, only those changes will be cached. So you don't need to wait for cacheing of whole project every time
|
||||
|
||||
FAQ:
|
||||
- https://docs.google.com/document/d/1RZA8Rf3QHdzTq6HFa7moA0G9W1uZjXOrSMJ25QwaNgk/edit?usp=sharing
|
||||
7
Assets/Asset Usage Finder/readme.txt.meta
Normal file
7
Assets/Asset Usage Finder/readme.txt.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63922495ab93f4e42ad5b30ddff568fc
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
54
Assets/FileLoad.cs
Normal file
54
Assets/FileLoad.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class FileLoad
|
||||
{
|
||||
public static string GetMoviesFolder()
|
||||
{
|
||||
string[] temp = null;
|
||||
#if UNITY_EDITOR
|
||||
temp = new string[1];
|
||||
// 获取项目根目录的AssetBundle文件夹路径
|
||||
string projectPath = Application.dataPath.Replace("/Assets", "");
|
||||
temp[0] = System.IO.Path.Combine(projectPath, "AssetBundle").Replace("\\", "/");
|
||||
#else
|
||||
temp = new string[1];
|
||||
temp[0] = GetObbPath();
|
||||
#endif
|
||||
return temp[0];
|
||||
}
|
||||
|
||||
public static string GetObbPath()
|
||||
{
|
||||
string obbPath = "";
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
// 在Android设备上运行时
|
||||
if (Application.platform == RuntimePlatform.Android)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 获取OBB路径
|
||||
using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
using (AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
using (AndroidJavaObject packageManager = currentActivity.Call<AndroidJavaObject>("getPackageManager"))
|
||||
{
|
||||
string packageName = currentActivity.Call<string>("getPackageName");
|
||||
|
||||
// 获取OBB路径
|
||||
AndroidJavaObject packageInfo = packageManager.Call<AndroidJavaObject>("getPackageInfo", packageName, 0);
|
||||
int versionCode = packageInfo.Get<int>("versionCode");
|
||||
string mainOBBPath = string.Format("/storage/emulated/0/Android/obb/{0}/", packageName);
|
||||
|
||||
obbPath = mainOBBPath;
|
||||
}
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Debug.LogError("获取OBB路径出错: " + e.Message);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return obbPath;
|
||||
}
|
||||
}
|
||||
11
Assets/FileLoad.cs.meta
Normal file
11
Assets/FileLoad.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 793a83ecf1484a347bd44cceacd73a78
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
21
Assets/FishNet.Config.XML
Normal file
21
Assets/FishNet.Config.XML
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ConfigurationData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Loaded>false</Loaded>
|
||||
<PrefabGenerator>
|
||||
<Enabled>false</Enabled>
|
||||
<LogToConsole>false</LogToConsole>
|
||||
<FullRebuild>false</FullRebuild>
|
||||
<SaveChanges>false</SaveChanges>
|
||||
<DefaultPrefabObjectsPath>Assets\DefaultPrefabObjects.asset</DefaultPrefabObjectsPath>
|
||||
<SearchScope>0</SearchScope>
|
||||
<ExcludedFolders />
|
||||
<IncludedFolders />
|
||||
</PrefabGenerator>
|
||||
<CodeStripping>
|
||||
<IsBuilding>false</IsBuilding>
|
||||
<IsDevelopment>false</IsDevelopment>
|
||||
<IsHeadless>false</IsHeadless>
|
||||
<StripReleaseBuilds>false</StripReleaseBuilds>
|
||||
<StrippingType>0</StrippingType>
|
||||
</CodeStripping>
|
||||
</ConfigurationData>
|
||||
7
Assets/FishNet.Config.XML.meta
Normal file
7
Assets/FishNet.Config.XML.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 263cb759cf031354b807a9228a6c73f1
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/SoraTools.meta
Normal file
8
Assets/SoraTools.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4db100b2a14f96141aec1ef45ef58c18
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/SoraTools/SceneAnalyzer.meta
Normal file
8
Assets/SoraTools/SceneAnalyzer.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7723cab0703e3a74b9e989289246b5c4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/SoraTools/SceneAnalyzer/Editor.meta
Normal file
8
Assets/SoraTools/SceneAnalyzer/Editor.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f45866dcd12dad3429179152a3985796
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
639
Assets/SoraTools/SceneAnalyzer/Editor/SceneAnalyzer.cs
Normal file
639
Assets/SoraTools/SceneAnalyzer/Editor/SceneAnalyzer.cs
Normal file
@@ -0,0 +1,639 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.SceneManagement;
|
||||
using System.Linq;
|
||||
using UnityEngine.Profiling;
|
||||
using System.Text;
|
||||
|
||||
namespace SoraTools
|
||||
{
|
||||
public class SceneAnalyzer : EditorWindow
|
||||
{
|
||||
private enum TargetDevice
|
||||
{
|
||||
Android_8G,
|
||||
Android_12G
|
||||
}
|
||||
|
||||
private TargetDevice currentTarget = TargetDevice.Android_8G;
|
||||
private Vector2 scrollPos;
|
||||
|
||||
// 分析结果缓存
|
||||
private bool hasAnalyzed = false;
|
||||
private AnalysisData currentData;
|
||||
|
||||
// GUI Styles
|
||||
private GUIStyle titleStyle;
|
||||
private GUIStyle headerStyle;
|
||||
private GUIStyle boxStyle;
|
||||
private GUIStyle resultGoodStyle;
|
||||
private GUIStyle resultWarnStyle;
|
||||
private GUIStyle resultBadStyle;
|
||||
private GUIStyle labelStyle;
|
||||
private GUIStyle linkStyle;
|
||||
|
||||
[MenuItem("SoraTools/Scene Analyzer %&r")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
var window = GetWindow<SceneAnalyzer>("Scene Analyzer");
|
||||
window.minSize = new Vector2(400, 600);
|
||||
window.Show();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
// 初始化样式
|
||||
InitStyles();
|
||||
}
|
||||
|
||||
private void InitStyles()
|
||||
{
|
||||
titleStyle = new GUIStyle(EditorStyles.boldLabel)
|
||||
{
|
||||
fontSize = 18,
|
||||
alignment = TextAnchor.MiddleCenter,
|
||||
margin = new RectOffset(0, 0, 10, 10)
|
||||
};
|
||||
|
||||
headerStyle = new GUIStyle(EditorStyles.boldLabel)
|
||||
{
|
||||
fontSize = 14,
|
||||
margin = new RectOffset(0, 0, 10, 5)
|
||||
};
|
||||
|
||||
boxStyle = new GUIStyle(EditorStyles.helpBox)
|
||||
{
|
||||
padding = new RectOffset(10, 10, 10, 10),
|
||||
margin = new RectOffset(5, 5, 5, 5)
|
||||
};
|
||||
|
||||
labelStyle = new GUIStyle(EditorStyles.label)
|
||||
{
|
||||
fontSize = 12,
|
||||
richText = true
|
||||
};
|
||||
|
||||
resultGoodStyle = new GUIStyle(EditorStyles.label) { normal = { textColor = new Color(0.2f, 0.8f, 0.2f) }, fontStyle = FontStyle.Bold };
|
||||
resultWarnStyle = new GUIStyle(EditorStyles.label) { normal = { textColor = new Color(0.9f, 0.7f, 0.0f) }, fontStyle = FontStyle.Bold };
|
||||
resultBadStyle = new GUIStyle(EditorStyles.label) { normal = { textColor = new Color(0.9f, 0.3f, 0.3f) }, fontStyle = FontStyle.Bold };
|
||||
|
||||
linkStyle = new GUIStyle(EditorStyles.label) {
|
||||
normal = { textColor = new Color(0.3f, 0.6f, 1.0f) },
|
||||
hover = { textColor = new Color(0.4f, 0.7f, 1.0f) },
|
||||
fontStyle = FontStyle.Italic
|
||||
};
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if (titleStyle == null) InitStyles();
|
||||
|
||||
EditorGUILayout.LabelField("场景性能分析工具", titleStyle);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
// 设置区域
|
||||
EditorGUILayout.BeginVertical(boxStyle);
|
||||
EditorGUILayout.LabelField("目标设备设置", headerStyle);
|
||||
currentTarget = (TargetDevice)EditorGUILayout.EnumPopup("目标设备内存", currentTarget);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
if (GUILayout.Button("开始分析当前场景", GUILayout.Height(40)))
|
||||
{
|
||||
AnalyzeScene();
|
||||
}
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
if (!hasAnalyzed || currentData == null)
|
||||
{
|
||||
EditorGUILayout.HelpBox("请点击上方按钮开始分析当前场景。", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
|
||||
// 结果展示区域
|
||||
EditorGUILayout.Space();
|
||||
scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
|
||||
|
||||
DrawSection("场景概览", () =>
|
||||
{
|
||||
DrawStatItem("GameObjects 总数", currentData.objectCount,
|
||||
GetThreshold(MetricType.ObjectCount).warning,
|
||||
GetThreshold(MetricType.ObjectCount).limit);
|
||||
|
||||
DrawStatItem("总顶点数 (Vertices)", currentData.totalVertices,
|
||||
GetThreshold(MetricType.Vertices).warning,
|
||||
GetThreshold(MetricType.Vertices).limit, FormatNumber);
|
||||
|
||||
DrawStatItem("总面数 (Triangles)", currentData.totalTriangles,
|
||||
GetThreshold(MetricType.Triangles).warning,
|
||||
GetThreshold(MetricType.Triangles).limit, FormatNumber);
|
||||
|
||||
DrawStatItem("非 Static 物体", currentData.nonStaticCount,
|
||||
500, 1000, null,
|
||||
"点击选中非Static物体", currentData.nonStaticObjects);
|
||||
|
||||
DrawStatItem("Missing Scripts", currentData.missingScriptCount,
|
||||
0, 0, null,
|
||||
"点击选中Missing Script物体", currentData.missingScriptObjects);
|
||||
});
|
||||
|
||||
DrawSection("灯光与渲染 (Lighting & Rendering)", () =>
|
||||
{
|
||||
DrawStatItem("实时光源 (Realtime Lights)", currentData.realtimeLightCount,
|
||||
GetThreshold(MetricType.RealtimeLights).warning,
|
||||
GetThreshold(MetricType.RealtimeLights).limit, null,
|
||||
"点击选中实时光源", currentData.realtimeLights);
|
||||
|
||||
DrawStatItem("阴影投射光源 (Shadow Casters)", currentData.shadowCastingLights,
|
||||
GetThreshold(MetricType.ShadowLights).warning,
|
||||
GetThreshold(MetricType.ShadowLights).limit, null,
|
||||
"点击选中阴影光源", currentData.shadowLights);
|
||||
|
||||
DrawStatItem("总光源数量 (All Lights)", currentData.totalLightCount,
|
||||
GetThreshold(MetricType.TotalLights).warning,
|
||||
GetThreshold(MetricType.TotalLights).limit);
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.LabelField("是否开启 Fog", GUILayout.Width(200));
|
||||
EditorGUILayout.LabelField(currentData.hasFog ? "开启 (可能有性能消耗)" : "关闭",
|
||||
currentData.hasFog ? resultWarnStyle : resultGoodStyle);
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
DrawStatItem("半透明物体 (Overdraw风险)", currentData.transparentObjectCount,
|
||||
GetThreshold(MetricType.TransparentObjects).warning,
|
||||
GetThreshold(MetricType.TransparentObjects).limit, null,
|
||||
"点击选中半透明物体", currentData.transparentObjects);
|
||||
});
|
||||
|
||||
DrawSection("动画与特效 (Animation & FX)", () =>
|
||||
{
|
||||
DrawStatItem("蒙皮网格 (Skinned Mesh)", currentData.skinnedMeshCount,
|
||||
GetThreshold(MetricType.SkinnedMesh).warning,
|
||||
GetThreshold(MetricType.SkinnedMesh).limit, null,
|
||||
"点击选中蒙皮网格", currentData.skinnedMeshes);
|
||||
|
||||
DrawStatItem("粒子系统 (Particle Systems)", currentData.particleSystemCount,
|
||||
GetThreshold(MetricType.ParticleSystems).warning,
|
||||
GetThreshold(MetricType.ParticleSystems).limit, null,
|
||||
"点击选中粒子系统", currentData.particleSystems);
|
||||
});
|
||||
|
||||
DrawSection("物理 (Physics)", () =>
|
||||
{
|
||||
DrawStatItem("复杂 MeshCollider", currentData.complexMeshColliderCount,
|
||||
0, 10, null,
|
||||
"点击选中复杂碰撞体", currentData.complexMeshColliders);
|
||||
});
|
||||
|
||||
DrawSection("内存占用 (估算)", () =>
|
||||
{
|
||||
DrawStatItem("纹理内存 (Texture)", currentData.textureMemory,
|
||||
GetThreshold(MetricType.TextureMem).warning,
|
||||
GetThreshold(MetricType.TextureMem).limit, FormatBytes,
|
||||
"查看 Top 10 纹理", null, () => ShowTopResourcesWindow("Top 10 Textures", currentData.topTextures));
|
||||
|
||||
DrawStatItem("网格内存 (Mesh)", currentData.meshMemory,
|
||||
GetThreshold(MetricType.MeshMem).warning,
|
||||
GetThreshold(MetricType.MeshMem).limit, FormatBytes,
|
||||
"查看 Top 10 网格", null, () => ShowTopResourcesWindow("Top 10 Meshes", currentData.topMeshes));
|
||||
|
||||
DrawStatItem("音频内存 (Audio)", currentData.audioMemory,
|
||||
GetThreshold(MetricType.AudioMem).warning,
|
||||
GetThreshold(MetricType.AudioMem).limit, FormatBytes);
|
||||
});
|
||||
|
||||
DrawSection("资源详情", () =>
|
||||
{
|
||||
DrawStatItem("独立纹理数量", currentData.uniqueTextureCount, 1000, 2000);
|
||||
DrawStatItem("独立材质数量", currentData.uniqueMaterialCount, 200, 500);
|
||||
DrawStatItem("独立网格数量", currentData.uniqueMeshCount, 500, 1000);
|
||||
});
|
||||
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
|
||||
private void AnalyzeScene()
|
||||
{
|
||||
EditorUtility.DisplayProgressBar("场景分析中", "正在收集场景对象...", 0.1f);
|
||||
|
||||
try
|
||||
{
|
||||
currentData = new AnalysisData();
|
||||
|
||||
var rootObjects = SceneManager.GetActiveScene().GetRootGameObjects();
|
||||
var allRenderers = new List<Renderer>();
|
||||
var allColliders = new List<Collider>();
|
||||
|
||||
// 递归收集所有对象
|
||||
int totalRoots = rootObjects.Length;
|
||||
for (int i = 0; i < totalRoots; i++)
|
||||
{
|
||||
var root = rootObjects[i];
|
||||
EditorUtility.DisplayProgressBar("场景分析中", $"正在分析对象: {root.name}", 0.1f + (float)i / totalRoots * 0.4f);
|
||||
|
||||
allRenderers.AddRange(root.GetComponentsInChildren<Renderer>(true));
|
||||
var colliders = root.GetComponentsInChildren<Collider>(true);
|
||||
allColliders.AddRange(colliders);
|
||||
|
||||
var transforms = root.GetComponentsInChildren<Transform>(true);
|
||||
currentData.objectCount += transforms.Length;
|
||||
|
||||
// 检查 Static Batching 和 Missing Scripts
|
||||
foreach (var t in transforms)
|
||||
{
|
||||
if (!t.gameObject.isStatic)
|
||||
{
|
||||
currentData.nonStaticCount++;
|
||||
currentData.nonStaticObjects.Add(t.gameObject);
|
||||
}
|
||||
|
||||
// 检查 Missing Scripts
|
||||
var components = t.GetComponents<Component>();
|
||||
foreach (var c in components)
|
||||
{
|
||||
if (c == null)
|
||||
{
|
||||
currentData.missingScriptCount++;
|
||||
currentData.missingScriptObjects.Add(t.gameObject);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 检查复杂 MeshCollider
|
||||
foreach(var col in colliders)
|
||||
{
|
||||
if(col is MeshCollider mc && !mc.convex)
|
||||
{
|
||||
currentData.complexMeshColliderCount++;
|
||||
currentData.complexMeshColliders.Add(col.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EditorUtility.DisplayProgressBar("场景分析中", "正在分析网格与材质...", 0.6f);
|
||||
|
||||
// 分析网格
|
||||
HashSet<Mesh> uniqueMeshes = new HashSet<Mesh>();
|
||||
List<ResourceInfo> meshInfos = new List<ResourceInfo>();
|
||||
|
||||
foreach (var renderer in allRenderers)
|
||||
{
|
||||
Mesh mesh = null;
|
||||
if (renderer is MeshRenderer)
|
||||
{
|
||||
var filter = renderer.GetComponent<MeshFilter>();
|
||||
if (filter != null) mesh = filter.sharedMesh;
|
||||
}
|
||||
else if (renderer is SkinnedMeshRenderer smr)
|
||||
{
|
||||
mesh = smr.sharedMesh;
|
||||
currentData.skinnedMeshCount++;
|
||||
currentData.skinnedMeshes.Add(smr.gameObject);
|
||||
}
|
||||
|
||||
if (mesh != null)
|
||||
{
|
||||
currentData.totalVertices += mesh.vertexCount;
|
||||
currentData.totalTriangles += mesh.triangles.Length / 3;
|
||||
|
||||
if (uniqueMeshes.Add(mesh))
|
||||
{
|
||||
long mem = Profiler.GetRuntimeMemorySizeLong(mesh);
|
||||
currentData.meshMemory += mem;
|
||||
meshInfos.Add(new ResourceInfo { name = mesh.name, size = mem, obj = mesh });
|
||||
}
|
||||
}
|
||||
|
||||
// 检查半透明物体
|
||||
foreach(var mat in renderer.sharedMaterials)
|
||||
{
|
||||
if (mat != null && (mat.renderQueue >= 2500 || mat.FindPass("Transparent") >= 0 || mat.GetTag("RenderType", false) == "Transparent"))
|
||||
{
|
||||
currentData.transparentObjectCount++;
|
||||
currentData.transparentObjects.Add(renderer.gameObject);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
currentData.uniqueMeshCount = uniqueMeshes.Count;
|
||||
currentData.topMeshes = meshInfos.OrderByDescending(x => x.size).Take(10).ToList();
|
||||
|
||||
// 分析材质和纹理
|
||||
HashSet<Material> uniqueMaterials = new HashSet<Material>();
|
||||
HashSet<Texture> uniqueTextures = new HashSet<Texture>();
|
||||
List<ResourceInfo> textureInfos = new List<ResourceInfo>();
|
||||
|
||||
foreach (var renderer in allRenderers)
|
||||
{
|
||||
foreach (var mat in renderer.sharedMaterials)
|
||||
{
|
||||
if (mat != null && uniqueMaterials.Add(mat))
|
||||
{
|
||||
var shader = mat.shader;
|
||||
int propertyCount = ShaderUtil.GetPropertyCount(shader);
|
||||
for (int i = 0; i < propertyCount; i++)
|
||||
{
|
||||
if (ShaderUtil.GetPropertyType(shader, i) == ShaderUtil.ShaderPropertyType.TexEnv)
|
||||
{
|
||||
string propertyName = ShaderUtil.GetPropertyName(shader, i);
|
||||
Texture tex = mat.GetTexture(propertyName);
|
||||
if (tex != null)
|
||||
{
|
||||
uniqueTextures.Add(tex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
currentData.uniqueMaterialCount = uniqueMaterials.Count;
|
||||
currentData.uniqueTextureCount = uniqueTextures.Count;
|
||||
|
||||
foreach (var tex in uniqueTextures)
|
||||
{
|
||||
long mem = Profiler.GetRuntimeMemorySizeLong(tex);
|
||||
currentData.textureMemory += mem;
|
||||
textureInfos.Add(new ResourceInfo { name = tex.name, size = mem, obj = tex });
|
||||
}
|
||||
currentData.topTextures = textureInfos.OrderByDescending(x => x.size).Take(10).ToList();
|
||||
|
||||
EditorUtility.DisplayProgressBar("场景分析中", "正在分析音频与灯光...", 0.8f);
|
||||
|
||||
// 分析音频
|
||||
var audioSources = Resources.FindObjectsOfTypeAll<AudioSource>();
|
||||
HashSet<AudioClip> uniqueClips = new HashSet<AudioClip>();
|
||||
foreach(var root in rootObjects)
|
||||
{
|
||||
var sources = root.GetComponentsInChildren<AudioSource>(true);
|
||||
foreach(var source in sources)
|
||||
{
|
||||
if(source.clip != null) uniqueClips.Add(source.clip);
|
||||
}
|
||||
}
|
||||
|
||||
foreach(var clip in uniqueClips)
|
||||
{
|
||||
currentData.audioMemory += Profiler.GetRuntimeMemorySizeLong(clip);
|
||||
}
|
||||
|
||||
// 分析灯光
|
||||
var lights = Object.FindObjectsOfType<Light>();
|
||||
currentData.totalLightCount = lights.Length;
|
||||
foreach (var light in lights)
|
||||
{
|
||||
if (light.lightmapBakeType == LightmapBakeType.Realtime || light.lightmapBakeType == LightmapBakeType.Mixed)
|
||||
{
|
||||
currentData.realtimeLightCount++;
|
||||
currentData.realtimeLights.Add(light.gameObject);
|
||||
}
|
||||
if (light.shadows != LightShadows.None)
|
||||
{
|
||||
currentData.shadowCastingLights++;
|
||||
currentData.shadowLights.Add(light.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
// 分析粒子系统
|
||||
var particles = Object.FindObjectsOfType<ParticleSystem>();
|
||||
currentData.particleSystemCount = particles.Length;
|
||||
foreach(var ps in particles)
|
||||
{
|
||||
currentData.particleSystems.Add(ps.gameObject);
|
||||
}
|
||||
|
||||
// 分析 RenderSettings
|
||||
currentData.hasFog = RenderSettings.fog;
|
||||
|
||||
hasAnalyzed = true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
EditorUtility.ClearProgressBar();
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowTopResourcesWindow(string title, List<ResourceInfo> resources)
|
||||
{
|
||||
TopResourcesWindow.Show(title, resources);
|
||||
}
|
||||
|
||||
private void DrawSection(string title, System.Action content)
|
||||
{
|
||||
EditorGUILayout.BeginVertical(boxStyle);
|
||||
EditorGUILayout.LabelField(title, headerStyle);
|
||||
EditorGUILayout.Space(5);
|
||||
content();
|
||||
EditorGUILayout.EndVertical();
|
||||
EditorGUILayout.Space();
|
||||
}
|
||||
|
||||
private void DrawStatItem(string label, long value, long warningThreshold, long limitThreshold,
|
||||
System.Func<long, string> formatter = null, string selectButtonText = null, List<GameObject> objectsToSelect = null, System.Action onDetailClick = null)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.LabelField(label, GUILayout.Width(200));
|
||||
|
||||
string displayValue = formatter != null ? formatter(value) : value.ToString();
|
||||
string suggestion = "";
|
||||
GUIStyle style = resultGoodStyle;
|
||||
|
||||
if (value > limitThreshold)
|
||||
{
|
||||
style = resultBadStyle;
|
||||
suggestion = $"(严重超标! 建议 < {formatter?.Invoke(limitThreshold) ?? limitThreshold.ToString()})";
|
||||
}
|
||||
else if (value > warningThreshold)
|
||||
{
|
||||
style = resultWarnStyle;
|
||||
suggestion = $"(偏高, 建议 < {formatter?.Invoke(warningThreshold) ?? warningThreshold.ToString()})";
|
||||
}
|
||||
|
||||
EditorGUILayout.LabelField(displayValue, style, GUILayout.Width(100));
|
||||
|
||||
// 按钮逻辑
|
||||
if (onDetailClick != null)
|
||||
{
|
||||
if (GUILayout.Button(selectButtonText ?? "Detail", GUILayout.Width(120)))
|
||||
{
|
||||
onDetailClick.Invoke();
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(selectButtonText) && objectsToSelect != null && objectsToSelect.Count > 0)
|
||||
{
|
||||
if (GUILayout.Button("Select", GUILayout.Width(60)))
|
||||
{
|
||||
Selection.objects = objectsToSelect.ToArray();
|
||||
EditorGUIUtility.PingObject(objectsToSelect[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(suggestion))
|
||||
{
|
||||
EditorGUILayout.LabelField(suggestion, labelStyle);
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private string FormatNumber(long num)
|
||||
{
|
||||
if (num > 1000000) return (num / 1000000f).ToString("F1") + "M";
|
||||
if (num > 1000) return (num / 1000f).ToString("F1") + "K";
|
||||
return num.ToString();
|
||||
}
|
||||
|
||||
private string FormatBytes(long bytes)
|
||||
{
|
||||
if (bytes > 1024 * 1024 * 1024) return (bytes / (1024f * 1024f * 1024f)).ToString("F2") + " GB";
|
||||
if (bytes > 1024 * 1024) return (bytes / (1024f * 1024f)).ToString("F1") + " MB";
|
||||
if (bytes > 1024) return (bytes / 1024f).ToString("F1") + " KB";
|
||||
return bytes + " B";
|
||||
}
|
||||
|
||||
private (long warning, long limit) GetThreshold(MetricType type)
|
||||
{
|
||||
bool is12G = currentTarget == TargetDevice.Android_12G;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case MetricType.ObjectCount:
|
||||
return is12G ? (10000, 15000) : (5000, 10000);
|
||||
case MetricType.Vertices:
|
||||
return is12G ? (3000000, 5000000) : (1500000, 3000000);
|
||||
case MetricType.Triangles:
|
||||
return is12G ? (3000000, 5000000) : (1500000, 3000000);
|
||||
case MetricType.TextureMem:
|
||||
return is12G ? (1536L * 1024 * 1024, 2560L * 1024 * 1024) : (1024L * 1024 * 1024, 1536L * 1024 * 1024); // 1.5G/2.5G vs 1G/1.5G
|
||||
case MetricType.MeshMem:
|
||||
return is12G ? (512L * 1024 * 1024, 800L * 1024 * 1024) : (256L * 1024 * 1024, 512L * 1024 * 1024);
|
||||
case MetricType.AudioMem:
|
||||
return is12G ? (100L * 1024 * 1024, 200L * 1024 * 1024) : (50L * 1024 * 1024, 100L * 1024 * 1024);
|
||||
case MetricType.RealtimeLights:
|
||||
return is12G ? (3, 5) : (1, 3);
|
||||
case MetricType.ShadowLights:
|
||||
return is12G ? (1, 2) : (1, 1);
|
||||
case MetricType.TotalLights:
|
||||
return is12G ? (20, 50) : (10, 20); // 包含烘焙灯光
|
||||
case MetricType.SkinnedMesh:
|
||||
return is12G ? (50, 100) : (30, 50);
|
||||
case MetricType.ParticleSystems:
|
||||
return is12G ? (50, 100) : (30, 50);
|
||||
case MetricType.TransparentObjects:
|
||||
return is12G ? (500, 1000) : (300, 500); // 预估数量,非严格标准
|
||||
default:
|
||||
return (0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public class ResourceInfo
|
||||
{
|
||||
public string name;
|
||||
public long size;
|
||||
public Object obj;
|
||||
}
|
||||
|
||||
private class AnalysisData
|
||||
{
|
||||
public int objectCount;
|
||||
public long totalVertices;
|
||||
public long totalTriangles;
|
||||
public long textureMemory;
|
||||
public long meshMemory;
|
||||
public long audioMemory;
|
||||
|
||||
public int uniqueTextureCount;
|
||||
public int uniqueMaterialCount;
|
||||
public int uniqueMeshCount;
|
||||
|
||||
public int realtimeLightCount;
|
||||
public int shadowCastingLights;
|
||||
public int totalLightCount;
|
||||
public bool hasFog;
|
||||
public int skinnedMeshCount;
|
||||
public int particleSystemCount;
|
||||
|
||||
public int transparentObjectCount;
|
||||
public int nonStaticCount;
|
||||
|
||||
// 新增:Missing Script 和 MeshCollider 统计
|
||||
public int missingScriptCount;
|
||||
public int complexMeshColliderCount;
|
||||
|
||||
public List<GameObject> realtimeLights = new List<GameObject>();
|
||||
public List<GameObject> shadowLights = new List<GameObject>();
|
||||
public List<GameObject> skinnedMeshes = new List<GameObject>();
|
||||
public List<GameObject> particleSystems = new List<GameObject>();
|
||||
public List<GameObject> transparentObjects = new List<GameObject>();
|
||||
public List<GameObject> nonStaticObjects = new List<GameObject>();
|
||||
|
||||
public List<GameObject> missingScriptObjects = new List<GameObject>();
|
||||
public List<GameObject> complexMeshColliders = new List<GameObject>();
|
||||
|
||||
// Top Resources
|
||||
public List<ResourceInfo> topTextures = new List<ResourceInfo>();
|
||||
public List<ResourceInfo> topMeshes = new List<ResourceInfo>();
|
||||
}
|
||||
|
||||
// 独立的窗口类用于显示详细列表
|
||||
public class TopResourcesWindow : EditorWindow
|
||||
{
|
||||
private List<ResourceInfo> resources;
|
||||
private Vector2 scroll;
|
||||
|
||||
public static void Show(string title, List<ResourceInfo> resources)
|
||||
{
|
||||
var win = GetWindow<TopResourcesWindow>(true, title, true);
|
||||
win.resources = resources;
|
||||
win.minSize = new Vector2(400, 300);
|
||||
win.Show();
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if (resources == null) return;
|
||||
|
||||
scroll = EditorGUILayout.BeginScrollView(scroll);
|
||||
EditorGUILayout.BeginVertical();
|
||||
|
||||
EditorGUILayout.LabelField($"资源名称", "大小", EditorStyles.boldLabel);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
foreach (var res in resources)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
|
||||
EditorGUILayout.LabelField(res.name, GUILayout.Width(250));
|
||||
EditorGUILayout.LabelField(EditorUtility.FormatBytes(res.size), GUILayout.Width(80));
|
||||
if (GUILayout.Button("Select", GUILayout.Width(60)))
|
||||
{
|
||||
Selection.activeObject = res.obj;
|
||||
EditorGUIUtility.PingObject(res.obj);
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
}
|
||||
|
||||
private enum MetricType
|
||||
{
|
||||
ObjectCount,
|
||||
Vertices,
|
||||
Triangles,
|
||||
TextureMem,
|
||||
MeshMem,
|
||||
AudioMem,
|
||||
RealtimeLights,
|
||||
ShadowLights,
|
||||
TotalLights,
|
||||
SkinnedMesh,
|
||||
ParticleSystems,
|
||||
TransparentObjects
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/SoraTools/SceneAnalyzer/Editor/SceneAnalyzer.cs.meta
Normal file
11
Assets/SoraTools/SceneAnalyzer/Editor/SceneAnalyzer.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20681ed358cab224ab1111f4357b83d2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
69
Assets/Video360Controller.cs
Normal file
69
Assets/Video360Controller.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Video;
|
||||
|
||||
/// <summary>
|
||||
/// 360视频播放控制组件,用来读取外部视频文件
|
||||
/// </summary>
|
||||
public class Video360Controller : MonoBehaviour
|
||||
{
|
||||
private VideoPlayer mVideoPlayer;
|
||||
public string VideoNameStr = "";
|
||||
public double Time = 0;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
mVideoPlayer = gameObject.GetComponent<VideoPlayer>();
|
||||
mVideoPlayer.started += MVideoPlayer_started;
|
||||
mVideoPlayer.prepareCompleted += MVideoPlayer_prepareCompleted;
|
||||
PrepareVide(VideoNameStr);
|
||||
}
|
||||
|
||||
public bool isPlaying
|
||||
{
|
||||
get { return mVideoPlayer.isPlaying; }
|
||||
}
|
||||
|
||||
private void MVideoPlayer_started(VideoPlayer source)
|
||||
{
|
||||
if (Time != 0)
|
||||
{
|
||||
MVideoPlayer_started(Time);
|
||||
}
|
||||
}
|
||||
private void MVideoPlayer_prepareCompleted(VideoPlayer source)
|
||||
{
|
||||
mVideoPlayer.Play();
|
||||
}
|
||||
|
||||
public void MVideoPlayer_started(double mtime)
|
||||
{
|
||||
if (Time >= mVideoPlayer.length)
|
||||
{
|
||||
mVideoPlayer.time = mVideoPlayer.length;
|
||||
return;
|
||||
}
|
||||
mVideoPlayer.time = mtime;
|
||||
}
|
||||
|
||||
public void PrepareVide(string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
string videoPath = FileLoad.GetMoviesFolder() + name;
|
||||
Debug.Log($"目录检测{videoPath}");
|
||||
mVideoPlayer.url = videoPath;
|
||||
mVideoPlayer.Prepare();
|
||||
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Debug.LogError(e.Message);
|
||||
}
|
||||
}
|
||||
private void OnDisable()
|
||||
{
|
||||
Time = 0;
|
||||
}
|
||||
}
|
||||
11
Assets/Video360Controller.cs.meta
Normal file
11
Assets/Video360Controller.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd489cdf66bace5499478c8f1dedb299
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
10
Assets/YOMOV Access.meta
Normal file
10
Assets/YOMOV Access.meta
Normal file
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55f8d0cf08a0424499eca11472bb69be
|
||||
labels:
|
||||
- YXY
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/YOMOV Access/ActBuilder.meta
Normal file
8
Assets/YOMOV Access/ActBuilder.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7fe9153af6650ce4fa86c31802759f5b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/YOMOV Access/GameManagerPerfab.meta
Normal file
8
Assets/YOMOV Access/GameManagerPerfab.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2112a82d57a3a80479e219dcca09701a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,47 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &9102109133150290360
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7915350785257752681}
|
||||
- component: {fileID: 7260765144047810700}
|
||||
m_Layer: 0
|
||||
m_Name: GameManagerScene_00
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &7915350785257752681
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9102109133150290360}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 10230.964, y: -51.19377, z: 943.54706}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &7260765144047810700
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9102109133150290360}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e23ea31c31f60164b90cf523ec736606, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
playerDirection: {fileID: 0}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 346c1ea872f16bd4db67f2345730d9b5
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/YOMOV Access/Prefab.meta
Normal file
8
Assets/YOMOV Access/Prefab.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cbe2ba506ad363849b7a83faecf57595
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
366
Assets/YOMOV Access/Prefab/Cube.prefab
Normal file
366
Assets/YOMOV Access/Prefab/Cube.prefab
Normal file
@@ -0,0 +1,366 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2468804214868727367
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8715892259302707255}
|
||||
- component: {fileID: 8468258526941819482}
|
||||
- component: {fileID: 2603633290551499573}
|
||||
- component: {fileID: 4579233057008077181}
|
||||
m_Layer: 0
|
||||
m_Name: Visuals
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8715892259302707255
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2468804214868727367}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 10, y: 10, z: 10}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 9171031756790316709}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 116.218, y: -85.48, z: -18.765}
|
||||
--- !u!33 &8468258526941819482
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2468804214868727367}
|
||||
m_Mesh: {fileID: 4068373912626513877, guid: 7cf3ac7bcd2e5471fb54d5f5da9aad56, type: 3}
|
||||
--- !u!23 &2603633290551499573
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2468804214868727367}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 76618f7490c40334fa7b685859587d2e, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!65 &4579233057008077181
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2468804214868727367}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 0.01, y: 0.01, z: 0.01}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &5268460675038366902
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9171031756790316709}
|
||||
- component: {fileID: 5268460675038366900}
|
||||
- component: {fileID: 5268460675038366903}
|
||||
- component: {fileID: 1988286665728152634}
|
||||
m_Layer: 0
|
||||
m_Name: Cube
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &9171031756790316709
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5268460675038366902}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 8715892259302707255}
|
||||
- {fileID: 2591278628457874792}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!54 &5268460675038366900
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5268460675038366902}
|
||||
serializedVersion: 2
|
||||
m_Mass: 1
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0.05
|
||||
m_UseGravity: 1
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 1
|
||||
m_Constraints: 0
|
||||
m_CollisionDetection: 0
|
||||
--- !u!114 &5268460675038366903
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5268460675038366902}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0ad34abafad169848a38072baa96cdb2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_InteractionManager: {fileID: 0}
|
||||
m_Colliders: []
|
||||
m_InteractionLayers:
|
||||
m_Bits: 1
|
||||
m_DistanceCalculationMode: 1
|
||||
m_SelectMode: 1
|
||||
m_FocusMode: 1
|
||||
m_CustomReticle: {fileID: 0}
|
||||
m_AllowGazeInteraction: 0
|
||||
m_AllowGazeSelect: 0
|
||||
m_OverrideGazeTimeToSelect: 0
|
||||
m_GazeTimeToSelect: 0.5
|
||||
m_OverrideTimeToAutoDeselectGaze: 0
|
||||
m_TimeToAutoDeselectGaze: 3
|
||||
m_AllowGazeAssistance: 0
|
||||
m_FirstHoverEntered:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_LastHoverExited:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_HoverEntered:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_HoverExited:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FirstSelectEntered:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_LastSelectExited:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_SelectEntered:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_SelectExited:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FirstFocusEntered:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_LastFocusExited:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FocusEntered:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FocusExited:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Activated:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Deactivated:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_StartingHoverFilters: []
|
||||
m_StartingSelectFilters: []
|
||||
m_StartingInteractionStrengthFilters: []
|
||||
m_AttachTransform: {fileID: 0}
|
||||
m_SecondaryAttachTransform: {fileID: 0}
|
||||
m_UseDynamicAttach: 1
|
||||
m_MatchAttachPosition: 1
|
||||
m_MatchAttachRotation: 1
|
||||
m_SnapToColliderVolume: 1
|
||||
m_ReinitializeDynamicAttachEverySingleGrab: 1
|
||||
m_AttachEaseInTime: 0.15
|
||||
m_MovementType: 0
|
||||
m_VelocityDamping: 1
|
||||
m_VelocityScale: 1
|
||||
m_AngularVelocityDamping: 1
|
||||
m_AngularVelocityScale: 1
|
||||
m_TrackPosition: 1
|
||||
m_SmoothPosition: 0
|
||||
m_SmoothPositionAmount: 8
|
||||
m_TightenPosition: 0.1
|
||||
m_TrackRotation: 1
|
||||
m_SmoothRotation: 0
|
||||
m_SmoothRotationAmount: 8
|
||||
m_TightenRotation: 0.1
|
||||
m_TrackScale: 1
|
||||
m_SmoothScale: 1
|
||||
m_SmoothScaleAmount: 8
|
||||
m_TightenScale: 0.1
|
||||
m_ThrowOnDetach: 1
|
||||
m_ThrowSmoothingDuration: 0.25
|
||||
m_ThrowSmoothingCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
m_ThrowVelocityScale: 1.5
|
||||
m_ThrowAngularVelocityScale: 1
|
||||
m_ForceGravityOnDetach: 0
|
||||
m_RetainTransformParent: 1
|
||||
m_StartingSingleGrabTransformers: []
|
||||
m_StartingMultipleGrabTransformers: []
|
||||
m_AddDefaultGrabTransformers: 1
|
||||
m_FarAttachMode: 0
|
||||
--- !u!114 &1988286665728152634
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5268460675038366902}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0a1302d0d134fa8a2a5b3bf4aec3c20, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_PermittedDisplacementAxes: 7
|
||||
m_ConstrainedAxisDisplacementMode: 1
|
||||
m_TwoHandedRotationMode: 1
|
||||
m_AllowOneHandedScaling: 1
|
||||
m_AllowTwoHandedScaling: 1
|
||||
m_OneHandedScaleSpeed: 0.5
|
||||
m_ThresholdMoveRatioForScale: 0.01
|
||||
m_ClampScaling: 1
|
||||
m_MinimumScaleRatio: 0.25
|
||||
m_MaximumScaleRatio: 3
|
||||
m_ScaleMultiplier: 0.25
|
||||
--- !u!1001 &7714466481515797571
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 9171031756790316709}
|
||||
m_Modifications:
|
||||
- target: {fileID: 3774509235512974894, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Highlight Interaction Affordance
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5258331117553129771, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5258331117553129771, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5258331117553129771, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5258331117553129771, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5258331117553129771, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5258331117553129771, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5258331117553129771, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5258331117553129771, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5258331117553129771, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5258331117553129771, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5258331117553129771, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7396278978564332023, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
propertyPath: m_Renderer
|
||||
value:
|
||||
objectReference: {fileID: 2603633290551499573}
|
||||
- target: {fileID: 8634317094661461186, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
propertyPath: m_InteractableSource
|
||||
value:
|
||||
objectReference: {fileID: 5268460675038366903}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
--- !u!4 &2591278628457874792 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 5258331117553129771, guid: 6b12f432fa58c224baf0d659706362be, type: 3}
|
||||
m_PrefabInstance: {fileID: 7714466481515797571}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
7
Assets/YOMOV Access/Prefab/Cube.prefab.meta
Normal file
7
Assets/YOMOV Access/Prefab/Cube.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b51b255d931791a41a502711581239ad
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
342
Assets/YOMOV Access/Prefab/SimpleSocketShape.prefab
Normal file
342
Assets/YOMOV Access/Prefab/SimpleSocketShape.prefab
Normal file
@@ -0,0 +1,342 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &3277249689611702729
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3000186246023203508}
|
||||
m_Layer: 0
|
||||
m_Name: Attach
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3000186246023203508
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3277249689611702729}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6957000769822834732}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &6957000769822834733
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6957000769822834732}
|
||||
- component: {fileID: 6957000769822834742}
|
||||
- component: {fileID: 6957000769822834743}
|
||||
- component: {fileID: 6957000769822834729}
|
||||
- component: {fileID: 6957000769822834730}
|
||||
- component: {fileID: 2175187011753756096}
|
||||
m_Layer: 0
|
||||
m_Name: SimpleSocketShape
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6957000769822834732
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6957000769822834733}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.075, y: 0.15000002, z: 0.075}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children:
|
||||
- {fileID: 3000186246023203508}
|
||||
- {fileID: 129807179434452588}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &6957000769822834742
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6957000769822834733}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &6957000769822834743
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6957000769822834733}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 76618f7490c40334fa7b685859587d2e, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!54 &6957000769822834729
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6957000769822834733}
|
||||
serializedVersion: 2
|
||||
m_Mass: 1
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0.05
|
||||
m_UseGravity: 1
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 1
|
||||
m_Constraints: 0
|
||||
m_CollisionDetection: 0
|
||||
--- !u!114 &6957000769822834730
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6957000769822834733}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0ad34abafad169848a38072baa96cdb2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_InteractionManager: {fileID: 0}
|
||||
m_Colliders: []
|
||||
m_InteractionLayers:
|
||||
m_Bits: 1
|
||||
m_DistanceCalculationMode: 1
|
||||
m_SelectMode: 0
|
||||
m_FocusMode: 1
|
||||
m_CustomReticle: {fileID: 0}
|
||||
m_AllowGazeInteraction: 0
|
||||
m_AllowGazeSelect: 0
|
||||
m_OverrideGazeTimeToSelect: 0
|
||||
m_GazeTimeToSelect: 0.5
|
||||
m_OverrideTimeToAutoDeselectGaze: 0
|
||||
m_TimeToAutoDeselectGaze: 3
|
||||
m_AllowGazeAssistance: 0
|
||||
m_FirstHoverEntered:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_LastHoverExited:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_HoverEntered:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_HoverExited:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FirstSelectEntered:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_LastSelectExited:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_SelectEntered:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_SelectExited:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FirstFocusEntered:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_LastFocusExited:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FocusEntered:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FocusExited:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Activated:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Deactivated:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_StartingHoverFilters: []
|
||||
m_StartingSelectFilters: []
|
||||
m_StartingInteractionStrengthFilters: []
|
||||
m_AttachTransform: {fileID: 3000186246023203508}
|
||||
m_SecondaryAttachTransform: {fileID: 0}
|
||||
m_UseDynamicAttach: 1
|
||||
m_MatchAttachPosition: 1
|
||||
m_MatchAttachRotation: 1
|
||||
m_SnapToColliderVolume: 1
|
||||
m_ReinitializeDynamicAttachEverySingleGrab: 1
|
||||
m_AttachEaseInTime: 0.15
|
||||
m_MovementType: 2
|
||||
m_VelocityDamping: 1
|
||||
m_VelocityScale: 1
|
||||
m_AngularVelocityDamping: 1
|
||||
m_AngularVelocityScale: 1
|
||||
m_TrackPosition: 1
|
||||
m_SmoothPosition: 1
|
||||
m_SmoothPositionAmount: 5
|
||||
m_TightenPosition: 0.1
|
||||
m_TrackRotation: 1
|
||||
m_SmoothRotation: 1
|
||||
m_SmoothRotationAmount: 5
|
||||
m_TightenRotation: 0.1
|
||||
m_TrackScale: 1
|
||||
m_SmoothScale: 1
|
||||
m_SmoothScaleAmount: 5
|
||||
m_TightenScale: 0.1
|
||||
m_ThrowOnDetach: 1
|
||||
m_ThrowSmoothingDuration: 0.25
|
||||
m_ThrowSmoothingCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
m_ThrowVelocityScale: 1.5
|
||||
m_ThrowAngularVelocityScale: 1
|
||||
m_ForceGravityOnDetach: 0
|
||||
m_RetainTransformParent: 1
|
||||
m_StartingSingleGrabTransformers: []
|
||||
m_StartingMultipleGrabTransformers: []
|
||||
m_AddDefaultGrabTransformers: 1
|
||||
m_FarAttachMode: 0
|
||||
--- !u!65 &2175187011753756096
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6957000769822834733}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &401194151877151492
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 6957000769822834732}
|
||||
m_Modifications:
|
||||
- target: {fileID: 314259139610439016, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 314259139610439016, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 314259139610439016, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 314259139610439016, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 314259139610439016, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 314259139610439016, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 314259139610439016, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 314259139610439016, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 314259139610439016, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 314259139610439016, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 314259139610439016, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1784108126610004015, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
propertyPath: m_InteractableSource
|
||||
value:
|
||||
objectReference: {fileID: 6957000769822834730}
|
||||
- target: {fileID: 4104645014554624858, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
propertyPath: m_Renderer
|
||||
value:
|
||||
objectReference: {fileID: 6957000769822834743}
|
||||
- target: {fileID: 4696973491166461409, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: InteractionAffordance
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
--- !u!4 &129807179434452588 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 314259139610439016, guid: 9a5f820ee9c46b64294ae756b459a681, type: 3}
|
||||
m_PrefabInstance: {fileID: 401194151877151492}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
7
Assets/YOMOV Access/Prefab/SimpleSocketShape.prefab.meta
Normal file
7
Assets/YOMOV Access/Prefab/SimpleSocketShape.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62f09aeb10fd649459d1a73a6b44f72c
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
27
Assets/YOMOV Access/S00_Teach.cs
Normal file
27
Assets/YOMOV Access/S00_Teach.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using Yomov;
|
||||
|
||||
public class S00_Teach : MonoBehaviour
|
||||
{
|
||||
public PlayableDirector playerDirection;
|
||||
void Start()
|
||||
{
|
||||
YomovClientManager.Instance.OnStartGame += StartGame;
|
||||
}
|
||||
|
||||
public void StartGame()
|
||||
{
|
||||
playerDirection.Play();
|
||||
}
|
||||
|
||||
public void OnDestroy()
|
||||
{
|
||||
if(YomovClientManager.Instance != null)
|
||||
{
|
||||
YomovClientManager.Instance.OnStartGame -= StartGame;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/YOMOV Access/S00_Teach.cs.meta
Normal file
11
Assets/YOMOV Access/S00_Teach.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e23ea31c31f60164b90cf523ec736606
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/YOMOV Access/Scenes.meta
Normal file
8
Assets/YOMOV Access/Scenes.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d1deb7444c977464d873982e516f657f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
444
Assets/YOMOV Access/Scenes/Test360.unity
Normal file
444
Assets/YOMOV Access/Scenes/Test360.unity
Normal file
@@ -0,0 +1,444 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 12
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 256
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRDenoiserTypeDirect: 1
|
||||
m_PVRDenoiserTypeIndirect: 1
|
||||
m_PVRDenoiserTypeAO: 1
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 3
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
buildHeightMesh: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &380699876
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 380699879}
|
||||
- component: {fileID: 380699878}
|
||||
- component: {fileID: 380699877}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &380699877
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 380699876}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &380699878
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 380699876}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_Iso: 200
|
||||
m_ShutterSpeed: 0.005
|
||||
m_Aperture: 16
|
||||
m_FocusDistance: 10
|
||||
m_FocalLength: 50
|
||||
m_BladeCount: 5
|
||||
m_Curvature: {x: 2, y: 11}
|
||||
m_BarrelClipping: 0.25
|
||||
m_Anamorphism: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &380699879
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 380699876}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1100774033
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1100774035}
|
||||
- component: {fileID: 1100774034}
|
||||
- component: {fileID: 1100774036}
|
||||
m_Layer: 0
|
||||
m_Name: Directional Light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &1100774034
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1100774033}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 10
|
||||
m_Type: 1
|
||||
m_Shape: 0
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_InnerSpotAngle: 21.80208
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_CullingMatrixOverride:
|
||||
e00: 1
|
||||
e01: 0
|
||||
e02: 0
|
||||
e03: 0
|
||||
e10: 0
|
||||
e11: 1
|
||||
e12: 0
|
||||
e13: 0
|
||||
e20: 0
|
||||
e21: 0
|
||||
e22: 1
|
||||
e23: 0
|
||||
e30: 0
|
||||
e31: 0
|
||||
e32: 0
|
||||
e33: 1
|
||||
m_UseCullingMatrixOverride: 0
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingLayerMask: 1
|
||||
m_Lightmapping: 4
|
||||
m_LightShadowCasterMode: 0
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_UseBoundingSphereOverride: 0
|
||||
m_UseViewFrustumForShadowCasterCull: 1
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &1100774035
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1100774033}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!114 &1100774036
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1100774033}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Version: 3
|
||||
m_UsePipelineSettings: 1
|
||||
m_AdditionalLightsShadowResolutionTier: 2
|
||||
m_LightLayerMask: 1
|
||||
m_RenderingLayers: 1
|
||||
m_CustomShadowLayers: 0
|
||||
m_ShadowLayerMask: 1
|
||||
m_ShadowRenderingLayers: 1
|
||||
m_LightCookieSize: {x: 1, y: 1}
|
||||
m_LightCookieOffset: {x: 0, y: 0}
|
||||
m_SoftShadowQuality: 0
|
||||
--- !u!1001 &1402075126
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 4376256037239308489, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: videoName
|
||||
value: Scene_00.mp4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5872873290489288108, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: SkyBox_360Player
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5872873290489288108, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_Layer
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5872873290489288108, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7131374278733863374, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: -1000.0004
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7131374278733863374, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 1000
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7131374278733863374, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 1000.0004
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7131374278733863374, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7131374278733863374, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 1.7000153
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7131374278733863374, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7131374278733863374, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 0.7071068
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7131374278733863374, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7131374278733863374, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0.7071068
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7131374278733863374, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7131374278733863374, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7131374278733863374, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: -90
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7131374278733863374, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7131374278733863374, guid: f61c3ae77ec63554bb5fa1feae3a97d8,
|
||||
type: 3}
|
||||
propertyPath: m_ConstrainProportionsScale
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: f61c3ae77ec63554bb5fa1feae3a97d8, type: 3}
|
||||
--- !u!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Roots:
|
||||
- {fileID: 380699879}
|
||||
- {fileID: 1100774035}
|
||||
- {fileID: 1402075126}
|
||||
7
Assets/YOMOV Access/Scenes/Test360.unity.meta
Normal file
7
Assets/YOMOV Access/Scenes/Test360.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dc49a28e2b49c4e478d6f5a708864f9c
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/YOMOV Access/Scripts.meta
Normal file
8
Assets/YOMOV Access/Scripts.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7efd0fd58e001344ca64ca2e4e305c70
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
79
Assets/YOMOV Access/Scripts/ResetObject.cs
Normal file
79
Assets/YOMOV Access/Scripts/ResetObject.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
// 假设命名空间是 LevelUp.GrabInteractions
|
||||
namespace LevelUp.GrabInteractions
|
||||
{
|
||||
// 基础类,负责事件监听和延迟调用
|
||||
[RequireComponent(typeof(UnityEngine.XR.Interaction.Toolkit.Interactables.XRGrabInteractable))]
|
||||
public class ResetObject : MonoBehaviour
|
||||
{
|
||||
[Header("基础重置设置")]
|
||||
[Tooltip("物体返回原位之前的延迟时间 (秒)。")]
|
||||
[SerializeField]
|
||||
protected float resetDelayTime = 3f;
|
||||
|
||||
// 核心字段
|
||||
protected UnityEngine.XR.Interaction.Toolkit.Interactables.XRGrabInteractable m_GrabInteractable;
|
||||
protected Vector3 returnToPosition;
|
||||
|
||||
[Tooltip("指示物体是否应该被重置。子类可用于逻辑判断。")]
|
||||
public bool shouldReturnHome { get; protected set; } = true;
|
||||
|
||||
protected void Awake()
|
||||
{
|
||||
m_GrabInteractable = GetComponent<UnityEngine.XR.Interaction.Toolkit.Interactables.XRGrabInteractable>();
|
||||
}
|
||||
|
||||
protected void Start()
|
||||
{
|
||||
// 记录物体在场景中的初始位置
|
||||
returnToPosition = this.transform.position;
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (m_GrabInteractable != null)
|
||||
{
|
||||
m_GrabInteractable.selectExited.AddListener(OnSelectExit);
|
||||
m_GrabInteractable.selectEntered.AddListener(OnSelect);
|
||||
}
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
if (m_GrabInteractable != null)
|
||||
{
|
||||
m_GrabInteractable.selectExited.RemoveListener(OnSelectExit);
|
||||
m_GrabInteractable.selectEntered.RemoveListener(OnSelect);
|
||||
}
|
||||
CancelInvoke(nameof(ReturnHome));
|
||||
}
|
||||
|
||||
protected virtual void OnSelect(SelectEnterEventArgs arg0)
|
||||
{
|
||||
// 抓取时取消任何待执行的 ReturnHome 调用
|
||||
CancelInvoke(nameof(ReturnHome));
|
||||
}
|
||||
|
||||
protected virtual void OnSelectExit(SelectExitEventArgs arg0)
|
||||
{
|
||||
// 松手时延迟调用 ReturnHome
|
||||
Invoke(nameof(ReturnHome), resetDelayTime);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 核心重置函数。设置为 virtual 以便子类重写。
|
||||
/// 默认实现为瞬移。
|
||||
/// </summary>
|
||||
protected virtual void ReturnHome()
|
||||
{
|
||||
if (shouldReturnHome)
|
||||
{
|
||||
// 父类的默认实现是瞬移
|
||||
transform.position = returnToPosition;
|
||||
Debug.Log($"物体 '{gameObject.name}' 已瞬移重置到原点。", this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/YOMOV Access/Scripts/ResetObject.cs.meta
Normal file
11
Assets/YOMOV Access/Scripts/ResetObject.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3033df7ea093054e9c40a63f316e687
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
110
Assets/YOMOV Access/Scripts/ResetObjectSmooth.cs
Normal file
110
Assets/YOMOV Access/Scripts/ResetObjectSmooth.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
using System.Collections;
|
||||
|
||||
namespace LevelUp.GrabInteractions
|
||||
{
|
||||
public class ResetObjectSmooth : ResetObject
|
||||
{
|
||||
[Header("平滑重置设置")]
|
||||
[SerializeField] private float resetSpeed = 5f;
|
||||
[SerializeField] private float stopDistance = 0.01f;
|
||||
|
||||
private Quaternion returnToRotation;
|
||||
private Rigidbody rb;
|
||||
private Coroutine smoothMoveCoroutine;
|
||||
private bool initialIsKinematic;
|
||||
// 新增:用于备份物理插值设置
|
||||
private RigidbodyInterpolation initialInterpolation;
|
||||
|
||||
protected new void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
rb = GetComponent<Rigidbody>();
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
base.Start();
|
||||
returnToRotation = transform.rotation;
|
||||
|
||||
if (rb != null)
|
||||
{
|
||||
initialIsKinematic = rb.isKinematic;
|
||||
initialInterpolation = rb.interpolation; // 记录初始插值状态
|
||||
}
|
||||
}
|
||||
|
||||
void OnDestroy() => StopAllCoroutinesAndCancelInvoke();
|
||||
|
||||
private void StopAllCoroutinesAndCancelInvoke()
|
||||
{
|
||||
CancelInvoke(nameof(ReturnHome));
|
||||
if (smoothMoveCoroutine != null)
|
||||
{
|
||||
StopCoroutine(smoothMoveCoroutine);
|
||||
smoothMoveCoroutine = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnSelect(SelectEnterEventArgs arg0) => StopAllCoroutinesAndCancelInvoke();
|
||||
|
||||
protected override void OnSelectExit(SelectExitEventArgs arg0)
|
||||
{
|
||||
StopAllCoroutinesAndCancelInvoke();
|
||||
if (rb != null)
|
||||
{
|
||||
rb.isKinematic = false;
|
||||
rb.WakeUp();
|
||||
}
|
||||
base.OnSelectExit(arg0);
|
||||
}
|
||||
|
||||
protected override void ReturnHome()
|
||||
{
|
||||
if (shouldReturnHome)
|
||||
smoothMoveCoroutine = StartCoroutine(SmoothMoveToHome());
|
||||
}
|
||||
|
||||
private IEnumerator SmoothMoveToHome()
|
||||
{
|
||||
if (rb != null)
|
||||
{
|
||||
// 【关键优化 1】禁用物理插值,防止物理引擎尝试预测物体的 Transform 更新
|
||||
rb.interpolation = RigidbodyInterpolation.None;
|
||||
rb.isKinematic = true;
|
||||
rb.velocity = Vector3.zero;
|
||||
rb.angularVelocity = Vector3.zero;
|
||||
}
|
||||
|
||||
float stopDistanceSqr = stopDistance * stopDistance;
|
||||
|
||||
while ((transform.position - returnToPosition).sqrMagnitude > stopDistanceSqr)
|
||||
{
|
||||
float lerpFactor = 1f - Mathf.Exp(-resetSpeed * Time.deltaTime);
|
||||
|
||||
transform.position = Vector3.Lerp(transform.position, returnToPosition, lerpFactor);
|
||||
transform.rotation = Quaternion.Slerp(transform.rotation, returnToRotation, lerpFactor);
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
transform.position = returnToPosition;
|
||||
transform.rotation = returnToRotation;
|
||||
|
||||
// 【关键优化 2】在恢复物理属性前,等待一个物理帧,确保位置同步完成
|
||||
yield return new WaitForFixedUpdate();
|
||||
|
||||
if (rb != null)
|
||||
{
|
||||
rb.isKinematic = initialIsKinematic;
|
||||
// 【关键优化 3】恢复初始插值设置
|
||||
rb.interpolation = initialInterpolation;
|
||||
rb.velocity = Vector3.zero;
|
||||
rb.angularVelocity = Vector3.zero;
|
||||
}
|
||||
|
||||
smoothMoveCoroutine = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/YOMOV Access/Scripts/ResetObjectSmooth.cs.meta
Normal file
11
Assets/YOMOV Access/Scripts/ResetObjectSmooth.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7877962557443e34f8190e3278bd4a5d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user