public override void GetImportDependentAssets(HashSet <int> dependencies) { base.GetImportDependentAssets(dependencies); if (!object.ReferenceEquals(m_Subgraph, null)) { dependencies.Add(m_Subgraph.GetInstanceID()); } }
public override void Action(int instanceId, string pathName, string resourceFile) { try { var templateString = System.IO.File.ReadAllText(templatePath + templateAssetName); System.IO.File.WriteAllText(pathName, templateString); } catch (FileNotFoundException) { CreateNewAsset(pathName); } AssetDatabase.ImportAsset(pathName); VisualEffectAsset vfxAsset = AssetDatabase.LoadAssetAtPath <VisualEffectAsset>(pathName); var graph = vfxAsset.GetResource().GetOrCreateGraph(); graph.SetExpressionGraphDirty(); graph.RecompileIfNeeded(); ProjectWindowUtil.FrameObjectInProjectWindow(vfxAsset.GetInstanceID()); }