This commit is contained in:
2025-11-14 18:44:06 +08:00
parent 10156da245
commit 22e867d077
7013 changed files with 2572882 additions and 1804 deletions

View File

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

View File

@@ -0,0 +1,47 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(SetGroup))]
public class SetGroupEditor : Editor
{
SetGroup inst;
private void OnEnable()
{
inst = (SetGroup)target;
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
//
if(GUILayout.Button("SetGroup", GUILayout.Height(50)))
{
AAA();
}
}
void AAA()
{
GameObject[] curObjects = Selection.gameObjects;
Vector3 centerPos = Vector3.zero;
foreach (GameObject obj in curObjects)
{
centerPos += obj.GetComponent<MeshRenderer>().bounds.center;
}
centerPos /= curObjects.Length;
//
GameObject parent = new GameObject(inst.namee);
parent.transform.position = centerPos;
parent.transform.SetParent(inst.root);
foreach (GameObject obj in curObjects)
{
obj.transform.SetParent(parent.transform);
}
}
}

View File

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

View File

@@ -0,0 +1,21 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SetGroup : MonoBehaviour
{
public Transform root;
public string namee;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

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