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 +3 -3
- package/_system.d.ts +3 -1
- package/index.d.ts +4 -0
- package/package.json +1 -1
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
|
|
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
|
|
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
|
|
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