Beispiel #1
0
    //adds mesh colliders to game objects
    void attachMeshColliders()
    {
        GameObject go;

        Debug.Log("Currently adding Mesh Colliders.");
        foreach (MeshRenderer mesh in crowdSurface.GetComponentsInChildren <MeshRenderer>(true))
        {
            go = mesh.gameObject;
            go.AddComponent <MeshCollider>();
            /*go.GetComponent<MeshCollider>().convex=true; */
        }
        Debug.Log("Finished adding Mesh Colliders.");
    }