SketchUpImporter.GetScenes
Declaration
public SketchUpImportScene[] GetScenes();Возвращаемое значение
SketchUpImportScene[] Массив сцен, извлеченных из файла SketchUp.
Описание
Метод возвращает массив SketchUpImportScene, который представляет сцены SketchUp.
SketchUpImportScene — это структура, представляющая Scene, который был извлечен из файла SketchUp.
using UnityEngine; using UnityEditor;
public class SketchUpUtility { public static void PrintSketchUpSceneName(GameObject go) { string assetPath = AssetDatabase.GetAssetPath(go); // get asset path // get SketchUpImporter SketchUpImporter importer = AssetImporter.GetAtPath(assetPath) as SketchUpImporter; if (importer == null) { Debug.Log("This object is not imported by SketchUpImporter"); return; }
SketchUpImportScene[] scenes = importer.GetScenes(); // get all the scenes
foreach (SketchUpImportScene scene in scenes) { Debug.Log(scene.name); } } }
В вышеприведённом примере используется файл GameObject, импортированный из файла SketchUp, и выводятся имена сцен в файле SketchUp.