/// <summary> /// Updates the settings of a custom editor. /// </summary> /// <param name="_TargetType">The new target type of the custom editor.</param> /// <param name="_CreateEditorMethod">The method to use to create an instance of the custom editor.</param> /// <param name="_DefaultOptions">The default options to use for the custom editor.</param> public void Update(Type _TargetType, MultipleEditorsManager.CreateEditorDelegate _CreateEditorMethod, CustomEditorExtensionOptions _DefaultOptions) { TargetType = _TargetType; if (m_Order == m_DefaultOptions.defaultOrder) { m_Order = _DefaultOptions.defaultOrder; } m_DefaultOptions = _DefaultOptions; CreateEditorMethod = _CreateEditorMethod; }
/// <summary> /// Creates an instance of CustomEditorExtensionSettings. /// </summary> /// <param name="_TargetType">The target type of the custom editor.</param> /// <param name="_CustomEditorType">The custom editor type.</param> /// <param name="_CreateEditorMethod">The method to use to create an instance of the custom editor.</param> /// <param name="_DefaultOptions">The default options to use for the custom editor.</param> public CustomEditorExtensionSettings(Type _TargetType, Type _CustomEditorType, MultipleEditorsManager.CreateEditorDelegate _CreateEditorMethod, CustomEditorExtensionOptions _DefaultOptions) { CustomEditorType = _CustomEditorType; m_Order = _DefaultOptions.defaultOrder; m_RequiresConstantRepaint = _DefaultOptions.requiresConstantRepaint; Update(_TargetType, _CreateEditorMethod, _DefaultOptions); }
/// <summary> /// Registers this custom editor with the manager to make it available for multiple editors system. /// </summary> /// <param name="_CreateEditorMethod">The method to use for creating an instance of this custom editor extension. For example if /// your custom editor class name is "TestEditorExtension", you can use: /// RegisterCustomEditor(() => { return new TestEditorExtension(); });</param> /// <param name="_Options">The options and default values to use for the CustomEditorExtension instance.</param> protected static void RegisterCustomEditor(MultipleEditorsManager.CreateEditorDelegate _CreateEditorMethod, CustomEditorExtensionOptions _Options) { MultipleEditorsManager.RegisterCustomEditor <TTarget>(_CreateEditorMethod, _Options); }
/// <summary> /// Registers this custom editor with the manager to make it available for multiple editors system. /// </summary> /// <param name="_CreateEditorMethod">The method to use for creating an instance of this custom editor extension. For example if /// your custom editor class name is "TestEditorExtension", you can use: /// RegisterCustomEditor(() => { return new TestEditorExtension(); });</param> /// <param name="_Order">The position of the editor in the inspector. The more the order, the highest the editor is drawn.</param> /// <param name="_DisplayName">The name of the custom editor, displayed in the Multiple Editors Manager window.</param> /// <param name="_RequiresConstantRepaint">If true, the extended Editor will set Editor.RequiresConstantRepaint() to true.</param> protected static void RegisterCustomEditor(MultipleEditorsManager.CreateEditorDelegate _CreateEditorMethod, int _Order, string _DisplayName, bool _RequiresConstantRepaint = false) { MultipleEditorsManager.RegisterCustomEditor <TTarget>(_CreateEditorMethod, new CustomEditorExtensionOptions(_Order, _DisplayName, null, _RequiresConstantRepaint)); }
/// <summary> /// Registers this custom editor with the manager to make it available for multiple editors system. /// </summary> /// <param name="_CreateEditorMethod">The method to use for creating an instance of this custom editor extension. For example if /// your custom editor class name is "TestEditorExtension", you can use: /// RegisterCustomEditor(() => { return new TestEditorExtension(); });</param> protected static void RegisterCustomEditor(MultipleEditorsManager.CreateEditorDelegate _CreateEditorMethod) { MultipleEditorsManager.RegisterCustomEditor <TTarget>(_CreateEditorMethod); }