Exemplo n.º 1
0
    void InitializeSubMesh()
    {
        if (subMesh != null)
        {
            return;
        }
        subMesh = new List <MeshMapper>();

        foreach (var m in GetComponentsInChildren <MeshFilter>())
        {
            if (m == RoomsMeshFilter)
            {
                continue;
            }

            if (m.sharedMesh == null)
            {
                continue;
            }

            if (m.sharedMesh != Resources.Load <Mesh>(m.sharedMesh.name))
            {
                continue;
            }

            var p = new MeshMapper();
            p.filter   = m;
            p.meshName = m.sharedMesh.name;
            subMesh.Add(p);
        }
    }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     mapper = GetComponent <MeshMapper>();
     if (mapper.mapping.Length == 0)
     {
         mapper.Load();
     }
 }