Skip to content

Commit

Permalink
Fixed
Browse files Browse the repository at this point in the history
- GradientObject script runtime warning
- RefectionHelper compile error in Unity 2017
  • Loading branch information
JasonMa0012 committed Dec 13, 2023
1 parent 3b0c3bc commit 5fe12bc
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 9 deletions.
12 changes: 12 additions & 0 deletions Editor/GradientObject.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) Jason Ma
using System;
using UnityEngine;

namespace LWGUI
{
[Serializable]
public class GradientObject : ScriptableObject
{
[SerializeField] public Gradient gradient = new Gradient();
}
}
3 changes: 3 additions & 0 deletions Editor/GradientObject.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions Editor/RampHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ namespace LWGUI
public class RampHelper
{
#region RampEditor
[Serializable]
public class GradientObject : ScriptableObject
{
[SerializeField] public Gradient gradient = new Gradient();
}


public static readonly string projectPath = Application.dataPath.Substring(0, Application.dataPath.Length - 6);

public static string lastSavePath
Expand Down
2 changes: 1 addition & 1 deletion Editor/ReflectionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static void DisplayCustomMenuWithSeparators(
private static Type EditorGUI_Type = typeof(EditorGUI);
private static PropertyInfo EditorGUI_Indent_Property = EditorGUI_Type.GetProperty("indent", BindingFlags.NonPublic | BindingFlags.Static);

public static float EditorGUI_Indent { get { return (float)EditorGUI_Indent_Property.GetValue(null); } }
public static float EditorGUI_Indent { get { return (float)EditorGUI_Indent_Property.GetValue(null, null); } }

#endregion

Expand Down
2 changes: 1 addition & 1 deletion Editor/ShaderDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ public override void DrawProp(Rect position, MaterialProperty prop, GUIContent l
// per prop variables
bool isDirty;
// used to read/write Gradient value in code
RampHelper.GradientObject gradientObject = ScriptableObject.CreateInstance<RampHelper.GradientObject>();
GradientObject gradientObject = ScriptableObject.CreateInstance<GradientObject>();
// used to modify Gradient value for users
SerializedObject serializedObject = new SerializedObject(gradientObject);
SerializedProperty serializedProperty = serializedObject.FindProperty("gradient");
Expand Down
17 changes: 17 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog

## [1.14.4] - 2023-12-13

### Added

### Removed

### Changed

### Fixed

- GradientObject script runtime warning
- RefectionHelper compile error in Unity 2017

### Known Issues

7 changes: 7 additions & 0 deletions changelog.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.jasonma.lwgui",
"version": "1.14.3",
"version": "1.14.4",
"displayName": "LWGUI",
"description": "A Lightweight, Flexible, Powerful Shader GUI System for Unity.",
"keywords": [
Expand Down

0 comments on commit 5fe12bc

Please sign in to comment.