Skip to content

Commit b38ec4d

Browse files
authored
Merge pull request #36 from keijiro/2018.3
2018.3
2 parents 21268f1 + a8e4091 commit b38ec4d

File tree

144 files changed

+4730
-1980
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+4730
-1980
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,5 @@ Desktop.ini
1111
# Unity
1212
/Library
1313
/Temp
14-
/UnityPackageManager
15-
/Packages
1614

1715
/Extras/backup

Assets/Klak/Extension/Runtime.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "Klak.Extensions"
3+
}

Assets/Klak/Extension/Runtime/Klak.Extensions.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Klak/Extension/MaterialExtension.cs renamed to Assets/Klak/Extension/Runtime/MaterialExtension.cs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,115 +26,115 @@
2626
namespace Klak.MaterialExtension
2727
{
2828
/// Extension methods (setters) for Material
29-
static class MaterialSetterExtension
29+
public static class MaterialSetterExtension
3030
{
31-
static public Material Property(this Material m, string name, float x)
31+
public static Material Property(this Material m, string name, float x)
3232
{
3333
m.SetFloat(name, x);
3434
return m;
3535
}
3636

37-
static public Material Property(this Material m, string name, float x, float y)
37+
public static Material Property(this Material m, string name, float x, float y)
3838
{
3939
m.SetVector(name, new Vector2(x, y));
4040
return m;
4141
}
4242

43-
static public Material Property(this Material m, string name, float x, float y, float z)
43+
public static Material Property(this Material m, string name, float x, float y, float z)
4444
{
4545
m.SetVector(name, new Vector3(x, y, z));
4646
return m;
4747
}
4848

49-
static public Material Property(this Material m, string name, float x, float y, float z, float w)
49+
public static Material Property(this Material m, string name, float x, float y, float z, float w)
5050
{
5151
m.SetVector(name, new Vector4(x, y, z, w));
5252
return m;
5353
}
5454

55-
static public Material Property(this Material m, string name, Vector2 v)
55+
public static Material Property(this Material m, string name, Vector2 v)
5656
{
5757
m.SetVector(name, v);
5858
return m;
5959
}
6060

61-
static public Material Property(this Material m, string name, Vector3 v)
61+
public static Material Property(this Material m, string name, Vector3 v)
6262
{
6363
m.SetVector(name, v);
6464
return m;
6565
}
6666

67-
static public Material Property(this Material m, string name, Vector4 v)
67+
public static Material Property(this Material m, string name, Vector4 v)
6868
{
6969
m.SetVector(name, v);
7070
return m;
7171
}
7272

73-
static public Material Property(this Material m, string name, Color color)
73+
public static Material Property(this Material m, string name, Color color)
7474
{
7575
m.SetColor(name, color);
7676
return m;
7777
}
7878

79-
static public Material Property(this Material m, string name, Texture texture)
79+
public static Material Property(this Material m, string name, Texture texture)
8080
{
8181
m.SetTexture(name, texture);
8282
return m;
8383
}
8484
}
8585

8686
/// Extension methods (setters) for MaterialProperty
87-
static class MaterialPropertySetterExtension
87+
public static class MaterialPropertySetterExtension
8888
{
89-
static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x)
89+
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x)
9090
{
9191
m.SetFloat(name, x);
9292
return m;
9393
}
9494

95-
static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x, float y)
95+
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x, float y)
9696
{
9797
m.SetVector(name, new Vector2(x, y));
9898
return m;
9999
}
100100

101-
static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x, float y, float z)
101+
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x, float y, float z)
102102
{
103103
m.SetVector(name, new Vector3(x, y, z));
104104
return m;
105105
}
106106

107-
static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x, float y, float z, float w)
107+
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x, float y, float z, float w)
108108
{
109109
m.SetVector(name, new Vector4(x, y, z, w));
110110
return m;
111111
}
112112

113-
static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Vector2 v)
113+
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Vector2 v)
114114
{
115115
m.SetVector(name, v);
116116
return m;
117117
}
118118

119-
static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Vector3 v)
119+
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Vector3 v)
120120
{
121121
m.SetVector(name, v);
122122
return m;
123123
}
124124

125-
static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Vector4 v)
125+
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Vector4 v)
126126
{
127127
m.SetVector(name, v);
128128
return m;
129129
}
130130

131-
static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Color color)
131+
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Color color)
132132
{
133133
m.SetColor(name, color);
134134
return m;
135135
}
136136

137-
static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Texture texture)
137+
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Texture texture)
138138
{
139139
m.SetTexture(name, texture);
140140
return m;

Assets/Klak/Extension/VectorMathExtension.cs renamed to Assets/Klak/Extension/Runtime/VectorMathExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
namespace Klak.VectorMathExtension
2727
{
2828
/// Extension methods for Vector4
29-
static class Vector4Extension
29+
public static class Vector4Extension
3030
{
3131
public static Quaternion ToQuaternion(this Vector4 v)
3232
{
@@ -41,7 +41,7 @@ public static Quaternion ToNormalizedQuaternion(this Vector4 v)
4141
}
4242

4343
/// Extension methods for Quaternion
44-
static class QuaternionExtension
44+
public static class QuaternionExtension
4545
{
4646
public static Vector4 ToVector4(this Quaternion q)
4747
{
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "Klak.Math.Editor",
3+
"references": [
4+
"Klak.Math"
5+
],
6+
"optionalUnityReferences": [],
7+
"includePlatforms": [
8+
"Editor"
9+
],
10+
"excludePlatforms": [],
11+
"allowUnsafeCode": false
12+
}

Assets/Klak/Math/Editor/Klak.Math.Editor.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Klak/Math/Runtime.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Klak/Math/BasicMath.cs renamed to Assets/Klak/Math/Runtime/BasicMath.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
namespace Klak.Math
2727
{
28-
static class BasicMath
28+
public static class BasicMath
2929
{
3030
public static float Lerp(float a, float b, float mix)
3131
{
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "Klak.Math",
3+
"references": [
4+
"Klak.Extensions"
5+
],
6+
"optionalUnityReferences": [],
7+
"includePlatforms": [],
8+
"excludePlatforms": [],
9+
"allowUnsafeCode": false
10+
}

Assets/Klak/Math/Runtime/Klak.Math.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Klak/Math/NoiseGenerator.cs renamed to Assets/Klak/Math/Runtime/NoiseGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
namespace Klak.Math
2727
{
2828
/// Noise generator that provides Vector3/Quaternion values
29-
struct NoiseGenerator
29+
public struct NoiseGenerator
3030
{
3131
#region Private variables
3232

File renamed without changes.

Assets/Klak/Math/Tween.cs renamed to Assets/Klak/Math/Runtime/Tween.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
namespace Klak.Math
2828
{
2929
/// Exponential interpolation
30-
static class ETween
30+
public static class ETween
3131
{
3232
#region Static Functions
3333

@@ -66,7 +66,7 @@ public static Quaternion Step(
6666
}
6767

6868
/// Interpolation with critically damped spring model
69-
struct DTween
69+
public struct DTween
7070
{
7171
#region Static Functions
7272

@@ -154,7 +154,7 @@ public static implicit operator float(DTween m)
154154
}
155155

156156
/// Interpolation with critically damped spring model
157-
struct DTweenVector2
157+
public struct DTweenVector2
158158
{
159159
public Vector2 position;
160160
public Vector2 velocity;
File renamed without changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "Klak.Motion.Editor",
3+
"references": [
4+
"Klak.Motion"
5+
],
6+
"optionalUnityReferences": [],
7+
"includePlatforms": [
8+
"Editor"
9+
],
10+
"excludePlatforms": [],
11+
"allowUnsafeCode": false
12+
}

Assets/Klak/Motion/Editor/Klak.Motion.Editor.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Klak/Motion/Runtime.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "Klak.Motion",
3+
"references": [
4+
"Klak.Extensions",
5+
"Klak.Math"
6+
],
7+
"optionalUnityReferences": [],
8+
"includePlatforms": [],
9+
"excludePlatforms": [],
10+
"allowUnsafeCode": false
11+
}

Assets/Klak/Motion/Runtime/Klak.Motion.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "Klak.Wiring.Editor",
3+
"references": [
4+
"Klak.Wiring"
5+
],
6+
"optionalUnityReferences": [],
7+
"includePlatforms": [
8+
"Editor"
9+
],
10+
"excludePlatforms": [],
11+
"allowUnsafeCode": false
12+
}

Assets/Klak/Wiring/Editor/Klak.Wiring.Editor.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Klak/Wiring/Editor/Patcher/PatcherWindow.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ static void OpenEmpty()
5252

5353
void OnEnable()
5454
{
55+
ForceTypeConverterCompatibility();
56+
5557
// Initialize if it hasn't been initialized.
5658
// (this could be happened when a window layout is loaded)
5759
if (_graph == null) Initialize(null);
@@ -162,6 +164,23 @@ void DrawPlaceholderGUI()
162164
GUILayout.EndVertical();
163165
}
164166

167+
// Workaround for a TypeConverter compatibility issue.
168+
// We found that the new behavior of TypeConverter.IsValid in .NET 4.x
169+
// causes an exception in UnityEditor.Graphs. To make it compatible
170+
// with the previous version of the .NET runtime (surprisingly, it
171+
// always returns true without any meaningful process), we overwrite
172+
// useCompatibleTypeConversion (private variable) using reflection.
173+
static void ForceTypeConverterCompatibility()
174+
{
175+
#if UNITY_EDITOR && (NET_4_6 || NET_STANDARD_2_0)
176+
typeof(System.ComponentModel.TypeConverter).
177+
GetField("useCompatibleTypeConversion",
178+
System.Reflection.BindingFlags.NonPublic |
179+
System.Reflection.BindingFlags.Static).
180+
SetValue(null, true);
181+
#endif
182+
}
183+
165184
#endregion
166185
}
167186
}

Assets/Klak/Wiring/Runtime.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

0 commit comments

Comments
 (0)