-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
Misc project organization. Added SubstanceGraph extension functions to get and set graph output size. SubstanceParameter now has a value for the value type (bool, int, Vector2) of the input parameter. Fixed warning in SubstanceGraphExtensionsTest class.
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using UnityEngine; | ||
using UnityEditor; | ||
|
||
namespace Substance.Editor | ||
{ | ||
/// <summary> | ||
/// Class containing extension methods for the <see cref="SerializedProperty"/> class. | ||
/// </summary> | ||
public static class SerializedPropertyExtensions | ||
{ | ||
/// <summary> | ||
/// Returns a sibling property to the given property. | ||
/// </summary> | ||
/// <param name="property">The property to get a sibling property for.</param> | ||
/// <param name="path">The path to the target property. This is usually just the property's name.</param> | ||
/// <param name="isRoot">If true, the target property will be navigated to starting at the given property's SerializedObject.</param> | ||
public static SerializedProperty GetSiblingProperty(this SerializedProperty property, string path, bool isRoot = false) | ||
{ | ||
SerializedProperty targetProperty = null; | ||
|
||
if (!isRoot && property.propertyPath.IndexOf('.') > 0) | ||
{ | ||
path = property.propertyPath.Substring(0, property.propertyPath.LastIndexOf('.') + 1) + path; | ||
} | ||
|
||
targetProperty = property.serializedObject.FindProperty(path); | ||
|
||
return targetProperty; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace Substance.Game | ||
{ | ||
/// <summary> | ||
/// Wrapper enum for the Global.Input.substanceInputType int value. | ||
/// </summary> | ||
public enum SubstanceInputType : byte | ||
{ | ||
Float = 0, | ||
Vector2 = 1, | ||
Vector3 = 2, | ||
Vector4 = 3, | ||
Int_Or_Bool = 4, | ||
Texture = 5, | ||
String = 6, | ||
Vector2Int = 8, | ||
Vector3Int = 9, | ||
Vector4Int = 10 | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
namespace Substance.Game | ||
{ | ||
/// <summary> | ||
/// Wrapper enum for the int values expected for setting substance output size via code. | ||
/// Code: substanceGraph.SetInputVector2Int("$outputsize", x, y); | ||
/// </summary> | ||
public enum SubstanceOutputSize : byte | ||
{ | ||
/// <summary> | ||
/// 32 x 32 | ||
/// </summary> | ||
_32 = 5, | ||
/// <summary> | ||
/// 64 x 64 | ||
/// </summary> | ||
_64 = 6, | ||
/// <summary> | ||
/// 128 x 128 | ||
/// </summary> | ||
_128 = 7, | ||
/// <summary> | ||
/// 256 x 256 | ||
/// </summary> | ||
_256 = 8, | ||
/// <summary> | ||
/// 512 x 512 | ||
/// </summary> | ||
_512 = 9, | ||
/// <summary> | ||
/// 1024 x 1024 | ||
/// </summary> | ||
_1024 = 10, | ||
/// <summary> | ||
/// 2048 x 2048 | ||
/// </summary> | ||
_2048 = 11, | ||
/// <summary> | ||
/// 4096 x 4096 | ||
/// </summary> | ||
_4096 = 12 | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.