-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
119 changed files
with
6,082 additions
and
159 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using System; | ||
using UnityEngine; | ||
namespace SKCell | ||
{ | ||
/// <summary> | ||
/// Start a folder in the inspector. | ||
/// </summary> | ||
public class SKFolderAttribute : PropertyAttribute | ||
{ | ||
public string name; | ||
public bool foldout; | ||
public SKFolderAttribute(string name) | ||
{ | ||
this.name = name; | ||
this.foldout = true; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// End the current folder. | ||
/// </summary> | ||
public class SKEndFolderAttribute : PropertyAttribute | ||
{ | ||
public SKEndFolderAttribute(){} | ||
} | ||
|
||
/// <summary> | ||
/// Make a button in the inspector that executes a function. | ||
/// </summary> | ||
public class SKInspectorButtonAttribute : Attribute | ||
{ | ||
public string name; | ||
public bool onTop = true; | ||
public SKInspectorButtonAttribute(string name, bool onTop=true) | ||
{ | ||
this.name = name; | ||
this.onTop = onTop; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Display the field in the inspector only if the specified field matches the value. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] | ||
public class SKConditionalFieldAttribute : PropertyAttribute | ||
{ | ||
public string ConditionalField { get; } | ||
public object ConditionalValue { get; } | ||
|
||
public SKConditionalFieldAttribute(string conditionalField, object conditionalValue) | ||
{ | ||
ConditionalField = conditionalField; | ||
ConditionalValue = conditionalValue; | ||
} | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Field)] | ||
public class SKResettableAttribute : PropertyAttribute | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Instead of the field name, display the specidied text in the inspector. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Class, AllowMultiple = true)] | ||
public class SKInspectorTextAttribute : PropertyAttribute | ||
{ | ||
public string Message { get; } | ||
|
||
public SKInspectorTextAttribute(string message) | ||
{ | ||
Message = message; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.