Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


assetPath

The path name of the asset being imported.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Property
  • Namespace: UnityEditor
  • Assembly: UnityEditor
public string assetPath { get; set; }

Examples

using UnityEngine;using UnityEditor;// Automatically sets Textures settings upon first import and prints the// path from where is being importedclass CustomImportSettings : AssetPostprocessor{ void OnPreprocessTexture() { Debug.Log("Importing texture to: " + assetPath); TextureImporter importer = (TextureImporter)assetImporter; importer.textureFormat = TextureImporterFormat.ARGB32; importer.isReadable = true; importer.mipmapEnabled = false; }}