Documentation

Unity Engine

Unity Engine

assetPath

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

Definition

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{ // Increment the version number, when the AssetPostprocessors code/behavior is changed static readonly uint k_Version = 0; public override uint GetVersion() { return k_Version; } void OnPreprocessTexture() { Debug.Log("Importing texture to: " + assetPath); TextureImporter importer = (TextureImporter)assetImporter; importer.textureFormat = TextureImporterFormat.ARGB32; importer.isReadable = true; importer.mipmapEnabled = false; }}