SketchUpImporter
Derives from AssetImporter to handle importing of SketchUp files.
Read time 9 minutesLast updated 4 days ago
Definition
- Type: Class
- Namespace: UnityEditor
- Assembly: UnityEditor
- Inherits from: ModelImporter
public sealed class SketchUpImporter : ModelImporter
Remarks
From the SketchUpImporter, you can access certain properties that are extracted from the SketchUp file.
The following is an example of showing the geo coordinate extracted from the SketchUp file.
Examples
using UnityEngine;using UnityEditor;public class SketchUpUtility{ public static void ShowGeoCoordinate(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; } Debug.Log(string.Format("Lat:{0} Long:{1} NorthCorrection:{2}", importer.latitude, importer.longitude, importer.northCorrection)); }}
Properties
Property | Description |
|---|---|
| latitude | Retrieves the latitude Geo Coordinate imported from the SketchUp file. |
| longitude | Retrieves the longitude Geo Coordinate imported from the SketchUp file. |
| northCorrection | Retrieves the north correction value imported from the SketchUp file. |
Methods
Method | Description |
|---|---|
| GetDefaultCamera | The default camera or the camera of the active Scene which the SketchUp file was saved with. |
| GetScenes | The method returns an array of SketchUpImportScene which represents SketchUp scenes. |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |