private void AutoAttachToSelection() { if ((Selection.activeObject as GameObject)?.GetComponent <VisualEffect>() is VisualEffect visualEffect) { foreach (var window in VFXViewWindow.GetAllWindows()) { window.AttachTo(visualEffect); } } }
public static void RefreshVfxErrorsIfNeeded(ref bool needRefreshVfxErrors) { if (needRefreshVfxErrors) { foreach (var vfxWindow in VFXViewWindow.GetAllWindows()) { if (vfxWindow != null) { var vfxGraph = vfxWindow.graphView.controller.graph; foreach (var output in vfxGraph.children.OfType <VFXDecalHDRPOutput>()) { output.RefreshErrors(vfxGraph); } } } } needRefreshVfxErrors = false; }
private void DetachIfDeleted() { VFXViewWindow.GetAllWindows().ToList().ForEach(x => x.DetachIfDeleted()); }