Пример #1
0
        private static GameObject CreateMeshVisual(Link.Geometry.Mesh mesh)
        {
#if UNITY_EDITOR
            if (!RuntimeUrdf.IsRuntimeMode())
            {
                GameObject meshObject = LocateAssetHandler.FindUrdfAsset <GameObject>(mesh.filename);
                return(meshObject == null ? null : (GameObject)RuntimeUrdf.PrefabUtility_InstantiatePrefab(meshObject));
            }
#endif
            return(CreateMeshVisualRuntime(mesh));
        }
Пример #2
0
        private static GameObject CreateMeshCollider(Link.Geometry.Mesh mesh)
        {
            if (!RuntimeUrdf.IsRuntimeMode())
            {
                GameObject prefabObject = LocateAssetHandler.FindUrdfAsset <GameObject>(mesh.filename);
                if (prefabObject == null)
                {
                    Debug.LogError("Unable to create mesh collider for the mesh: " + mesh.filename);
                    return(null);
                }

                GameObject meshObject = (GameObject)RuntimeUrdf.PrefabUtility_InstantiatePrefab(prefabObject);
                ConvertMeshToColliders(meshObject, location: mesh.filename);

                return(meshObject);
            }
            return(CreateMeshColliderRuntime(mesh));
        }
 private static Texture LoadTexture(string filename)
 {
     return(filename == "" ? null : LocateAssetHandler.FindUrdfAsset <Texture>(filename));
 }