unity-types 6000.3.5 → 6000.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -47,12 +47,12 @@ pos.x = 10
47
47
  const button = new CS.UnityEngine.UIElements.Button()
48
48
  button.text = "Click me"
49
49
 
50
- // Physics
51
- const rb: CS.UnityEngine.Rigidbody = go.AddComponent($typeof(CS.UnityEngine.Rigidbody))
50
+ // Physics — generic overloads return the correct type directly
51
+ const rb = go.AddComponent(CS.UnityEngine.Rigidbody) // Type: Rigidbody
52
52
  rb.mass = 5
53
53
 
54
54
  // Audio
55
- const audio: CS.UnityEngine.AudioSource = go.GetComponent($typeof(CS.UnityEngine.AudioSource))
55
+ const audio = go.GetComponent(CS.UnityEngine.AudioSource) // Type: AudioSource
56
56
  audio.Play()
57
57
 
58
58
  // Web requests
package/_system.d.ts CHANGED
@@ -88,8 +88,10 @@ declare namespace CS {
88
88
  }
89
89
 
90
90
  // Generic array (T[])
91
+ // Uses PascalCase `Length` to match C# Array.Length.
92
+ // Use toArray() from onejs-react to convert to a JS array with .length, .map(), etc.
91
93
  interface Array$1<T> {
92
- readonly length: number;
94
+ readonly Length: number;
93
95
  [index: number]: T;
94
96
  get_Item($index: number): T;
95
97
  set_Item($index: number, $value: T): void;
package/index.d.ts CHANGED
@@ -44,6 +44,10 @@ declare module "UnityEngine/UIElements" {
44
44
  export = CS.UnityEngine.UIElements;
45
45
  }
46
46
 
47
+ declare module "UnityEngine/SceneManagement" {
48
+ export = CS.UnityEngine.SceneManagement;
49
+ }
50
+
47
51
  declare module "System" {
48
52
  export = CS.System;
49
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unity-types",
3
- "version": "6000.3.5",
3
+ "version": "6000.3.7",
4
4
  "description": "TypeScript definitions for Unity 6000.3",
5
5
  "types": "index.d.ts",
6
6
  "repository": {