-
Notifications
You must be signed in to change notification settings - Fork 171
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
25 changed files
with
741 additions
and
410 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
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
35 changes: 35 additions & 0 deletions
35
_PoiyomiShaders/Scripts/ThryEditor/Editor/Drawers/Vector31.cs
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,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using UnityEditor; | ||
using UnityEngine; | ||
using static Thry.GradientEditor; | ||
using static Thry.TexturePacker; | ||
|
||
namespace Thry | ||
{ | ||
public class Vector31Drawer : MaterialPropertyDrawer | ||
{ | ||
public override void OnGUI(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor) | ||
{ | ||
string[] labels = label.text.Split('|'); | ||
|
||
EditorGUI.BeginChangeCheck(); | ||
EditorGUI.showMixedValue = prop.hasMixedValue; | ||
Vector4 vec = EditorGUI.Vector3Field(position, labels[0], prop.vectorValue); | ||
float single = EditorGUI.FloatField(EditorGUILayout.GetControlRect(), labels.Length > 1 ? labels[1] : labels[0], prop.vectorValue.w); | ||
if (EditorGUI.EndChangeCheck()) | ||
{ | ||
prop.vectorValue = new Vector4(vec.x, vec.y, vec.z, single); | ||
} | ||
} | ||
|
||
public override float GetPropertyHeight(MaterialProperty prop, string label, MaterialEditor editor) | ||
{ | ||
DrawingData.LastPropertyUsedCustomDrawer = true; | ||
return base.GetPropertyHeight(prop, label, editor); | ||
} | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
_PoiyomiShaders/Scripts/ThryEditor/Editor/Drawers/Vector31.cs.meta
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.