From 3fc8e713ada8b811e3d992f62cda266f7a4582f3 Mon Sep 17 00:00:00 2001 From: BLUELOVETH Date: Fri, 11 Aug 2023 13:36:20 +0800 Subject: [PATCH] ... --- docs/unity/bindings.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/unity/bindings.md b/docs/unity/bindings.md index bc6b045e..24da72f0 100644 --- a/docs/unity/bindings.md +++ b/docs/unity/bindings.md @@ -24,10 +24,10 @@ class like the following. ```csharp public class PyVector2Type: PyTypeObject{ // The name of the type in Python - public override string name => "Vector2"; + public override string Name => "Vector2"; // The corresponding C# type - public override System.Type type => typeof(Vector2); + public override System.Type CSType => typeof(Vector2); } ``` @@ -46,8 +46,8 @@ With `__add__`, `Vector2` object in Python can be added with another `Vector2` o ```csharp public class PyVector2Type: PyTypeObject{ - public override string name => "Vector2"; - public override System.Type type => typeof(Vector2); + public override string Name => "Vector2"; + public override System.Type CSType => typeof(Vector2); [PythonBinding] public object __add__(Vector2 self, object other){ @@ -76,8 +76,8 @@ In this case, you need to define `__mul__` and `__rmul__` at the same time. ```csharp public class PyVector2Type: PyTypeObject{ - public override string name => "Vector2"; - public override System.Type type => typeof(Vector2); + public override string Name => "Vector2"; + public override System.Type CSType => typeof(Vector2); // ... @@ -100,8 +100,8 @@ Finally, let's implement the constructor of `Vector2`. ```csharp public class PyVector2Type: PyTypeObject{ - public override string name => "Vector2"; - public override System.Type type => typeof(Vector2); + public override string Name => "Vector2"; + public override System.Type CSType => typeof(Vector2); [PythonBinding] public object __new__(PyTypeObject cls, params object[] args){ @@ -132,8 +132,8 @@ So our setter will not be able to modify the original `Vector2` object. ```csharp public class PyVector2Type: PyTypeObject{ - public override string name => "Vector2"; - public override System.Type type => typeof(Vector2); + public override string Name => "Vector2"; + public override System.Type CSType => typeof(Vector2); [PythonBinding(BindingType.Getter)] public object x(Vector2 self) => self.x;