jacksondunstan / UnityNativeScripting

Unity Scripting in C++
https://jacksondunstan.com/articles/3938
MIT License
1.34k stars 135 forks source link

Generate code failed without any error Log.. #50

Closed Zoranner closed 4 years ago

Zoranner commented 4 years ago

Debug content: Done generating bindings in 0.0908891 seconds. But nothing was generated.

My NativeScriptTypes.json content:

{
  "Assemblies": [
  ],
  "Types": [
    {
      "Name": " System.IFormattable"
    },
    {
      "Name": " System.IConvertible"
    },
    {
      "Name": " System.IComparable"
    },
    {
      "Name": "System.IEquatable`1",
      "GenericParams": [
        {
          "Types": [
            "System.Boolean"
          ]
        },
        {
          "Types": [
            "System.Char"
          ]
        },
        {
          "Types": [
            "System.SByte"
          ]
        },
        {
          "Types": [
            "System.Byte"
          ]
        },
        {
          "Types": [
            "System.Int16"
          ]
        },
        {
          "Types": [
            "System.UInt16"
          ]
        },
        {
          "Types": [
            "System.Int32"
          ]
        },
        {
          "Types": [
            "System.UInt32"
          ]
        },
        {
          "Types": [
            "System.Int64"
          ]
        },
        {
          "Types": [
            "System.UInt64"
          ]
        },
        {
          "Types": [
            "System.Single"
          ]
        },
        {
          "Types": [
            "System.Double"
          ]
        },
        {
          "Types": [
            "System.Decimal"
          ]
        },
        {
          "Types": [
            "UnityEngine.Vector3"
          ]
        }
      ]
    },
    {
      "Name": "System.IComparable`1",
      "GenericParams": [
        {
          "Types": [
            "System.Boolean"
          ]
        },
        {
          "Types": [
            "System.Char"
          ]
        },
        {
          "Types": [
            "System.SByte"
          ]
        },
        {
          "Types": [
            "System.Byte"
          ]
        },
        {
          "Types": [
            "System.Int16"
          ]
        },
        {
          "Types": [
            "System.UInt16"
          ]
        },
        {
          "Types": [
            "System.Int32"
          ]
        },
        {
          "Types": [
            "System.UInt32"
          ]
        },
        {
          "Types": [
            "System.Int64"
          ]
        },
        {
          "Types": [
            "System.UInt64"
          ]
        },
        {
          "Types": [
            "System.Single"
          ]
        },
        {
          "Types": [
            "System.Double"
          ]
        },
        {
          "Types": [
            "System.Decimal"
          ]
        }
      ]
    },
    {
      "Name": " System.Runtime.Serialization.IDeserializationCallback"
    },
    {
      "Name": "System.Decimal",
      "Constructors": [
        {
          "ParamTypes": [
            "System.Double"
          ]
        },
        {
          "ParamTypes": [
            "System.UInt64"
          ]
        }
      ]
    },
    {
      "Name": "UnityEngine.Vector3",
      "Constructors": [
        {
          "ParamTypes": [
            "System.Single",
            "System.Single",
            "System.Single"
          ]
        }
      ],
      "Methods": [
        {
          "Name": "x+y",
          "ParamTypes": [
            "UnityEngine.Vector3",
            "UnityEngine.Vector3"
          ]
        }
      ]
    },
    {
      "Name": "UnityEngine.Object",
      "Properties": [
        {
          "Name": "name",
          "Get": {},
          "Set": {}
        }
      ]
    },
    {
      "Name": "UnityEngine.Component",
      "Properties": [
        {
          "Name": "transform",
          "Get": {}
        }
      ]
    },
    {
      "Name": "UnityEngine.Transform",
      "Properties": [
        {
          "Name": "position",
          "Get": {},
          "Set": {
            "Exceptions": [
              "System.NullReferenceException"
            ]
          }
        }
      ]
    },
    {
      "Name": "UnityEngine.Texture"
    },
    {
      "Name": "UnityEngine.Resources",
      "Methods": [
        {
          "GenericParams": [
            {
              "Types": [
                "UnityEngine.Texture"
              ]
            }
          ],
          "Name": "Load",
          "ParamTypes": [
            "System.String"
          ]
        }
      ]
    },
    {
      "Name": "System.Collections.IEnumerator",
      "Methods": [
        {
          "Name": "MoveNext",
          "ParamTypes": []
        }
      ],
      "Properties": [
        {
          "Name": "Current",
          "Get": {},
          "Set": {}
        }
      ]
    },
    {
      "Name": "System.Runtime.Serialization.ISerializable"
    },
    {
      "Name": "System.Runtime.InteropServices._Exception"
    },
    {
      "Name": "UnityEngine.GameObject",
      "Constructors": [
      ],
      "Methods": [
        {
          "Name": "AddComponent",
          "ParamTypes": [],
          "GenericParams": [
            {
              "Types": [
                "MyGame.BaseBallScript"
              ]
            }
          ]
        },
        {
          "Name": "CreatePrimitive",
          "ParamTypes": [
            "UnityEngine.PrimitiveType"
          ]
        }
      ]
    },
    {
      "Name": "UnityEngine.Debug",
      "Methods": [
        {
          "Name": "Log",
          "ParamTypes": [
            "System.Object"
          ]
        }
      ]
    },
    {
      "Name": "UnityEngine.Behaviour"
    },
    {
      "Name": "UnityEngine.MonoBehaviour",
      "Properties": [
        {
          "Name": "transform",
          "Get": {},
          "Set": {}
        }
      ]
    },
    {
      "Name": "System.Exception",
      "Constructors": [
        {
          "ParamTypes": [
            "System.String"
          ]
        }
      ]
    },
    {
      "Name": "System.SystemException"
    },
    {
      "Name": "System.NullReferenceException"
    },
    {
      "Name": "UnityEngine.PrimitiveType"
    },
    {
      "Name": "UnityEngine.Time",
      "Properties": [
        {
          "Name": "deltaTime",
          "Get": {},
          "Set": {}
        }
      ]
    },
    {
      "Name": "MyGame.AbstractBaseBallScript",
      "BaseTypes": [
        {
          "BaseName": "MyGame.BaseBallScript",
          "DerivedName": "MyGame.BallScript"
        }
      ]
    }
  ],
  "Arrays": [
  ],
  "Delegates": [
  ]
}
jacksondunstan commented 4 years ago

I just tried your NativeScriptTypes.json in a fresh clone of the repo with Unity 2019.2.9f1 and bindings were generated for me. Just as a reminder, the files to look for changes in are:

For example, in Bindings.cpp I see line 58 added after generating with your NativeScriptTypes.json:

    int32_t (*UnityEngineResourcesMethodLoadUnityEngineTextureSystemString)(int32_t pathHandle);
Zoranner commented 4 years ago

I just tried your NativeScriptTypes.json in a fresh clone of the repo with Unity 2019.2.9f1 and bindings were generated for me. Just as a reminder, the files to look for changes in are:

  • Unity/Assets/CppSource/NativeScript/Bindings.cpp
  • Unity/Assets/CppSource/NativeScript/Bindings.h
  • Unity/Assets/NativeScript/Bindings.cs

For example, in Bindings.cpp I see line 58 added after generating with your NativeScriptTypes.json:

  int32_t (*UnityEngineResourcesMethodLoadUnityEngineTextureSystemString)(int32_t pathHandle);

ok, thank u, i will try it with 2019.2.9...