Skip to content

Commit

Permalink
Merge pull request #36 from keijiro/2018.3
Browse files Browse the repository at this point in the history
2018.3
  • Loading branch information
keijiro authored Nov 8, 2018
2 parents 21268f1 + a8e4091 commit b38ec4d
Show file tree
Hide file tree
Showing 144 changed files with 4,730 additions and 1,980 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@ Desktop.ini
# Unity
/Library
/Temp
/UnityPackageManager
/Packages

/Extras/backup
8 changes: 8 additions & 0 deletions Assets/Klak/Extension/Runtime.meta

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

3 changes: 3 additions & 0 deletions Assets/Klak/Extension/Runtime/Klak.Extensions.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "Klak.Extensions"
}
7 changes: 7 additions & 0 deletions Assets/Klak/Extension/Runtime/Klak.Extensions.asmdef.meta

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
Expand Up @@ -26,115 +26,115 @@
namespace Klak.MaterialExtension
{
/// Extension methods (setters) for Material
static class MaterialSetterExtension
public static class MaterialSetterExtension
{
static public Material Property(this Material m, string name, float x)
public static Material Property(this Material m, string name, float x)
{
m.SetFloat(name, x);
return m;
}

static public Material Property(this Material m, string name, float x, float y)
public static Material Property(this Material m, string name, float x, float y)
{
m.SetVector(name, new Vector2(x, y));
return m;
}

static public Material Property(this Material m, string name, float x, float y, float z)
public static Material Property(this Material m, string name, float x, float y, float z)
{
m.SetVector(name, new Vector3(x, y, z));
return m;
}

static public Material Property(this Material m, string name, float x, float y, float z, float w)
public static Material Property(this Material m, string name, float x, float y, float z, float w)
{
m.SetVector(name, new Vector4(x, y, z, w));
return m;
}

static public Material Property(this Material m, string name, Vector2 v)
public static Material Property(this Material m, string name, Vector2 v)
{
m.SetVector(name, v);
return m;
}

static public Material Property(this Material m, string name, Vector3 v)
public static Material Property(this Material m, string name, Vector3 v)
{
m.SetVector(name, v);
return m;
}

static public Material Property(this Material m, string name, Vector4 v)
public static Material Property(this Material m, string name, Vector4 v)
{
m.SetVector(name, v);
return m;
}

static public Material Property(this Material m, string name, Color color)
public static Material Property(this Material m, string name, Color color)
{
m.SetColor(name, color);
return m;
}

static public Material Property(this Material m, string name, Texture texture)
public static Material Property(this Material m, string name, Texture texture)
{
m.SetTexture(name, texture);
return m;
}
}

/// Extension methods (setters) for MaterialProperty
static class MaterialPropertySetterExtension
public static class MaterialPropertySetterExtension
{
static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x)
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x)
{
m.SetFloat(name, x);
return m;
}

static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x, float y)
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x, float y)
{
m.SetVector(name, new Vector2(x, y));
return m;
}

static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x, float y, float z)
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x, float y, float z)
{
m.SetVector(name, new Vector3(x, y, z));
return m;
}

static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x, float y, float z, float w)
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, float x, float y, float z, float w)
{
m.SetVector(name, new Vector4(x, y, z, w));
return m;
}

static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Vector2 v)
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Vector2 v)
{
m.SetVector(name, v);
return m;
}

static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Vector3 v)
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Vector3 v)
{
m.SetVector(name, v);
return m;
}

static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Vector4 v)
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Vector4 v)
{
m.SetVector(name, v);
return m;
}

static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Color color)
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Color color)
{
m.SetColor(name, color);
return m;
}

static public MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Texture texture)
public static MaterialPropertyBlock Property(this MaterialPropertyBlock m, string name, Texture texture)
{
m.SetTexture(name, texture);
return m;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
namespace Klak.VectorMathExtension
{
/// Extension methods for Vector4
static class Vector4Extension
public static class Vector4Extension
{
public static Quaternion ToQuaternion(this Vector4 v)
{
Expand All @@ -41,7 +41,7 @@ public static Quaternion ToNormalizedQuaternion(this Vector4 v)
}

/// Extension methods for Quaternion
static class QuaternionExtension
public static class QuaternionExtension
{
public static Vector4 ToVector4(this Quaternion q)
{
Expand Down
12 changes: 12 additions & 0 deletions Assets/Klak/Math/Editor/Klak.Math.Editor.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Klak.Math.Editor",
"references": [
"Klak.Math"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false
}
7 changes: 7 additions & 0 deletions Assets/Klak/Math/Editor/Klak.Math.Editor.asmdef.meta

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

8 changes: 8 additions & 0 deletions Assets/Klak/Math/Runtime.meta

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
Expand Up @@ -25,7 +25,7 @@

namespace Klak.Math
{
static class BasicMath
public static class BasicMath
{
public static float Lerp(float a, float b, float mix)
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions Assets/Klak/Math/Runtime/Klak.Math.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "Klak.Math",
"references": [
"Klak.Extensions"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false
}
7 changes: 7 additions & 0 deletions Assets/Klak/Math/Runtime/Klak.Math.asmdef.meta

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
Expand Up @@ -26,7 +26,7 @@
namespace Klak.Math
{
/// Noise generator that provides Vector3/Quaternion values
struct NoiseGenerator
public struct NoiseGenerator
{
#region Private variables

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace Klak.Math
{
/// Exponential interpolation
static class ETween
public static class ETween
{
#region Static Functions

Expand Down Expand Up @@ -66,7 +66,7 @@ public static Quaternion Step(
}

/// Interpolation with critically damped spring model
struct DTween
public struct DTween
{
#region Static Functions

Expand Down Expand Up @@ -154,7 +154,7 @@ public static implicit operator float(DTween m)
}

/// Interpolation with critically damped spring model
struct DTweenVector2
public struct DTweenVector2
{
public Vector2 position;
public Vector2 velocity;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions Assets/Klak/Motion/Editor/Klak.Motion.Editor.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Klak.Motion.Editor",
"references": [
"Klak.Motion"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false
}
7 changes: 7 additions & 0 deletions Assets/Klak/Motion/Editor/Klak.Motion.Editor.asmdef.meta

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

8 changes: 8 additions & 0 deletions Assets/Klak/Motion/Runtime.meta

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

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions Assets/Klak/Motion/Runtime/Klak.Motion.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Klak.Motion",
"references": [
"Klak.Extensions",
"Klak.Math"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false
}
7 changes: 7 additions & 0 deletions Assets/Klak/Motion/Runtime/Klak.Motion.asmdef.meta

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

File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions Assets/Klak/Wiring/Editor/Klak.Wiring.Editor.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Klak.Wiring.Editor",
"references": [
"Klak.Wiring"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false
}
7 changes: 7 additions & 0 deletions Assets/Klak/Wiring/Editor/Klak.Wiring.Editor.asmdef.meta

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

19 changes: 19 additions & 0 deletions Assets/Klak/Wiring/Editor/Patcher/PatcherWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ static void OpenEmpty()

void OnEnable()
{
ForceTypeConverterCompatibility();

// Initialize if it hasn't been initialized.
// (this could be happened when a window layout is loaded)
if (_graph == null) Initialize(null);
Expand Down Expand Up @@ -162,6 +164,23 @@ void DrawPlaceholderGUI()
GUILayout.EndVertical();
}

// Workaround for a TypeConverter compatibility issue.
// We found that the new behavior of TypeConverter.IsValid in .NET 4.x
// causes an exception in UnityEditor.Graphs. To make it compatible
// with the previous version of the .NET runtime (surprisingly, it
// always returns true without any meaningful process), we overwrite
// useCompatibleTypeConversion (private variable) using reflection.
static void ForceTypeConverterCompatibility()
{
#if UNITY_EDITOR && (NET_4_6 || NET_STANDARD_2_0)
typeof(System.ComponentModel.TypeConverter).
GetField("useCompatibleTypeConversion",
System.Reflection.BindingFlags.NonPublic |
System.Reflection.BindingFlags.Static).
SetValue(null, true);
#endif
}

#endregion
}
}
8 changes: 8 additions & 0 deletions Assets/Klak/Wiring/Runtime.meta

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

File renamed without changes.
File renamed without changes.
Loading

0 comments on commit b38ec4d

Please sign in to comment.