private void SetParams(Object targetAsset, AssetReferenceInfo assetReferenceInfo) { this.targetAsset = targetAsset; referenceInfo = assetReferenceInfo != null ? new ReferenceInfo(assetReferenceInfo) : null; displayType = DisplayType.Asset; scrollPosition = Vector2.zero; }
//----- property ----- //----- method ----- public static void Open(Object targetAsset, AssetReferenceInfo assetReferenceInfo) { if (!IsExist) { Instance.titleContent = new GUIContent("Find References In Project"); Instance.Show(); } Instance.SetParams(targetAsset, assetReferenceInfo); }
//----- method ----- internal TargetAssetInfo(Object target, string path, string fullPath) { this.guid = GetGuid(fullPath); this.AssetReferenceInfo = new AssetReferenceInfo(path, target); // DLLでMonoScriptだったらDLLの中のコンポーネントなのでfileIDを取り出す. if (path.EndsWith(".dll") && target is MonoScript) { fileId = LocalIdentifierInFile.Get(target).ToString(); } }
public ReferenceInfo(AssetReferenceInfo info) { TargetPath = info.TargetPath; Target = info.Target; Object = AssetDatabase.LoadAssetAtPath(info.TargetPath, typeof(Object)); Dependencies = new Dictionary <string, Object>(); foreach (var item in info.Dependencies) { Dependencies.Add(item, AssetDatabase.LoadAssetAtPath(item, typeof(Object))); } }