Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SketchUpImporter

Derives from AssetImporter to handle importing of SketchUp files.
Read time 9 minutesLast updated 4 days ago

Definition

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

latitudeRetrieves the latitude Geo Coordinate imported from the SketchUp file.
longitudeRetrieves the longitude Geo Coordinate imported from the SketchUp file.
northCorrectionRetrieves the north correction value imported from the SketchUp file.

Methods

Method

Description

GetDefaultCameraThe default camera or the camera of the active Scene which the SketchUp file was saved with.
GetScenesThe method returns an array of SketchUpImportScene which represents SketchUp scenes.

Inheritance

Inherited Members

Operators

Operator

Description

operator ==Compares two object references to see if they refer to the same object.
boolDetermines whether the object exists.
operator !=Compares if two objects refer to a different object.