assetPath
The path name of the asset being imported.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Property
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
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; }}