Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComparisonAttribute QOL #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@ namespace UnityEngine
[Conditional("UNITY_EDITOR")]
public abstract class ComparisonAttribute : ToolboxConditionAttribute
{
/// <summary>
/// If <see cref="sourceHandle"/> is True
/// </summary>
/// <param name="sourceHandle">L-value or the mask if <see cref="Comparison"/> is set to <see cref="UnityComparisonMethod.Mask"/></param>
public ComparisonAttribute(string sourceHandle)
{
SourceHandle = sourceHandle;
ValueToMatch = true;
}

/// <param name="sourceHandle">L-value or the mask if <see cref="Comparison"/> is set to <see cref="UnityComparisonMethod.Mask"/></param>
/// <param name="valueToMatch">R-value or the flag if <see cref="Comparison"/> is set to <see cref="UnityComparisonMethod.Mask"/></param>
/// <param name="valueToMatch">R-value or the flag if <see cref="Comparison"/> is set to <see cref="UnityComparisonMethod.Mask"/></param>
public ComparisonAttribute(string sourceHandle, object valueToMatch)
{
SourceHandle = sourceHandle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ namespace UnityEngine
[Conditional("UNITY_EDITOR")]
public class DisableIfAttribute : ComparisonAttribute
{
public DisableIfAttribute(string sourceHandle) : base(sourceHandle)
{ }

public DisableIfAttribute(string sourceHandle, object valueToMatch) : base(sourceHandle, valueToMatch)
{ }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ namespace UnityEngine
[Conditional("UNITY_EDITOR")]
public class EnableIfAttribute : ComparisonAttribute
{
public EnableIfAttribute(string sourceHandle) : base(sourceHandle)
{ }

public EnableIfAttribute(string sourceHandle, object valueToMatch) : base(sourceHandle, valueToMatch)
{ }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ namespace UnityEngine
[Conditional("UNITY_EDITOR")]
public class HideDisabledIfAttribute : ComparisonAttribute
{
public HideDisabledIfAttribute(string sourceHandle) : base(sourceHandle)
{ }

public HideDisabledIfAttribute(string sourceHandle, object valueToMatch) : base(sourceHandle, valueToMatch)
{ }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ namespace UnityEngine
[Conditional("UNITY_EDITOR")]
public class HideIfAttribute : ComparisonAttribute
{
public HideIfAttribute(string sourceHandle) : base(sourceHandle)
{ }

public HideIfAttribute(string sourceHandle, object valueToMatch) : base(sourceHandle, valueToMatch)
{ }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ namespace UnityEngine
[Conditional("UNITY_EDITOR")]
public class ShowDisabledIfAttribute : ComparisonAttribute
{
public ShowDisabledIfAttribute(string sourceHandle) : base(sourceHandle)
{ }

public ShowDisabledIfAttribute(string sourceHandle, object valueToMatch) : base(sourceHandle, valueToMatch)
{ }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ namespace UnityEngine
[Conditional("UNITY_EDITOR")]
public class ShowIfAttribute : ComparisonAttribute
{
public ShowIfAttribute(string sourceHandle) : base(sourceHandle)
{ }

public ShowIfAttribute(string sourceHandle, object valueToMatch) : base(sourceHandle, valueToMatch)
{ }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ namespace UnityEngine
[Conditional("UNITY_EDITOR")]
public class ShowWarningIfAttribute : ComparisonAttribute
{
public ShowWarningIfAttribute(string sourceHandle, string message) : base(sourceHandle)
{
Message = message;
}

public ShowWarningIfAttribute(string sourceHandle, object valueToMatch, string message) : base(sourceHandle, valueToMatch)
{
Message = message;
Expand Down