Vous ne pouvez pas sélectionner plus de 25 sujets
Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
|
|
- using UnityEngine;
- using System.Collections;
- using System.IO;
-
- public class EditorUtils : MonoBehaviour
- {
- /// <summary>
- ///
- /// </summary>
- /// <param name="dirName"></param>
- /// <returns>filename</returns>
- public static string SelectObjectPathInfo(ref string dirName)
- {
- if (UnityEditor.Selection.activeInstanceID < 0)
- {
- return "";
- }
-
- string path = UnityEditor.AssetDatabase.GetAssetPath(UnityEditor.Selection.activeInstanceID);
-
- dirName = Path.GetDirectoryName(path) + "/";
- return Path.GetFileName(path);
- }
- }
|