Ejemplo n.º 1
0
        public string EvaluateLODGroupName(LODGroup lodGroup, PrefabContext prefabContext)
        {
            if (lodGroup == null)
            {
                return(null);
            }
            var lods = lodGroup.GetLODs();

            if (lods.Length == 0)
            {
                return(null);
            }
            var firstMesh = lods[0].renderers.FirstOrDefault();

            if (firstMesh == null)
            {
                return(null);
            }
            var folder = ExportUtils.ReplaceExtension(ExportUtils.GetRelPathFromAsset(_engine.Options.Subfolder, firstMesh), "");

            if (string.IsNullOrWhiteSpace(folder))
            {
                folder = prefabContext.TempFolder;
            }
            return(ExportUtils.Combine(folder, ExportUtils.SafeFileName(_engine.DecorateName(ExportUtils.GetName(firstMesh))) + ".With" + lods.Length.ToString(CultureInfo.InvariantCulture) + "Lods.mdl"));
        }
Ejemplo n.º 2
0
        public void ExportClip(AudioClip audioClip)
        {
            var relPath = ExportUtils.GetRelPathFromAsset(_engine.Options.Subfolder, audioClip);
            var newName = EvaluateAudioClipName(audioClip);

            _engine.TryCopyFile(AssetDatabase.GetAssetPath(audioClip), newName);
        }
Ejemplo n.º 3
0
        public string EvaluateMeshName(Mesh mesh, PrefabContext prefabContext)
        {
            if (mesh == null)
            {
                return(null);
            }
            var folder = ExportUtils.ReplaceExtension(ExportUtils.GetRelPathFromAsset(_engine.Options.Subfolder, mesh), "");

            if (string.IsNullOrWhiteSpace(folder))
            {
                folder = prefabContext.TempFolder;
            }
            return(ExportUtils.Combine(folder, ExportUtils.SafeFileName(_engine.DecorateName(ExportUtils.GetName(mesh))) + ".mdl"));
        }