protected void OnEnable() { VFXManagerEditor.CheckVFXManager(); graphView = new VFXView(); graphView.StretchToParentSize(); SetupFramingShortcutHandler(graphView); rootVisualElement.Add(graphView); var currentAsset = GetCurrentResource(); if (currentAsset != null) { LoadResource(currentAsset); } autoCompile = true; graphView.RegisterCallback <AttachToPanelEvent>(OnEnterPanel); graphView.RegisterCallback <DetachFromPanelEvent>(OnLeavePanel); if (rootVisualElement.panel != null) { rootVisualElement.AddManipulator(m_ShortcutHandler); } currentWindow = this; #if USE_EXIT_WORKAROUND_FOGBUGZ_1062258 EditorApplication.wantsToQuit += Quitting_Workaround; #endif }
protected void OnEnable() { VFXManagerEditor.CheckVFXManager(); if (m_ResourceHistory == null) { m_ResourceHistory = new List <VisualEffectResource>(); } graphView = new VFXView(); graphView.StretchToParentSize(); SetupFramingShortcutHandler(graphView); rootVisualElement.Add(graphView); // make sure we don't do something that might touch the model on the view OnEnable because // the models OnEnable might be called after in the case of a domain reload. m_OnUpdateAction = () => { var currentAsset = GetCurrentResource(); if (currentAsset != null) { LoadResource(currentAsset); } }; autoCompile = true; graphView.RegisterCallback <AttachToPanelEvent>(OnEnterPanel); graphView.RegisterCallback <DetachFromPanelEvent>(OnLeavePanel); if (rootVisualElement.panel != null) { rootVisualElement.AddManipulator(m_ShortcutHandler); } currentWindow = this; #if USE_EXIT_WORKAROUND_FOGBUGZ_1062258 EditorApplication.wantsToQuit += Quitting_Workaround; #endif var icon = AssetDatabase.LoadAssetAtPath <Texture2D>(VisualEffectGraphPackageInfo.assetPackagePath + "/Editor Default Resources/VFX/" + (EditorGUIUtility.isProSkin ? "vfx_graph_icon_gray_dark.png" : "vfx_graph_icon_gray_light.png")); titleContent.image = icon; }
protected void OnEnable() { VFXManagerEditor.CheckVFXManager(); if (m_ResourceHistory == null) { m_ResourceHistory = new List <VisualEffectResource>(); } graphView = new VFXView(); graphView.StretchToParentSize(); SetupFramingShortcutHandler(graphView); rootVisualElement.Add(graphView); // make sure we don't do something that might touch the model on the view OnEnable because // the models OnEnable might be called after in the case of a domain reload. m_OnUpdateAction = () => { var currentAsset = GetCurrentResource(); if (currentAsset != null) { LoadResource(currentAsset); } }; autoCompile = true; graphView.RegisterCallback <AttachToPanelEvent>(OnEnterPanel); graphView.RegisterCallback <DetachFromPanelEvent>(OnLeavePanel); if (rootVisualElement.panel != null) { rootVisualElement.AddManipulator(m_ShortcutHandler); } currentWindow = this; #if USE_EXIT_WORKAROUND_FOGBUGZ_1062258 EditorApplication.wantsToQuit += Quitting_Workaround; #endif }