hash tool

This commit is contained in:
左右看
2022-11-03 15:31:01 +08:00
parent 07e53faf0b
commit 005aaaedcb
3 changed files with 67 additions and 2 deletions
+55
View File
@@ -0,0 +1,55 @@
using UnityEngine;
using UnityEditor;
class SelectAllOfTagHash : ScriptableWizard
{
string tagName = "ExampleTag";
[MenuItem("Hash/Get Hash")]
static void SelectAllOfTagHashWizard()
{
ScriptableWizard.DisplayWizard(
"Hash/Get Hash",
typeof(SelectAllOfTagHash),
"Get Hash");
}
void OnWizardCreate()
{
//AssetDatabase.RemoveObjectFromAsset(Selection.objects[0]);
//AssetDatabase.CreateAsset(Selection.objects[0], "Assets/"+ Selection.objects[0].name + ".asset");
UnityEngine.GameObject obj = (GameObject)Selection.activeObject;
if (obj == null)
{
Debug.LogError("You must select GameObj first!");
return;
}
string result = "";
var children = obj.GetComponentsInChildren<Transform>();
foreach(var selectChild in children)
{
var tempChild = selectChild;
if (tempChild != null && tempChild != obj.transform)
{
result = tempChild.name;
while (tempChild.parent != obj.transform && tempChild.parent != null)
{
tempChild = tempChild.parent;
result = string.Format("{0}/{1}", tempChild.name, result);
}
}
Debug.Log(string.Format("GameObject:{0}, Hash:{1}", result, (uint)Animator.StringToHash(result)));
}
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e3d086c88fee2954d9cee0d1acca0969
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+1 -2
View File
@@ -159,7 +159,7 @@ public class UmaViewerUI : MonoBehaviour
public void LoadModelPanels()
{
var container = Instantiate(UmaContainerPrefab, AnimationSetList.content).GetComponent<UmaUIContainer>();
container.Name.text = container.name = "General";
container.Name.text = container.name = "Generic";
var imageInstance = container.GetComponent<Image>();
container.Button.onClick.AddListener(() => {
HighlightChildImage(AnimationSetList.content, imageInstance);
@@ -495,7 +495,6 @@ public class UmaViewerUI : MonoBehaviour
var filteredList = Main.AbList.Where(a => a.Name.StartsWith(UmaDatabaseController.MotionPath)
&& !a.Name.Contains($"mirror")
&& (mini ? a.Name.Contains($"mini") : !a.Name.Contains($"mini"))
&& !a.Name.Contains($"facial")
&& !a.Name.Contains($"_cam")
&& !a.Name.EndsWith($"_s")
&& !a.Name.EndsWith($"_e")