-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodules.json
More file actions
6010 lines (6010 loc) · 232 KB
/
modules.json
File metadata and controls
6010 lines (6010 loc) · 232 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"painter": {
"display_painter": {
"label": "display_painter",
"meta": "func",
"title": "Auto-import from painter",
"description": "#### display_painter(painter) → Function\nReturns a function that turns a given Frame into a Drawing, given the painter",
"parameters": [
"painter"
]
},
"draw_line": {
"label": "draw_line",
"meta": "func",
"title": "Auto-import from painter",
"description": "#### draw_line(v_start, v_end) → void\nDraw a line from v\\_start to v\\_end",
"parameters": [
"v_start",
"v_end"
]
}
},
"unity_academy": {
"add_impulse_force": {
"label": "add_impulse_force",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### add_impulse_force(gameObjectIdentifier, force) → void\nAdd an impulse force on the Rigidbody attached on the GameObject, **using its mass**.\n\nUsage of all physics functions under the Physics category requires calling `apply_rigidbody` first on the applied game objects.",
"parameters": [
"gameObjectIdentifier",
"force"
]
},
"add_vectors": {
"label": "add_vectors",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### add_vectors(vectorA, vectorB) → Vector3\nAdd two 3D vectors together.",
"parameters": [
"vectorA",
"vectorB"
]
},
"apply_rigidbody": {
"label": "apply_rigidbody",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### apply_rigidbody(gameObjectIdentifier) → void\nApply rigidbody (2D or 3D based on the current dimension mode) to the given GameObject to use Unity's physics engine.\n\nAll other functions under the Physics - Rigidbody category require calling this function first on the applied GameObjects.\n\nFor more information, see\n\n* https://docs.unity3d.com/ScriptReference/Rigidbody.html (For 3D Mode)\n* https://docs.unity3d.com/ScriptReference/Rigidbody2D.html (For 2D Mode)",
"parameters": [
"gameObjectIdentifier"
]
},
"copy_position": {
"label": "copy_position",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### copy_position(from, to, deltaPosition) → void\nCopy the position values from one GameObject to another GameObject along with delta values.\n\nSet one or more coordinate value(s) in the `deltaPosition` Vector3 to the exact value \"999999\" (six nines) to remain the position of the destination GameObject on the corresponding axis/axes unaffected by this function.",
"parameters": [
"from",
"to",
"deltaPosition"
]
},
"copy_rotation": {
"label": "copy_rotation",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### copy_rotation(from, to, deltaRotation) → void\nCopy the rotation values (Euler angles) from one GameObject to another GameObject along with delta values.\n\nSet one or more coordinate value(s) in the `deltaPosition` Vector3 to the exact value \"999999\" (six nines) to remain the rotation of the destination GameObject on the corresponding axis/axes unaffected by this function.",
"parameters": [
"from",
"to",
"deltaRotation"
]
},
"copy_scale": {
"label": "copy_scale",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### copy_scale(from, to, deltaScale) → void\nCopy the scale values from one GameObject to another GameObject along with delta values.\n\nSet one or more coordinate value(s) in the `deltaPosition` Vector3 to the exact value \"999999\" (six nines) to remain the scale of the destination GameObject on the corresponding axis/axes unaffected by this function.",
"parameters": [
"from",
"to",
"deltaScale"
]
},
"cross": {
"label": "cross",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### cross(vectorA, vectorB) → Vector3\nCalcuate the cross product of two 3D vectors.",
"parameters": [
"vectorA",
"vectorB"
]
},
"debug_log": {
"label": "debug_log",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### debug_log(content) → void\nLog to Unity Academy Embedded Frontend's console.\n\nYou can use rich text for the parameter `content`.",
"parameters": [
"content"
]
},
"debug_logerror": {
"label": "debug_logerror",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### debug_logerror(content) → void\nLog to Unity Academy Embedded Frontend's console, with red font color as highlighting.\n\nNote that this function does not \"really\" throw any error. It just logs a message with red font color and the student code will continue running normally after calling this function to log the error.\n\nYou can use rich text for the parameter `content`.",
"parameters": [
"content"
]
},
"debug_logwarning": {
"label": "debug_logwarning",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### debug_logwarning(content) → void\nLog to Unity Academy Embedded Frontend's console, with yellow font color as highlighting.\n\nYou can use rich text for the parameter `content`.",
"parameters": [
"content"
]
},
"delta_time": {
"label": "delta_time",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### delta_time() → number\nReturns the value of Time.deltaTime in Unity ( roughly saying it's about `1 / instant_frame_rate_per_second` )\n\nThis should be useful when implementing timers or constant speed control in Update function.\n\nFor example:\n\n function update(gameObject){\n const move_speed = 3;\n translate_world(gameObject, 0, 0, move_speed * delta_time());\n }\n\nBy assigning the above code to a GameObject with `set_update`, that GameObject will move in a constant speed for about 3 units per second along world +Z axis.\n\nFor more information, see https://docs.unity3d.com/ScriptReference/Time-deltaTime.html",
"parameters": []
},
"destroy": {
"label": "destroy",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### destroy(gameObjectIdentifier) → void\nRemoves a GameObject\n\nNote that this won't remove the GameObject immediately, the actual removal will happen at the end of the current main cycle loop.\n\nFor more information, see https://docs.unity3d.com/ScriptReference/Object.Destroy.html",
"parameters": [
"gameObjectIdentifier"
]
},
"dot": {
"label": "dot",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### dot(vectorA, vectorB) → number\nCalcuate the dot product of two 3D vectors.",
"parameters": [
"vectorA",
"vectorB"
]
},
"gameobject_distance": {
"label": "gameobject_distance",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### gameobject_distance(gameObjectIdentifier_A, gameObjectIdentifier_B) → number\nCalcuate the distance between two GameObjects, based on each other's position",
"parameters": [
"gameObjectIdentifier_A",
"gameObjectIdentifier_B"
]
},
"get_angular_velocity": {
"label": "get_angular_velocity",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### get_angular_velocity(gameObjectIdentifier) → Vector3\nReturns the angular velocity of the rigidbody attached on the game object.\n\nUsage of all physics functions under the Physics - Rigidbody category requires calling `apply_rigidbody` first on the applied game objects.\n\n\\*\\*2D Mode Special: \\*\\*In 2D mode there is no angular velocity on X nor Y axis, so in the X and Y values in the returned Vector3 will always be zero.",
"parameters": [
"gameObjectIdentifier"
]
},
"get_custom_prop": {
"label": "get_custom_prop",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### get_custom_prop(gameObjectIdentifier, propName) → any\nGet the value of a custom property with its name on a GameObject",
"parameters": [
"gameObjectIdentifier",
"propName"
]
},
"get_key": {
"label": "get_key",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### get_key(keyCode) → boolean\nWhen user presses a key on the keyboard or mouse button, this function will return true in every frame that the key is still being pressed and false otherwise.\n\nFor more information, see https://docs.unity3d.com/ScriptReference/Input.GetKey.html",
"parameters": [
"keyCode"
]
},
"get_key_down": {
"label": "get_key_down",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### get_key_down(keyCode) → boolean\nWhen user presses a key on the keyboard or mouse button, this function will return true only at the frame when the key is just pressed down and return false afterwards.\n\nFor more information, see https://docs.unity3d.com/ScriptReference/Input.GetKeyDown.html",
"parameters": [
"keyCode"
]
},
"get_key_up": {
"label": "get_key_up",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### get_key_up(keyCode) → boolean\nWhen user releases a pressed key on the keyboard or mouse button, this function will return true only at the frame when the key is just released up and return false otherwise.\n\nFor more information, see https://docs.unity3d.com/ScriptReference/Input.GetKeyUp.html",
"parameters": [
"keyCode"
]
},
"get_main_camera_following_target": {
"label": "get_main_camera_following_target",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### get_main_camera_following_target() → GameObjectIdentifier\nGet the main camera following target GameObject (an invisible GameObject) to use it to control the position of the main camera with the default camera controller.\n\n* **In 3D mode**, the default camera controller behaves as third-person camera controller, and the center to follow is the following target GameObject. Also, Unity Academy will automatically set the rotation of this \"following target\" to the same rotation as the current main camera's rotation to let you get the main camera's rotation.\n* **In 2D mode**, the default camera controller will follow the target GameObject to move, along with a position delta value that you can adjust with the arrow keys on your keyboard.\n\nThe main camera following target GameObject is a primitive GameObject. This means that you are not allowed to destroy it and/or instantiate it during runtime. Multiple calls to this function will return GameObject identifiers that refer to the same primitive GameObject.\n\n**If default main camera controllers are disabled (you have called `request_for_main_camera_control`), then the following target GameObject is useless.**",
"parameters": []
},
"get_mass": {
"label": "get_mass",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### get_mass(gameObjectIdentifier) → number\nReturns the mass of the rigidbody attached on the GameObject.\n\nUsage of all physics functions under the Physics - Rigidbody category requires calling `apply_rigidbody` first on the applied game objects.",
"parameters": [
"gameObjectIdentifier"
]
},
"get_position": {
"label": "get_position",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### get_position(gameObjectIdentifier) → Vector3\nReturns the world position of a given GameObject",
"parameters": [
"gameObjectIdentifier"
]
},
"get_rotation_euler": {
"label": "get_rotation_euler",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### get_rotation_euler(gameObjectIdentifier) → Vector3\nReturns the world Euler angle rotation of a given GameObject",
"parameters": [
"gameObjectIdentifier"
]
},
"get_scale": {
"label": "get_scale",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### get_scale(gameObjectIdentifier) → Vector3\nReturns the scale (size factor) of a given GameObject\n\nBy default the scale of a GameObject is (1, 1, 1)",
"parameters": [
"gameObjectIdentifier"
]
},
"get_velocity": {
"label": "get_velocity",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### get_velocity(gameObjectIdentifier) → Vector3\nReturns the velocity of the rigidbody attached on the GameObject.\n\nUsage of all physics functions under the Physics - Rigidbody category requires calling `apply_rigidbody` first on the applied game objects.",
"parameters": [
"gameObjectIdentifier"
]
},
"get_x": {
"label": "get_x",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### get_x(vector) → number\nGet the X component of a 3D vector",
"parameters": [
"vector"
]
},
"get_y": {
"label": "get_y",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### get_y(vector) → number\nGet the Y component of a 3D vector",
"parameters": [
"vector"
]
},
"get_z": {
"label": "get_z",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### get_z(vector) → number\nGet the Z component of a 3D vector",
"parameters": [
"vector"
]
},
"gui_button": {
"label": "gui_button",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### gui_button(text, x, y, width, height, onClick) → void\nMake a button on the screen with given **screen space position** in the current frame. When user clicks the button, the `onClick` function will be called.\n\nThe origin of screen space is upper-left corner and the positive Y direction is downward.\n\nThe drawn button will only last for one frame. You should put this under the `Update` function (or a function that is called by the `Update` function) to keep the button stays in every frame.\n\nIf this function is called by a lifecycle event function, then the `onClick` function in the fourth parameter could also be considered as a lifecycle event function.\n\nThis means that you can use other functions from this module inside the `onClick` function, even though the functions are not under the `Outside Lifecycle` category.\n\nFor example, the code piece below\n\n import {init_unity_academy_3d, set_start, set_update, instantiate, gui_button, set_position }\n from \"unity_academy\";\n init_unity_academy_3d();\n \n const cube = instantiate(\"cube\");\n \n const cube_update = (gameObject) => {\n gui_button(\"Button\", 1000, 300, 200, 50, ()=>\n set_position(gameObject, 0, 10, 6) // calling set_position inside the onClick function\n );\n };\n \n set_update(cube, cube_update);\n\nis correct.\n\nYou can use rich text for the parameter `text`. For example: `gui_button(\"<color=#AA00FF>Hello World</color>\", 100, 100, 200, 50, my_onclick_function);`",
"parameters": [
"text",
"x",
"y",
"width",
"height",
"onClick"
]
},
"gui_label": {
"label": "gui_label",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### gui_label(text, x, y) → void\nDraw a text (string) on the screen with given **screen space position** in the current frame.\n\nThe origin of screen space is upper-left corner and the positive Y direction is downward.\n\nThe drawn text will only last for one frame. You should put this under the `Update` function (or a function that is called by the `Update` function) to keep the text stays in every frame.\n\nYou can use rich text for the parameter `text`. For example: `gui_label(\"<color=#AA00FF>Hello World</color>\", 100, 100);`",
"parameters": [
"text",
"x",
"y"
]
},
"init_unity_academy_2d": {
"label": "init_unity_academy_2d",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### init_unity_academy_2d() → void\nLoad and initialize Unity Academy WebGL player and set it to 2D mode. All other functions (except Maths functions) in this module requires calling this function or `init_unity_academy_3d` first.\n\nI recommand you just call this function at the beginning of your Source Unity program under the 'import' statements.",
"parameters": []
},
"init_unity_academy_3d": {
"label": "init_unity_academy_3d",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### init_unity_academy_3d() → void\nLoad and initialize Unity Academy WebGL player and set it to 3D mode. All other functions (except Maths functions) in this module requires calling this function or `init_unity_academy_2d` first.\n\nI recommand you just call this function at the beginning of your Source Unity program under the 'import' statements.",
"parameters": []
},
"instantiate": {
"label": "instantiate",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### instantiate(prefab_name) → GameObjectIdentifier\nCreates a new GameObject from an existing Prefab\n\n**3D mode only**\n\nA prefab is something that is pre-built and can be created and used as a whole.\n\nAvailable Prefab Information: <a href = 'https://unity-academy.s3.ap-southeast-1.amazonaws.com/webgl\\_assetbundles/prefab\\_info.html' rel=\"noopener noreferrer\" target=\"\\_blank\">Click Here</a>",
"parameters": [
"prefab_name"
]
},
"instantiate_empty": {
"label": "instantiate_empty",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### instantiate_empty() → GameObjectIdentifier\nCreates a new empty GameObject.\n\nAn empty GameObject is invisible and only have transform properties by default.\n\nYou may use the empty GameObject to run some general game management code or use the position of the empty GameObject to represent a point in the scene that the rest of your codes can access and utilize.",
"parameters": []
},
"instantiate_sprite": {
"label": "instantiate_sprite",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### instantiate_sprite(sourceImageUrl) → GameObjectIdentifier\nCreates a new 2D Sprite GameObject from an online image.\n\nThe Sprite GameObject has a BoxCollider2D that matches its size by default. You may use `remove_collider_components` function to remove the default collider.\n\nNote that Unity Academy will use a HTTP GET request to download the image, which means that the HTTP response from the URL must allows CORS.\n\n**2D mode only**",
"parameters": [
"sourceImageUrl"
]
},
"look_at": {
"label": "look_at",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### look_at(gameObjectIdentifier, position) → void\nRotates the GameObject's transform so the local forward vector points at the given position.\n\nThe +Z direction of the GameObject (with respect to the GameObject's local space), which denotes forward in Unity's conventions, will pointing to the given position.\n\nFor more information, see https://docs.unity3d.com/ScriptReference/Transform.LookAt.html",
"parameters": [
"gameObjectIdentifier",
"position"
]
},
"magnitude": {
"label": "magnitude",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### magnitude(vector) → number\nCalcuate the magnitude of a vector",
"parameters": [
"vector"
]
},
"normalize": {
"label": "normalize",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### normalize(vector) → Vector3\nNormalize a vector. The returned vector will have the same direction as the original vector but have a magnitude of 1.",
"parameters": [
"vector"
]
},
"on_collision_enter": {
"label": "on_collision_enter",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### on_collision_enter(gameObjectIdentifier, eventFunction) → void\nSet the lifecycle event function that will be called when the collider on this GameObject just starting colliding with another collider.\n\nThe given function should contain two parameters. The first parameter refers to the binded GameObject and the second parameter refers to the other GameObject that collides with the binded GameObject (both parameters are GameObject identifiers).\n\nFor example: `const myFunction = (self, other) => {...};`\n\n* Note that for collision detaction to happen, for the two colliding GameObjects:\n * if **in 3D mode**, both GameObjects must applied Rigidbody by `apply_rigidbody`\n * if **in 2D mode**, at least one GameObject must applied Rigidbody by `apply_rigidbody`\n\nFor more information, see\n\n* https://docs.unity3d.com/ScriptReference/Collider.OnCollisionEnter.html (For 3D Mode)\n* https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnCollisionEnter2D.html (For 2D Mode)",
"parameters": [
"gameObjectIdentifier",
"eventFunction"
]
},
"on_collision_exit": {
"label": "on_collision_exit",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### on_collision_exit(gameObjectIdentifier, eventFunction) → void\nSet the lifecycle event function that will be called when the collider on this GameObject just stops colliding with another collider.\n\nThe given function should contain two parameters. The first parameter refers to the binded GameObject and the second parameter refers to the other GameObject that collides with the binded GameObject (both parameters are GameObject identifiers).\n\nFor example: `const myFunction = (self, other) => {...};`\n\n* Note that for collision detaction to happen, for the two colliding GameObjects:\n * if **in 3D mode**, both GameObjects must applied Rigidbody by `apply_rigidbody`\n * if **in 2D mode**, at least one GameObject must applied Rigidbody by `apply_rigidbody`\n\nFor more information, see\n\n* https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnCollisionExit.html (For 3D Mode)\n* https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnCollisionExit2D.html (For 2D Mode)",
"parameters": [
"gameObjectIdentifier",
"eventFunction"
]
},
"on_collision_stay": {
"label": "on_collision_stay",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### on_collision_stay(gameObjectIdentifier, eventFunction) → void\nSet the lifecycle event function that will be called per frame when the collider on this GameObject is colliding with another collider.\n\nThe given function should contain two parameters. The first parameter refers to the binded GameObject and the second parameter refers to the other GameObject that collides with the binded GameObject (both parameters are GameObject identifiers).\n\nFor example: `const myFunction = (self, other) => {...};`\n\n* Note that for collision detaction to happen, for the two colliding GameObjects:\n * if **in 3D mode**, both GameObjects must applied Rigidbody by `apply_rigidbody`\n * if **in 2D mode**, at least one GameObject must applied Rigidbody by `apply_rigidbody`\n\nFor more information, see\n\n* https://docs.unity3d.com/ScriptReference/Collider.OnCollisionStay.html (For 3D Mode)\n* https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnCollisionStay2D.html (For 2D Mode)",
"parameters": [
"gameObjectIdentifier",
"eventFunction"
]
},
"play_animator_state": {
"label": "play_animator_state",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### play_animator_state(gameObjectIdentifier, animatorStateName) → void\nPlays an Unity animation state with given name on the GameObject's animator. Note that not all game objects have Unity animations. You should ask the people who provided you the prefab asset bundle for available animation names assigned to the prefab.\n\nIf you provide an invalid animator state name, this function will not take effect.\n\n**3D mode only**",
"parameters": [
"gameObjectIdentifier",
"animatorStateName"
]
},
"point_distance": {
"label": "point_distance",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### point_distance(pointA, pointB) → number\nCalcuate the distance between two 3D points",
"parameters": [
"pointA",
"pointB"
]
},
"remove_collider_components": {
"label": "remove_collider_components",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### remove_collider_components(gameObjectIdentifier) → void\nRemoves all collider components directly attached on the given GameObject by default.\n\nYou can use this function on GameObjects those you don't want them to collide with other GameObjects.\n\nFor example, you may use this on the background image sprite GameObject in 2D scene.",
"parameters": [
"gameObjectIdentifier"
]
},
"request_for_main_camera_control": {
"label": "request_for_main_camera_control",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### request_for_main_camera_control() → GameObjectIdentifier\nRequest for main camera control and get a GameObject identifier that can directly be used to control the main camera's position and rotation.\n\nWhen you request for the direct control over main camera with this function, the default camera controllers will be disabled, thus the GameObject identifier returned by `get_main_camera_following_target` will become useless, as you can no longer use the default main camera controllers.\n\nThis function is for totally customizing the position and rotation of the main camera. If you'd like to simplify the camera controlling with the help of the default camera controllers in Unity Academy, please consider use `get_main_camera_following_target` function.",
"parameters": []
},
"rotate_world": {
"label": "rotate_world",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### rotate_world(gameObjectIdentifier, angles) → void\nRotates a GameObject with given x, y and z values (Euler angle)",
"parameters": [
"gameObjectIdentifier",
"angles"
]
},
"same_gameobject": {
"label": "same_gameobject",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### same_gameobject(first, second) → boolean\nDetermines whether two GameObject identifiers refers to the same GameObject.",
"parameters": [
"first",
"second"
]
},
"scale_vector": {
"label": "scale_vector",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### scale_vector(vector, factor) → Vector3\nScales a 3D vector with the given factor.",
"parameters": [
"vector",
"factor"
]
},
"set_angular_drag": {
"label": "set_angular_drag",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### set_angular_drag(gameObjectIdentifier, value) → void\nSet the angular drag (similar to an air resistance that affects angular velocity) the rigidbody attached on the game object.\n\nBy default the angular drag is 0.05\n\nUsage of all physics functions under the Physics - Rigidbody category requires calling `apply_rigidbody` first on the applied game objects.",
"parameters": [
"gameObjectIdentifier",
"value"
]
},
"set_angular_velocity": {
"label": "set_angular_velocity",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### set_angular_velocity(gameObjectIdentifier, angularVelocity) → void\nSet the angular velocity of the rigidbody attached on the game object.\n\nUsage of all physics functions under the Physics - Rigidbody category requires calling `apply_rigidbody` first on the applied game objects.\n\n\\*\\*2D Mode Special: \\*\\*In 2D mode there is no angular velocity on X nor Y axis, so the X and Y values in the Vector3 is ignored.",
"parameters": [
"gameObjectIdentifier",
"angularVelocity"
]
},
"set_custom_prop": {
"label": "set_custom_prop",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### set_custom_prop(gameObjectIdentifier, propName, value) → void\nSet a custom property with name and value on a GameObject",
"parameters": [
"gameObjectIdentifier",
"propName",
"value"
]
},
"set_drag": {
"label": "set_drag",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### set_drag(gameObjectIdentifier, value) → void\nSet the drag (similar to air resistance) the rigidbody attached on the game object.\n\nBy default the drag is zero.\n\nUsage of all physics functions under the Physics - Rigidbody category requires calling `apply_rigidbody` first on the applied game objects.",
"parameters": [
"gameObjectIdentifier",
"value"
]
},
"set_mass": {
"label": "set_mass",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### set_mass(gameObjectIdentifier, mass) → void\nSet the mass of the rigidbody attached on the game object.\n\nUsage of all physics functions under the Physics - Rigidbody category requires calling `apply_rigidbody` first on the applied game objects.",
"parameters": [
"gameObjectIdentifier",
"mass"
]
},
"set_position": {
"label": "set_position",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### set_position(gameObjectIdentifier, position) → void\nSet the world position of a given GameObject",
"parameters": [
"gameObjectIdentifier",
"position"
]
},
"set_rotation_euler": {
"label": "set_rotation_euler",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### set_rotation_euler(gameObjectIdentifier, rotation) → void\nSet the world rotation of a given GameObject with given Euler angle rotation.",
"parameters": [
"gameObjectIdentifier",
"rotation"
]
},
"set_scale": {
"label": "set_scale",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### set_scale(gameObjectIdentifier, scale) → void\nSet the scale (size) of a given GameObject\n\nBy default the scale of a GameObject is (1, 1, 1). Changing the scale of a GameObject along one axis will lead to a stretch or squeeze of the GameObject along that axis.",
"parameters": [
"gameObjectIdentifier",
"scale"
]
},
"set_start": {
"label": "set_start",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### set_start(gameObjectIdentifier, startFunction) → void\nSets the Start function of a given GameObject",
"parameters": [
"gameObjectIdentifier",
"startFunction"
]
},
"set_update": {
"label": "set_update",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### set_update(gameObjectIdentifier, updateFunction) → void\nSets the Update function of a given GameObject",
"parameters": [
"gameObjectIdentifier",
"updateFunction"
]
},
"set_use_gravity": {
"label": "set_use_gravity",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### set_use_gravity(gameObjectIdentifier, useGravity) → void\nSet whether the rigidbody attached on the game object should calculate for gravity.\n\nUsage of all physics functions under the Physics - Rigidbody category requires calling `apply_rigidbody` first on the applied game objects.",
"parameters": [
"gameObjectIdentifier",
"useGravity"
]
},
"set_velocity": {
"label": "set_velocity",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### set_velocity(gameObjectIdentifier, velocity) → void\nSet the (linear) velocity of the rigidbody attached on the GameObject.\n\nUsage of all physics functions under the Physics - Rigidbody category requires calling `apply_rigidbody` first on the applied game objects.",
"parameters": [
"gameObjectIdentifier",
"velocity"
]
},
"translate_local": {
"label": "translate_local",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### translate_local(gameObjectIdentifier, deltaPosition) → void\nMoves a GameObject with given x, y and z values, **with respect to its local space**.\n\nThe current rotation of the GameObject will affect the real direction of movement.\n\nIn Unity, usually, the direction of +Z axis denotes forward.",
"parameters": [
"gameObjectIdentifier",
"deltaPosition"
]
},
"translate_world": {
"label": "translate_world",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### translate_world(gameObjectIdentifier, deltaPosition) → void\nMoves a GameObject with given x, y and z values",
"parameters": [
"gameObjectIdentifier",
"deltaPosition"
]
},
"vector3": {
"label": "vector3",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### vector3(x, y, z) → Vector3\nCreate a 3D vector",
"parameters": [
"x",
"y",
"z"
]
},
"vector_difference": {
"label": "vector_difference",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### vector_difference(vectorA, vectorB) → Vector3\nCalcuate the vector difference between two vectors (vectorA - vectorB).",
"parameters": [
"vectorA",
"vectorB"
]
},
"zero_vector": {
"label": "zero_vector",
"meta": "func",
"title": "Auto-import from unity_academy",
"description": "#### zero_vector() → Vector3\nGet the zero vector",
"parameters": []
}
},
"plotly": {
"draw_connected_2d": {
"label": "draw_connected_2d",
"meta": "func",
"title": "Auto-import from plotly",
"description": "#### draw_connected_2d(numPoints) → CurvePlotFunction\nReturns a function that turns a given Curve into a Drawing, by sampling the Curve at `num` sample points and connecting each pair with a line.",
"parameters": [
"numPoints"
]
},
"draw_connected_3d": {
"label": "draw_connected_3d",
"meta": "func",
"title": "Auto-import from plotly",
"description": "#### draw_connected_3d(numPoints) → CurvePlotFunction\nReturns a function that turns a given 3D Curve into a Drawing, by sampling the 3D Curve at `num` sample points and connecting each pair with a line.",
"parameters": [
"numPoints"
]
},
"draw_points_2d": {
"label": "draw_points_2d",
"meta": "func",
"title": "Auto-import from plotly",
"description": "#### draw_points_2d(numPoints) → CurvePlotFunction\nReturns a function that turns a given Curve into a Drawing, by sampling the Curve at num sample points. The Drawing consists of isolated points, and does not connect them. When a program evaluates to a Drawing, the Source system displays it graphically, in a window,\n\n\\*",
"parameters": [
"numPoints"
]
},
"draw_points_3d": {
"label": "draw_points_3d",
"meta": "func",
"title": "Auto-import from plotly",
"description": "#### draw_points_3d(numPoints) → CurvePlotFunction\nReturns a function that turns a given 3D Curve into a Drawing, by sampling the 3D Curve at num sample points. The Drawing consists of isolated points, and does not connect them. When a program evaluates to a Drawing, the Source system displays it graphically, in a window,\n\n\\*",
"parameters": [
"numPoints"
]
},
"draw_sound_2d": {
"label": "draw_sound_2d",
"meta": "func",
"title": "Auto-import from plotly",
"description": "#### draw_sound_2d(sound) → void\nVisualizes the sound on a 2d line graph",
"parameters": [
"sound"
]
},
"new_plot": {
"label": "new_plot",
"meta": "func",
"title": "Auto-import from plotly",
"description": "#### new_plot(data) → void\nAdds a new plotly plot to the context which will be rendered in the Plotly Tabs",
"parameters": [
"data"
]
},
"new_plot_json": {
"label": "new_plot_json",
"meta": "func",
"title": "Auto-import from plotly",
"description": "#### new_plot_json(data) → void\nAdds a new plotly plot to the context which will be rendered in the Plotly Tabs",
"parameters": [
"data"
]
}
},
"repeat": {
"repeat": {
"label": "repeat",
"meta": "func",
"title": "Auto-import from repeat",
"description": "#### repeat(func, n) → Function\nReturns a new function which when applied to an argument, has the same effect as applying the specified function to the same argument n times.",
"parameters": [
"func",
"n"
]
},
"thrice": {
"label": "thrice",
"meta": "func",
"title": "Auto-import from repeat",
"description": "#### thrice(func) → Function\nReturns a new function which when applied to an argument, has the same effect as applying the specified function to the same argument 3 times.",
"parameters": [
"func"
]
},
"twice": {
"label": "twice",
"meta": "func",
"title": "Auto-import from repeat",
"description": "#### twice(func) → Function\nReturns a new function which when applied to an argument, has the same effect as applying the specified function to the same argument 2 times.",
"parameters": [
"func"
]
}
},
"pix_n_flix": {
"alpha_of": {
"label": "alpha_of",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### alpha_of(pixel) → number\nReturns the alpha component of the given pixel.",
"parameters": [
"pixel"
]
},
"blue_of": {
"label": "blue_of",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### blue_of(pixel) → number\nReturns the blue component of the given pixel.",
"parameters": [
"pixel"
]
},
"compose_filter": {
"label": "compose_filter",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### compose_filter(filter1, filter2) → Filter\nReturns a new filter that is equivalent to applying filter1 and then filter2.",
"parameters": [
"filter1",
"filter2"
]
},
"copy_image": {
"label": "copy_image",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### copy_image(src, dest) → void\nThe default filter that just copies the source image to the destination image.",
"parameters": [
"src",
"dest"
]
},
"get_video_time": {
"label": "get_video_time",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### get_video_time() → number\nReturns the elapsed time in milliseconds since the start of the video.",
"parameters": []
},
"green_of": {
"label": "green_of",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### green_of(pixel) → number\nReturns the green component of the given pixel.",
"parameters": [
"pixel"
]
},
"image_height": {
"label": "image_height",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### image_height() → number\nReturns the current height of the displayed images in pixels, i.e. the number of pixels in the vertical dimension.",
"parameters": []
},
"image_width": {
"label": "image_width",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### image_width() → number\nReturns the current width of the displayed images in pixels, i.e. the number of pixels in the horizontal dimension.",
"parameters": []
},
"install_filter": {
"label": "install_filter",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### install_filter(_filter) → void\nInstalls the given filter to be used to transform each source image from the live camera or from a local/remote file to a destination image that is then displayed on screen.\n\nA filter is a function that is applied to two two-dimensional arrays of Pixels: the source image and the destination image.",
"parameters": [
"_filter"
]
},
"keep_aspect_ratio": {
"label": "keep_aspect_ratio",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### keep_aspect_ratio(_keepAspectRatio) → void\nSets pix\\_n\\_flix to preserve the aspect ratio of the video or image",
"parameters": [
"_keepAspectRatio"
]
},
"pause_at": {
"label": "pause_at",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### pause_at(pause_time) → void\nPauses the video at a set time after the video starts.",
"parameters": [
"pause_time"
]
},
"red_of": {
"label": "red_of",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### red_of(pixel) → number\nReturns the red component of the given pixel.",
"parameters": [
"pixel"
]
},
"reset_filter": {
"label": "reset_filter",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### reset_filter() → void\nResets the installed filter to the default filter.",
"parameters": []
},
"set_dimensions": {
"label": "set_dimensions",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### set_dimensions(width, height) → void\nSets the diemsions of the displayed images. Note: Only accepts width and height values within the range of 1 to 500.",
"parameters": [
"width",
"height"
]
},
"set_fps": {
"label": "set_fps",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### set_fps(fps) → void\nSets the framerate (i.e. frames per second (FPS)) of the video. Note: Only accepts FPS values within the range of 2 to 30.",
"parameters": [
"fps"
]
},
"set_loop_count": {
"label": "set_loop_count",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### set_loop_count(n) → void\nSets the number of times the video is played. If the number of times the video repeats is negative, the video will loop forever.",
"parameters": [
"n"
]
},
"set_rgba": {
"label": "set_rgba",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### set_rgba(pixel, r, g, b, a) → void\nAssigns the given red, green, blue and alpha component values to the given pixel.",
"parameters": [
"pixel",
"r",
"g",
"b",
"a"
]
},
"set_volume": {
"label": "set_volume",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### set_volume(volume) → void\nSets the audio volume of the local video file played. Note: Only accepts volume value within the range of 0 to 100.",
"parameters": [
"volume"
]
},
"start": {
"label": "start",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### start() → StartPacket\nStarts processing the image or video using the installed filter.",
"parameters": []
},
"use_image_url": {
"label": "use_image_url",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### use_image_url(URL) → void\nSets pix\\_n\\_flix to use the image from the given URL as the image feed instead of using the default live camera feed.",
"parameters": [
"URL"
]
},
"use_local_file": {
"label": "use_local_file",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### use_local_file() → void\nSets pix\\_n\\_flix to use video or image feed from a local file instead of using the default live camera feed.",
"parameters": []
},
"use_video_url": {
"label": "use_video_url",
"meta": "func",
"title": "Auto-import from pix_n_flix",
"description": "#### use_video_url(URL) → void\nSets pix\\_n\\_flix to use the video from the given URL as the video feed instead of using the default live camera feed.",
"parameters": [
"URL"
]
}
},
"binary_tree": {
"entry": {
"label": "entry",
"meta": "func",
"title": "Auto-import from binary_tree",
"description": "#### entry(t) → boolean\nReturns the entry of a given binary tree.",
"parameters": [
"t"
]
},
"is_empty_tree": {
"label": "is_empty_tree",
"meta": "func",
"title": "Auto-import from binary_tree",
"description": "#### is_empty_tree(value) → boolean\nReturns a boolean value, indicating whether the given value is an empty binary tree.",
"parameters": [
"value"
]
},
"is_tree": {
"label": "is_tree",
"meta": "func",
"title": "Auto-import from binary_tree",
"description": "#### is_tree(value) → boolean\nReturns a boolean value, indicating whether the given value is a binary tree.",
"parameters": [
"value"
]
},
"left_branch": {
"label": "left_branch",
"meta": "func",
"title": "Auto-import from binary_tree",
"description": "#### left_branch(t) → BinaryTree\nReturns the left branch of a given binary tree.",
"parameters": [
"t"
]
},
"make_empty_tree": {
"label": "make_empty_tree",
"meta": "func",
"title": "Auto-import from binary_tree",
"description": "#### make_empty_tree() → BinaryTree\nReturns an empty binary tree, represented by the empty list null",
"parameters": []
},
"make_tree": {
"label": "make_tree",
"meta": "func",
"title": "Auto-import from binary_tree",
"description": "#### make_tree(value, left, right) → BinaryTree\nReturns a binary tree node composed of the specified left subtree, value and right subtree.",
"parameters": [
"value",
"left",
"right"
]
},
"right_branch": {
"label": "right_branch",
"meta": "func",
"title": "Auto-import from binary_tree",
"description": "#### right_branch(t) → BinaryTree\nReturns the right branch of a given binary tree.",
"parameters": [
"t"
]
}
},
"copy_gc": {
"allHeap": {
"label": "allHeap",
"meta": "func",