/// <param name="plugin">EditorPlugin object</param> /// <param name="action">action( Resource resource )</param> /// <returns>Unsubscribe callback</returns> public static VoidFunc OnResourceSaved(this EditorPlugin plugin, Action <Resource> action) { var callback = plugin.Subscribe(ResourceSavedSignal, action); return(() => plugin.Unsubscribe(ResourceSavedSignal, callback)); }
/// <summary> /// Emitted when user closes a scene. The argument is file path to a closed scene. /// </summary> /// <param name="plugin">EditorPlugin object</param> /// <param name="action">action( String filepath )</param> /// <returns>Unsubscribe callback</returns> public static VoidFunc OnSceneClosed(this EditorPlugin plugin, Action <Node> action) { var callback = plugin.Subscribe(SceneClosedSignal, action); return(() => plugin.Unsubscribe(SceneClosedSignal, callback)); }
/// <summary> /// Emitted when user changes the workspace (2D, 3D, Script, AssetLib). Also works with custom screens defined by plugins. /// </summary> /// <param name="plugin">EditorPlugin object</param> /// <param name="action">action(String screen_name)</param> /// <returns>Unsubscribe callback</returns> public static VoidFunc OnMainScreenChanged(this EditorPlugin plugin, Action <string> action) { var callback = plugin.Subscribe(MainScreenChangedSignal, action); return(() => plugin.Unsubscribe(MainScreenChangedSignal, callback)); }