Content-Length: 19249 | pFad | https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/AssetImporter-assetPath.html
The path name of the asset for this importer. (Read Only)
using UnityEngine; using UnityEditor; public class AssetPathExample : MonoBehaviour { [MenuItem("Tools/AssetPathExample")] static void Example() { var importers = AndroidAssetPackImporter.GetAllImporters(); foreach (var importer in importers) { var labels = new string[0]; //Get asset path var path = importer.assetPath; //Use asset path to set labels if path contains "Icon" if (path.Contains("Icon")) { labels = new [] { "Icon" }; AssetDatabase.SetLabels(AssetDatabase.LoadAssetAtPath<Object>(path), labels); } } } }
Fetched URL: https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/AssetImporter-assetPath.html
Alternative Proxies: