23 lines
434 B
C#
23 lines
434 B
C#
|
|
using UnityEngine;
|
|||
|
|
using System.Collections;
|
|||
|
|
|
|||
|
|
public class AutoAddCollision: MonoBehaviour
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
// Use this for initialization
|
|||
|
|
//void Start()
|
|||
|
|
//{
|
|||
|
|
// ModelAddMeshCollider();
|
|||
|
|
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
[ContextMenu("<22><><EFBFBD><EFBFBD>")]
|
|||
|
|
void ModelAddMeshCollider()
|
|||
|
|
{
|
|||
|
|
foreach (var render in transform.GetComponentsInChildren<MeshRenderer>())
|
|||
|
|
{
|
|||
|
|
render.gameObject.AddComponent<MeshCollider>();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|