-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcsharp_component_samples.sample
More file actions
2280 lines (2280 loc) · 149 KB
/
Copy pathcsharp_component_samples.sample
File metadata and controls
2280 lines (2280 loc) · 149 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
<?xml version='1.0' encoding='UTF-8'?>
<meta>
<samples_pack name="csharp_component_samples">
<title>C# Component Samples</title>
<version>2.22</version>
<dependency>2.22</dependency>
<os>cross</os><workflow>editor2</workflow>
<precision>double</precision>
<path>data</path>
<command>world_load csharp_component_samples</command>
<custom_app>csharp_component_samples</custom_app>
<run_workflow>dotnet</run_workflow>
<bin_type>development</bin_type>
<api>csdnc</api>
<plugins>FMOD</plugins>
<git_repo>https://github.com/unigine-engine/csharp-component-samples/tree/release-2.22/source</git_repo>
<description>
<![CDATA[
<p>A set of samples showcasing the use of engine features via C# components for various use cases.</p>
<p>Programming is easy: application logic is implemented in components, that can be assigned to any nodes in the virtual world to extend their functionality.</p>
<p>To launch this samples, you should perform the following actions:
<ul>
<li>Install one of the following IDEs to work with the source code:
<ul>
<li><b><a href="https://code.visualstudio.com/download">Visual Studio Code</a></b>, recommended (C# extension is required)</li>
<li><b>Visual Studio 2022</b></li>
</ul>
</li>
<li>Download and install <a href="https://dotnet.microsoft.com/en-us/download/dotnet/8.0">.NET Core 8.0</a><br/>If you're using Visual Studio, choose the appropriate .NET Core version:
<ul>
<li>
<a href="https://dotnet.microsoft.com/en-us/download/dotnet/8.0">v8.0.107</a> for Visual Studio 2022
</li>
</ul>
</li>
<li>Click <b>Copy as Project</b> under this Demo.</li>
<li>Click <b>Open Editor</b> for the project to run it in the Editor.</li>
<li>Run the project via the <b>Play</b> button on the Editor's toolbar.</li>
</ul>
</p>
]]>
</description>
<features>
<![CDATA[
<p>
<ul>
<li><b>Animation</b> - blending and lerping animations, applying partial blending of bones, rotating bones via code, controlling animation playback</li>
<li><b>Arcade Sample</b> - simple but frequently used arcade mechanics: controls, shooting and intersection of bullets with surfaces, node spawning, transformations, and deletion</li>
<li><b>Cameras</b> - creating and controlling various cameras: first-person-view, orbital, panning, and persecutor camera</li>
<li><b>CharacterController</b> - first-person character controller implementation</li>
<li><b>Components</b> - all available types of component parameters</li>
<li><b>Create Nodes</b> - creating and deleting nodes via code</li>
<li><b>Input</b> - enabling input from various devices (keyboard, gamepad, joystick, etc.)</li>
<li><b>Materials</b> - changing material parameters at run time</li>
<li><b>Navigation</b> - 2D and 3D pathfinding and navigation (navigation meshes, obstacles, sectors)</li>
<li><b>Sounds</b> - adding and controlling various sounds</li>
<li><b>Tracker</b> - using Tracker functionality to animate objects (change their position, rotation, and scale) via tracks created in the Tracker tool.</li>
<li><b>Transformation</b> - object transformations: rotation via Euler angles, local and world transforms</li>
<li><b>Widgets</b> - using widgets and containers to create a custom GUI</li>
<li><b>World Intersection</b> - detecting intersections between bounds and nodes, between rays and geometry</li>
</ul>
</p>
]]>
</features>
<products>
<product>tier3_bin_windows</product>
<product>tier3_bin_channel</product>
<product>tier3_bin_channel_windows</product>
<product>tier3_bin_channel_linux</product>
<product>tier3_src_windows</product>
<product>tier3_bin_linux</product>
<product>tier3_src_linux</product>
<product>tier3_evaluation</product>
<product>tier2_bin_windows</product>
<product>tier2_src_windows</product>
<product>tier2_bin_linux</product>
<product>tier2_src_linux</product>
<product>tier2_evaluation</product>
<product>tier0_bin</product>
<product>tier0_bin_pro</product>
<product>tier4_bin</product>
<product>tier4_evaluation</product>
</products>
<images>
<card_image>.meta/images/csharp_rect.png</card_image>
<thumb>.meta/images/csharp_sm.png</thumb>
<image>.meta/images/csharp_001.png</image>
<image>.meta/images/csharp_002.png</image>
<image>.meta/images/csharp_003.png</image>
</images>
<categories>
<category id="scene_management" name="Scene Management" order="10" img="data/csharp_component_samples/scene_management/scene_management.png"/>
<category id="csharp_language_features" name="C# Language Features" order="15" img="data/csharp_component_samples/csharp_language_features/csharp_language_features.png"/>
<category id="player_controllers" name="Player Controllers" order="20" img="data/csharp_component_samples/player_controllers/player_controllers.png"/>
<category id="input_handling" name="Input Handling" order="30" img="data/csharp_component_samples/input_handling/input_handling.png"/>
<category id="app_logic" name="App Logic" order="40" img="data/csharp_component_samples/app_logic/app_logic.png"/>
<category id="procedural_generation_placement" name="Procedural Generation & Placement" order="50" img="data/csharp_component_samples/procedural_generation_placement/procedural_generation_placement.png"/>
<category id="multi_threading_performance_optimization" name="Multithreading & Performance Optimization" order="60" img="data/csharp_component_samples/multi_threading_performance_optimization/multi_threading_performance_optimization.png"/>
<category id="nodes" name="Nodes" order="80" img="data/csharp_component_samples/nodes/nodes.png"/>
<category id="terrain_modification_usage" name="Terrain Modification & Usage" order="90" img="data/csharp_component_samples/terrain_modification_usage/terrain_modification_usage.png"/>
<category id="physics" name="Physics" order="100" img="data/csharp_component_samples/physics/physics.png"/>
<category id="rendering" name="Rendering" order="110" img="data/csharp_component_samples/rendering/rendering.png"/>
<category id="animation_generic" name="Animation - Generic" order="120" img="data/csharp_component_samples/animation_generic/animation_generic.png"/>
<category id="animation_characters" name="Animation - Characters" order="125" img="data/csharp_component_samples/animation_characters/animation_characters.png"/>
<category id="navigation" name="Navigation" order="140" img="data/csharp_component_samples/navigation/navigation.png"/>
<category id="user_interface" name="User Interface" order="150" img="data/csharp_component_samples/user_interface/user_interface.png"/>
<category id="sounds" name="Sounds" order="160" img="data/csharp_component_samples/sounds/sounds.png"/>
<category id="network" name="Network" order="170" img="data/csharp_component_samples/network/network.png"/>
<category id="unigine_script_interop" name="UnigineScript Interop" order="180" img="data/csharp_component_samples/unigine_script_interop/unigine_script_interop.png"/>
</categories>
<samples>
<sample title="Additive Animation Blending [Animation Graph]" order="1" id="additive_animation_blending" category_id="animation_characters">
<sdk_desc><![CDATA[Additive blending of two animations.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates additive blending of two animations in an <i>animation graph</i>.</p>
<p>Unlike ordinary blending, where two animations are mixed and each of them gets only a part of the result, additive blending takes the difference between an animation and its reference pose and adds it on top of the base one. The base animation keeps playing in full, while the additive one only modifies it.</p>
<p>Use the <i>Weight</i> slider in the sample window to change how much of the additive animation is applied. The slider sets a parameter of the graph, where the animations and the blending are configured.</p>
<p>Additive blending is a technique for combining skeletal model animations, enabling smooth transitions and the seamless merging of character or object movements.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
</tags>
</sample>
<sample title="Bones: Partial Blend [Animation Graph]" order="1" id="bones_partial_blend" category_id="animation_characters">
<sdk_desc><![CDATA[Demonstration of partial blending between two animations using bone-specific interpolation.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates partial blending between two animations in an <i>animation graph</i>, where only the selected bones are affected.</p>
<p>Two animations are played at the same time: the character keeps walking while the punching animation is blended into the upper part of the body only. The set of bones that receive the blended pose is defined by a mask assigned to the blending node of the graph.</p>
<p>Use the <i>Weight</i> slider in the sample window to change how much of the punching animation is applied to the masked bones. The slider sets a parameter of the graph, where the animations, the blending, and the mask are configured.</p>
<p>Partial blending lets a character perform different actions with different parts of its body at the same time, without preparing a separate animation for every combination.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
</tags>
</sample>
<sample title="Linear Animation Blending [Animation Graph]" order="1" id="linear_animation_blending" category_id="animation_characters">
<sdk_desc><![CDATA[Linear interpolation of two animations.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates linear interpolation between two animations in an <i>animation graph</i>.</p>
<p>Two animations are played at the same time, and the poses they produce are mixed into the resulting one. The closer the weight is to either end, the more of the corresponding animation is left in the result, so the character goes from standing still to walking and back.</p>
<p>Use the <i>Weight</i> slider in the sample window to change the proportion. The slider sets a parameter of the graph, where the animations and the blending are configured.</p>
<p>Interpolating skeletal animations allows you to create smooth and natural transitions between different character or object movements.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
</tags>
</sample>
<sample title="Bones: Rotation [Animation Graph]" order="1" id="bones_rotation" category_id="animation_generic">
<sdk_desc><![CDATA[Blending skeletal animations in an animation graph and rotating a bone programmatically.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to combine skeletal animation playback with direct modification of bone transforms.</p>
<p>The turret plays an idle animation, over which the left and right shooting animations are blended additively by a state machine in the <i>animation graph</i>.</p>
<p>On top of that, the horizontal joint of the turret is rotated from code at a constant speed. The rotation is applied after the animation graph has written its pose, so that the played animation does not overwrite it.</p>
<p>Combining played animations with programmatic bone control is useful for turrets and other cases where part of a skeleton has to be driven by code rather than by a pre-made animation.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
</tags>
</sample>
<sample title="Animation Layers Playback" id="animation_layers_playback" category_id="animation_generic">
<sdk_desc><![CDATA[Demonstration of animation sequences played in order or simultaneously.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates composing a single animation out of several reusable sequences using <i>AnimationChannelSubSequence</i> - a channel that holds other sequences as clips, with each clip having its own start time and duration.</p>
<br/>
<p>Three single-parameter sequences are created first: a Z position bounce, a rotation around the Z axis, and a scale pulse. They are then combined in two different ways, and both results are played at the same time:</p>
<p> - The <b>left box</b> plays the clips starting at the same time, so its position, rotation, and scale are animated simultaneously.</p>
<p> - The <b>right box</b> plays the clips one after another. A clip that has finished stops writing its parameter, and the box keeps the value it was left with.</p>
<p>Both players use the same three sequences. Instead of duplicating them for each box, every player enumerates the binds of its sequences, including the ones inside the clips, and points them at its own box, so the sequences remain reusable and are not changed themselves.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
</tags>
</sample>
<sample title="Curve Animation" id="curve_animation" category_id="animation_generic">
<sdk_desc><![CDATA[Real-time animation of transformations and material parameters using <i>Curve2D</i> for flexible, non-linear motion.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates animating node transformations and material parameters with <i>Curve2D</i> values sampled every frame.</p>
<br/>
<p>Two components are shown:</p>
<p> - <b>CurveAnimationTransform</b> - animates the transformation of a node. Position, rotation, and scale have a separate curve for each of the <b>X, Y, Z</b> axes, so every axis can be shaped independently. The curves are evaluated at the current time and composed into the final transformation matrix. In the sample it moves the platforms, and changes the coins and heart transformations.</p>
<p> - <b>CurveAnimationMaterialParamFloat</b> - animates float parameters of a material. Each entry of the list binds a curve to a parameter by its name and surface index, so any number of parameters can be animated at once. In the sample it pulses the emission of the coins and the heart.</p>
<p>The curves and the playback speed are available in the properties of the corresponding component in UnigineEditor, where the curves can also be shaped in the <i>Curve Editor</i>.</p>
<p>This setup is useful for looping motions and dynamic material effects that do not require external animation assets.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
<tag>Basic Recipes</tag>
<tag>Transformations</tag>
</tags>
</sample>
<sample title="Global Engine Parameters Animation" id="global_engine_parameters_animation" category_id="animation_generic">
<sdk_desc><![CDATA[Animating global Engine parameters, such as physics gravity and render background color, using <i>singleton channels</i>.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates animating global Engine parameters using <b>singleton channels</b> - animation channels that have no bind and target a global system instead of a certain node, material, or property.</p>
<p>Two parameters are animated at the same time by a single <i>AnimationSequence</i>: the Z component of physics gravity and the alpha component of the render background color. Their current values are displayed in the <i>State</i> window.</p>
<p>The sequence is saved to a <b>.seq</b> file in the <b>sequences</b> folder of the world and then played back right from this file, demonstrating a serialization roundtrip. If the file is unavailable, the sequence stored in memory is played instead.</p>
<p>Animating global parameters gives you programmatic control over scene effects, weather changes, time transitions, and physical properties, resulting in more engaging and interactive scenes.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
<tag>Basic Recipes</tag>
</tags>
</sample>
<sample title="Material Parameters Animation" id="material_parameters_animation" category_id="animation_generic">
<sdk_desc><![CDATA[Changing material parameters at runtime.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample illustrates how to change the parameters of <i>materials</i> at runtime. Each object in the scene has its own component that animates one of the parameters continuously:</p>
<p> - <b>Albedo color</b> - smoothly transitions between two colors.</p>
<p> - <b>Albedo texture</b> - alternates between two textures loaded from files.</p>
<p> - <b>Metalness</b> - smoothly transitions between two values.</p>
<p> - <b>Emission</b> state - is switched on and off, making the object blink.</p>
<p> - <b>Cast World Shadow</b> state - is switched on and off, making the shadow of the object appear and disappear.</p>
<p>The parameters can be edited in the properties of the corresponding components in UnigineEditor. The current value of every animated parameter is displayed in the <i>State</i> window.</p>
<p>Changing material parameters at runtime is the basis for various dynamic effects, such as highlighting the objects the user interacts with, indicating the state of a device, or reproducing the changes of a surface over time.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
<tag>Materials</tag>
</tags>
</sample>
<sample title="Node Parameters Animation" id="node_parameters_animation" category_id="animation_generic">
<sdk_desc><![CDATA[Animating position, rotation, and scale of a node using <b>node binds</b> and different types of animation channels.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates animating the transformation of a node using <b>node binds</b> - <i>AnimationBindNode</i> objects that point animation channels at a certain node, identified by its ID and name.</p>
<p>A box is animated by three channels of different types added to a single <i>AnimationSequence</i>, all of them sharing the same bind:</p>
<p> - <i>AnimationChannelScalar</i> - animates a single float value, here the Z position of the box.</p>
<p> - <i>AnimationChannelQuat</i> - animates rotation via quaternion interpolation. Along with the quaternion mode used here, the rotation can also be composed of three separate curves for each of the angles.</p>
<p> - <i>AnimationChannelFVec3</i> - animates a three-component vector, here the scale of the box.</p>
<p>The position channel gets its keyframes from an <i>AnimationCurveScalar</i> curve created explicitly, while the other two channels take the values directly. The keys use smooth interpolation based on a Bezier curve, so the box moves and resizes with easing instead of linearly.</p>
<p>The current values of the animated parameters are displayed in the <i>State</i> window.</p>
<p>Node animations can serve as a foundation for various effects, including element appearance/disappearance, rotations, resizing, and more.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
</tags>
</sample>
<sample title="Physics-Based Animation" id="physics_based_animation" category_id="animation_generic">
<sdk_desc><![CDATA[Physics-based animation of movements using easing functions and spring simulation.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates several ways of moving an object towards a target smoothly, shown as a simple game.</p>
<p>The sample has two modes, switched with the buttons in the description window.</p>
<p>In the <b>Animations Demo</b> mode, the way of moving is selected from the drop-down list, with each of them implemented as a separate component:</p>
<p> - <b>Linear</b> - moves at a constant speed.</p>
<p> - <b>EaseIn</b> - accelerates gradually.</p>
<p> - <b>EaseInOut</b> - accelerates at the start and decelerates at the end.</p>
<p> - <b>EaseOut</b> - decelerates gradually.</p>
<p> - <b>EaseOutElastic</b> - oscillates around the destination before settling on it.</p>
<p> - <b>EaseOutBack</b> - overshoots the destination slightly and comes back to it.</p>
<p> - <b>EaseOutBounce</b> - bounces at the destination.</p>
<p>In the <b>Start Game</b> mode, you control the laser pointer with the mouse, and the cat chases it using spring simulation, becoming faster and more responsive over time until it catches the pointer.</p>
<p>The parameters of each way of moving are available in the properties of the corresponding component in UnigineEditor.</p>
<p>Easing and spring-based motion make the movement of objects look natural, which is useful for cameras, UI elements, followers, and any object that has to reach a moving target smoothly.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
</tags>
</sample>
<sample title="Property Animation" id="property_animation" category_id="animation_generic">
<sdk_desc><![CDATA[Animating a parameter of a property assigned to a node and using the animated value to drive the logic of the sample.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates animating property parameters using <i>AnimationBindPropertyParameter</i>, which points an animation channel at a certain parameter of a property assigned to a node.</p>
<p>A box has the <b>speed_prop</b> property assigned to it, with a single float parameter named <b>speed</b>. This parameter is animated by an <i>AnimationChannelFloat</i> channel: the value grows from 0 to 120, then goes down to -120, and returns back to 0.</p>
<p>The animation itself does not move the box. Each frame the sample reads the current value of the <b>speed</b> parameter and rotates the box at this speed. The current value is displayed in the <i>State</i> window.</p>
<p>This pattern is useful for data-driven animations, where the animation system controls the values, and the logic decides how to use them. The same animated parameter can be read by any number of components, and the property can be reassigned to another node without changing the animation.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
<tag>Properties</tag>
</tags>
</sample>
<sample title="Track Playback" img="yes" id="track_playback" category_id="animation_generic">
<sdk_desc><![CDATA[Using <i>Tracker</i> to animate the position, rotation, and scale of an object.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates playing back animation tracks created in the <b>Tracker</b> tool and stored in <b>.track</b> files.</p>
<br/>
<p>Three tracks are played at the same time, animating the position, rotation, and scale of the object independently. The position and rotation tracks are listed in the properties of the <b>Tracker</b> component and loaded on its initialization, while the scale track is added later by the <b>TrackPlayback</b> component.</p>
<p>The tracks are addressed in two different ways: by their ID, cached once at initialization, and by their name, which is more readable but requires a lookup on every call.</p>
<p>Each track keeps its own playback time, advanced every frame and wrapped back to the beginning at the end of the track.</p>
<p>Tracker comes in handy for creating complex animation scenarios, where the animation is authored visually rather than in code.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
</tags>
</sample>
<sample title="Widget Animation" id="widget_animation" category_id="animation_generic">
<sdk_desc><![CDATA[Animating widget position, font size, and color using runtime binds.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates animating widgets using <i>AnimationBindRuntime</i>, a bind that stores the runtime instance of a target object. It can point an animation channel at any Engine object, such as a widget, a body, or a camera.</p>
<p>A looped title animation is played on three labels: the <b>Player 0</b> and <b>Player 1</b> labels are animated by position, font color, and font size, while the <b>vs</b> label between them is animated by font color only.</p>
<p>A channel animates a single parameter, so a label animated by several parameters at once needs a separate channel for each of them, with the same bind assigned to all of them.</p>
<p>Animating interface elements programmatically helps create more lively, appealing user interfaces and enables automation of their behavior.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
<tag>Interface (GUI)</tag>
<tag>Widgets</tag>
</tags>
</sample>
<sample title="Advanced Event Connection Patterns" id="advanced_event_connection_patterns" category_id="app_logic">
<sdk_desc><![CDATA[Advanced ways of subscribing to events in UNIGINE: using extra arguments, discarding parameters, and storing connection handles for disconnection.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates advanced usage of the UNIGINE <b>event system</b>.</p>
<p><i>EventsAdvancedSample.cs</i> triggers custom rotation events when specific keys are pressed. Each event passes one or more arguments to connected listeners.</p>
<p><i>EventsAdvancedUnit.cs</i> shows how to connect various types of handlers, including:</p>
<p> - Class methods with extra arguments</p>
<p> - Methods with discarded or additional arguments</p>
<p> - Delegates and lambda expressions</p>
<p> - Storing connections using <i>EventConnection</i> or an <i>EventConnections</i> instance for later disconnection</p>
<p>This sample helps understand flexible patterns for event handling in modular component systems.</p>
]]>
</brief>
</desc>
<controls>
<![CDATA[<p>T - rotate around X axis</p><p>Y - rotate around Y axis</p><p>U - rotate around Z axis</p><p>I - rotate around XYZ axes at the same time</p>]]>
</controls>
<tags>
<tag>Systems</tag>
<tag>Logic</tag>
<tag>Events</tag>
<tag>Input & Controls</tag>
</tags>
</sample>
<sample title="Arcade Game Prototype" img="yes" id="arcade_game_prototype" category_id="app_logic">
<sdk_desc><![CDATA[A simple yet flexible 3D shooter prototype featuring core gameplay systems like shooting, collisions, health management, and dynamic effects.]]></sdk_desc>
<desc>
<brief>
<![CDATA[<p>This sample showcases a flexible arcade-style interaction system, built with UNIGINE's C# API. It presents foundational gameplay mechanics commonly used in shooter, and action-style applications. The project serves both as a beginner-friendly learning resource and a base for prototyping more advanced features such as basic non-player behavior or scoring logic.</p>
<p><b>Core Features:</b></p>
<p> - <b>Player Controller:</b> Control a robot character with keyboard input for movement and rotation.</p>
<p> - <b>Projectile System:</b> An automated turret fires projectiles using raycasting for hit detection and visual impact effects.</p>
<p> - <b>Enemy Turret:</b> A rotating turret that periodically shoots projectiles at the player.</p>
<p> - <b>Health System:</b> The robot takes damage and is destroyed when health reaches zero, with corresponding visual effects and cleanup.</p>
<p> - <b>Node Spawning & Deletion:</b> Bullets and particle effects are dynamically created and removed, with timed destruction to manage scene performance.</p>
<p> - <b>Visual FX (Optional):</b> Includes particle effects for shooting, impact, and destruction events.</p>
<p><b>Use Cases:</b></p>
<p> - <b>Game Prototyping:</b> Provides a foundation for building shooter mechanics, or arcade-style gameplay.</p>
<p> - <b>Physics & Interaction:</b> Demonstrates raycasting-based hit detection.</p>
<p> - <b>Learning Tool:</b> Ideal for beginners exploring the UNIGINE C# API and gameplay scripting.</p>
]]>
</brief>
</desc>
<controls>
<![CDATA[<p align=left>Keys <b>UP</b> and <b>DOWN</b> to move forward/backward</p>
<p align=left>Keys <b>LEFT</b> and <b>RIGHT</b> for clockwise/counterclockwise rotation</p>
]]>
</controls>
<tags>
<tag>Complex Solutions</tag>
<tag>Intersections</tag>
<tag>Physics</tag>
<tag>Games</tag>
<tag>Effects</tag>
<tag>VFX</tag>
<tag>Decals</tag>
</tags>
</sample>
<sample title="Component Parameters In Editor" img="yes" id="component_parameters_in_editor" category_id="app_logic">
<sdk_desc><![CDATA[Demonstration of component parameter types and configuration options.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates possible variations of component parameter types available in the <b>Component System</b>. It includes primitive types, vectors, masks, files, properties, materials, nodes, curves, structs, arrays, and advanced features like conditional visibility and value filtering.</p>
<p>Select the <b>component_parameters</b> <i>Node Dummy</i> in the Editor and explore all parameter variations in the <i>Parameters</i> window. This serves as a comprehensive reference for available parameter types and their configuration options.</p>
]]>
</brief>
</desc>
<tags>
<tag>Component System</tag>
<tag>Programming</tag>
<tag>Logic</tag>
</tags>
</sample>
<sample title="Console Interaction" id="console_interaction" category_id="app_logic">
<sdk_desc><![CDATA[Interacting with the Engine's built-in console and adding custom console commands and variables via API using the <i>Console</i> and <i>ConsoleVariable</i> classes.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to interact with the Engine's built-in console and add custom console commands and variables via API using the <i>Console</i> and <i>ConsoleVariable</i> classes. It shows how to define different types of console variables: <i>ConsoleVariableInt</i>, <i>ConsoleVariableFloat</i>, and <i>ConsoleVariableString</i>, and how to register custom console commands.</p>
<p>Commands are linked to callback functions using <i>MakeCallback</i>, and can be executed directly from code or entered manually through the console. Commands can also be added and removed dynamically at runtime, making the system flexible for various use cases. Console variables can be accessed or changed through both code and the console interface.</p>
<p>For demonstration, to move the Material Ball in the scene use the custom command <b>control_node [x] [y] [z]</b> in the Console (`), where <i>x, y, z</i> are the target world coordinates (e.g., <b>control_node 0 5 1</b>).</p>
<p>This functionality can be used for development, debugging, rapid prototyping, and runtime adjustments in interactive applications.</p>
]]>
</brief>
</desc>
<tags>
<tag>Systems</tag>
<tag>Logic</tag>
</tags>
</sample>
<sample title="Euler Angle Composition And Decomposition" id="euler_angle_composition_and_decomposition" category_id="app_logic">
<sdk_desc><![CDATA[Composing and decomposing object rotation using Euler angles in different axis sequences.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how the order in which Euler angles are applied changes the resulting rotation. The same three angles applied as <i>XYZ, XZY, YXZ, YZX, ZXY</i>, or <i>ZYX</i> produce six different orientations.</p>
<p>The sample also does the opposite: it takes the current rotation of the object and converts it back into <b>Pitch, Roll</b>, and <b>Yaw</b> angles for the selected sequence, displaying them as you rotate the object. These angles may differ from the ones used to set the rotation because of gimbal lock.</p>
<p>The local axes of the object, the global axes, and a gimbal ring for each rotation step are drawn with the <i>Visualizer</i>, so every stage of the sequence is visible.</p>
]]>
</brief>
</desc>
<tags>
<tag>Basic Recipes</tag>
<tag>Transformations</tag>
</tags>
</sample>
<sample title="Filesystem External Package" id="filesystem_external_package" category_id="app_logic">
<sdk_desc><![CDATA[Demonstration of working with external package files via the <i>Package</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to create a custom data package using code and use it to generate objects in the scene. It creates a box mesh and spawns it 64 times in the scene with varied positions and rotations.</p>
<p>Package is a collection of files and data for UNIGINE projects stored in a single file. The <i>Package</i> class is a data provider for the File System. You can use it to load all necessary resources. Packages can be used to conveniently transfer files between your projects or exchange data with other users, be it content (a single model or a scene with a set of objects driven by logic implemented via C# components) or files (plugins, libraries, execution files, etc.).</p>
]]>
</brief>
</desc>
<tags>
<tag>Systems</tag>
<tag>Logic</tag>
<tag>File System</tag>
</tags>
</sample>
<sample title="Inverse FPS Usage" id="inverse_fps_usage" category_id="app_logic">
<sdk_desc><![CDATA[Using <i>Game.IFps</i> to implement movement logic independent of the frame rate.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates the importance of using <i>Game.IFps</i> to implement movement logic independent of the frame rate.</p>
<p>Two cubes move back and forth along the X-axis. Use the <i>Max render fps</i> slider to change the frame rate of the application and compare their behavior.</p>
<p>The green cube uses <i>Game.IFps</i> to scale its movement by the frame time delta, which keeps its speed consistent across varying frame rates.</p>
<p>The red cube does not use <i>Game.IFps</i> and simply applies constant translation per frame, so its speed changes together with the frame rate.</p>
]]>
</brief>
</desc>
<tags>
<tag>Logic</tag>
</tags>
</sample>
<sample title="XML" id="xml" category_id="app_logic">
<sdk_desc><![CDATA[Creating and manipulating an <i>XML</i> document using the <i>Xml</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to create and manipulate an <i>XML</i> document using the <i>Xml</i> class. It creates a nested <i>XML</i> tree with multiple child nodes, each containing arguments and optionally a text value.</p>
<p>The structure is built using the <i>Xml.AddChild()</i> method, and the arguments are parsed using <i>Xml.GetArgName()</i> and <i>Xml.GetArgValue()</i>. After construction, the <i>XML</i> tree is traversed recursively to display the structure and all attributes in the Console output.</p>
<p>This approach demonstrates the use of the <i>Xml</i> class for working with hierarchical data, which is useful for config files, level data, and other structured content in <i>XML</i> format.</p>
]]>
</brief>
</desc>
<tags>
<tag>File Formats</tag>
</tags>
</sample>
<sample title="Abstract Components" id="abstract_components" category_id="csharp_language_features">
<sdk_desc><![CDATA[Demonstrating the use of abstract component classes for shared behavior via C# API.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to use abstract classes in the C# Component System to implement common behavior across different components.</p>
<p>At the core of the sample is the abstract <b>Toggleable</b> component, which defines a shared structure for enabling and disabling functionality. It contains the <b>Toggled</b> property that automatically calls the <i>On()</i> or <i>Off()</i> methods when changed. These methods are abstract and must be implemented in each derived class. The <i>Toggle()</i> method is used to switch the state manually, applying the corresponding behavior and updating the internal state.</p>
<p>Two specific components, <b>Lamp</b> and <b>Fan</b>, inherit from <b>Toggleable</b> and implement their own versions of the abstract methods. Lamp controls a light source by toggling its emission material state, while Fan continuously rotates the object when active.</p>
<p>The <b>Toggler</b> component performs interaction by casting a ray from the camera when the left mouse button is pressed. If it hits an object with a <b>Toggleable</b> component attached, it toggles that component's state.</p>
<p>This setup is useful for scenarios where different types of objects need to respond to a common interaction pattern. Using abstract classes makes it easy to implement consistent logic across objects while still allowing each one of them to behave differently.</p>
]]>
</brief>
</desc>
<controls>
<![CDATA[
<p><b>Click</b> on the lamp (sphere) and the fan (cube) to toggle them.</p>
]]>
</controls>
<tags>
<tag>Systems</tag>
<tag>Component System</tag>
<tag>Logic</tag>
<tag>Programming</tag>
</tags>
</sample>
<sample title="Coroutine Animations" id="coroutine_animations" category_id="csharp_language_features">
<sdk_desc><![CDATA[Managing (starting, stopping, and coordinating) multiple coroutines in UNIGINE to create non-blocking, time-based animations with UI-driven runtime control.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to implement application logic to be executed across multiple frames using coroutines, their execution can be suspended either by the Engine or manually, and then resumed. Here coroutines are used to create non-blocking, time-based targeted animations on a node. Smooth movement, continuous rotation, and material blinking effects are implemented using coroutine control flow (<b>StartCoroutine, yield return, StopCoroutine</b>). The sample also shows how to manage multiple coroutines simultaneously and stop them selectively.</p>
<p>You can control coroutine-based animations using a simple GUI which provides a practical way to explore and understand coroutine-driven behavior.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/code/csharp/coroutines?rlang=cs</link_docs>
<tags>
<tag>Systems</tag>
<tag>Component System</tag>
<tag>Logic</tag>
<tag>Programming</tag>
</tags>
</sample>
<sample title="Input Gamepad" id="input_gamepad" category_id="input_handling">
<sdk_desc>
<![CDATA[This sample demonstrates how to add input from the gamepad to the project.]]>
</sdk_desc>
<desc>
<brief>
<![CDATA[This sample demonstrates how to add input from the gamepad to the project.]]>
</brief>
</desc>
<tags>
<tag>Input & Controls</tag>
</tags>
</sample>
<sample title="Input Joystick" id="input_joystick" category_id="input_handling">
<sdk_desc><![CDATA[This sample demonstrates how to add advanced joystick input handling, supporting multiple controllers with real-time axis/button monitoring and force feedback effects in UNIGINE.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to add advanced joystick input handling to a project using the <i>InputJoystick.cs</i> component assigned to <b>NodeDummy</b>, supporting multiple controllers with real-time axis/button monitoring and force feedback effects in UNIGINE.</p>
<p>It features a <b>dynamic UI for testing 10+ force feedback types</b> (springs, vibrations, waves) and automatically handles device connection/disconnection events.</p>
<p><b>Use Cases:</b></p>
<p>Ideal for racing/flight simulators or any project requiring precise controller input with haptic feedback.</p>
]]>
</brief>
</desc>
<tags>
<tag>Input & Controls</tag>
</tags>
</sample>
<sample title="Input Keyboard And Mouse" id="input_keyboard_mouse" category_id="input_handling">
<sdk_desc><![CDATA[This sample demonstrates how to add monitoring of keyboard and mouse input, tracking key states, mouse movements, wheel events, cursor positions, and real-time input data.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to add monitoring of keyboard and mouse input, tracking key states, mouse movements, wheel events, and cursor positions across different coordinate systems using the <i>InputKeyboardAndMouse.cs</i> component assigned to <b>NodeDummy</b>. It displays real-time input data including key presses, mouse deltas, and text input.</p>
<p>The sample shows three mouse handling modes:</p>
<p> - <b>GRAB</b> - locks and hides the cursor</p>
<p> - <b>SOFT</b> - locks the cursor to the window but keeps it visible</p>
<p> - <b>USER</b> - leaves mouse behavior completely under user control.</p>
]]>
</brief>
</desc>
<tags>
<tag>Input & Controls</tag>
</tags>
</sample>
<sample title="Touch" id="touch" category_id="input_handling">
<sdk_desc>
<![CDATA[This sample demonstrates how to add multi-touch input from the <b>touchscreen</b>, visualizing finger positions with dynamic circles and displaying real-time coordinates to the project using the <i>InputTouches.cs</i> component assigned to <b>NodeDummy</b>.]]>
</sdk_desc>
<desc>
<brief>
<![CDATA[This sample demonstrates how to add multi-touch input from the <b>touchscreen</b>, visualizing finger positions with dynamic circles and displaying real-time coordinates to the project using the <i>InputTouches.cs</i> component assigned to <b>NodeDummy</b>.]]>
</brief>
</desc>
<tags>
<tag>Input & Controls</tag>
</tags>
</sample>
<sample title="Asynchronous Meshes And Textures Loading" id="asynchronous_meshes_and_textures_loading" category_id="multi_threading_performance_optimization">
<sdk_desc><![CDATA[Loading meshes and textures in a separate thread using the <i>AsyncQueue</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample shows how to load resources like meshes and textures in the background using the <i>AsyncQueue</i> class. Files are loaded in a separate thread, so the main application stays responsive.</p>
<p>Meshes and textures are added to the loading queue, and the system listens for events to know when each resource is ready. When a mesh finishes loading, it's removed from the queue. For textures, an event handler is used to handle their completion. The sample also demonstrates how to group and manage resource requests, making it easier to control the loading process.</p>
<p>This kind of async loading is useful for streaming large levels, loading assets on demand in VR, or preloading data in simulations without freezing the interface.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/api/library/filesystem/class.asyncqueue?rlang=cs</link_docs>
<tags>
<tag>Systems</tag>
<tag>Optimization</tag>
<tag>File System</tag>
<tag>Multithreading</tag>
</tags>
</sample>
<sample title="Asynchronous Nodes Loading Stress-Test" id="asynchronous_nodes_loading_stress_test" category_id="multi_threading_performance_optimization">
<sdk_desc><![CDATA[Asynchronous node loading via <i>AsyncQueue</i> with main-thread spatial integration.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to asynchronously load large number of nodes using the <i>AsyncQueue</i> class while ensuring correct activation on the main thread.</p>
<p>In UNIGINE, world nodes must be created only from the main thread. To comply with this restriction and avoid blocking the main thread, the sample performs the initial node loading in a background thread, and then schedules a follow-up task on the main thread to finalize activation by calling <i>updateEnabled()</i> - a method that registers the node and its children in the world's spatial structure.</p>
<p>With the built-in Profiler enabled, you can observe how the engine handles increasing load smoothly and avoids frame spikes.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/api/library/filesystem/class.asyncqueue?rlang=cs</link_docs>
<tags>
<tag>Systems</tag>
<tag>Optimization</tag>
<tag>File System</tag>
<tag>Multithreading</tag>
</tags>
</sample>
<sample title="Asynchronous Tasks Scheduler Configuration" id="asynchronous_tasks_scheduler_configuration" category_id="multi_threading_performance_optimization">
<sdk_desc><![CDATA[Managing tasks via <i>AsyncQueue</i> class with dirrefent thread types, parallel execution and frame control.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstates how to schedule and run different types of tasks using the <i>AsyncQueue class</i>. It shows how to execute operations in different thread types, control thread count, and choose whether tasks should complete within the current frame or run freely in the background.</p>
<p> - <b>Async</b> - non-blocking execution in a single thread. Useful for offloading tasks without stalling the main thread.</p>
<p> - <b>Async Multithread</b> - parallel execution across multiple threads. Each thread receives its own portion of work. Does not block the caller.</p>
<p> - <b>Frame-Async Multithread</b> - same as <b>Async Multithread</b>, but ensures all threads complete their tasks within the current frame.</p>
<p> - <b>Sync Multithread</b> - multi-threaded execution that blocks the calling thread until all threads finish.</p>
<p> - <b>Frame-Sync Multithread</b> - same as <b>Sync Multithread</b>, but ensures all threads complete their tasks within the current frame.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/api/library/filesystem/class.asyncqueue?rlang=cs</link_docs>
<tags>
<tag>Systems</tag>
<tag>Optimization</tag>
<tag>File System</tag>
<tag>Multithreading</tag>
</tags>
</sample>
<sample title="Microprofiler Custom Counters" id="microprofiler_custom_counters" category_id="multi_threading_performance_optimization">
<sdk_desc><![CDATA[Using <i>Microprofile</i>, an advanced CPU/GPU profiler, to track performance and estimate the time spent on different sections of code.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates methods for tracking performance and estimating the time spent on different sections of code. For this purpose, it uses <b>Microprofile</b>, an advanced CPU/GPU profiler with per-frame inspection support.</p>
<p>Profiling is crucial for identifying performance bottlenecks and optimizing code execution. This analysis helps you understand if any code sections negatively impact the project's speed.</p>
]]>
</brief>
</desc>
<exec>microprofile_enabled 1</exec>
<edit>microprofile_enabled 1</edit>
<tags>
<tag>Optimization</tag>
<tag>Profiling</tag>
</tags>
</sample>
<sample title="Experimental Navigation Mesh" id="experimental_navigation_mesh" category_id="navigation">
<sdk_desc><![CDATA[Configuring pathfinding between two points around obstacles using <b>Experimental Navigation Mesh</b>.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to configure pathfinding between two points with obstacles using <b>Experimental Navigation Mesh</b>. The route is built for an agent of a certain size, so a path is only found where the agent actually fits: it keeps clear of walls and obstacles, avoids slopes too steep to walk up and steps too high to climb, and gives up when the way around becomes too long. The resulting route is reported with its length, cost, and number of points, and if the target cannot be reached, the path is drawn up to the last point the agent can get to, with the reason explained. </p>
<p>This sample is useful for pathfinding in games, for route checks in training simulators and digital twins, and for verifying that a building model stays passable for a given size.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/objects/navigations/experimental/index?rlang=cs</link_docs>
<controls>
<![CDATA[
<p>Move the path endpoints and obstacles in the scene with the <b>widget manipulator</b>.<br/>
<b>LMB</b> click on object to show the manipulator.<br/>
<b>W</b> - switch the manipulator to movement mode<br/>
<b>E</b> - switch the manipulator to rotation mode<br/>
<b>F</b> - focus the camera on the selected object<br/>
<b>U</b>, <b>Esc</b> - deselect the object</p>
]]>
</controls>
<tags>
<tag>Navigation & Pathfinding</tag>
</tags>
</sample>
<sample title="Experimental Navigation Mesh Character" id="experimental_navigation_mesh_character" category_id="navigation">
<sdk_desc><![CDATA[Moving an animated character over an <b>Experimental Navigation Mesh</b> with the root motion of the animation graph.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates an animated character walking to a target over an <b>Experimental Navigation Mesh</b>. The character's movement along the route is taken from the root motion of the locomotion animations.</p>
<p>Drag the target material ball with the manipulator and the character replans their route and walks to the new place. The locomotion settings can be adjusted in the <i>Parameters</i> section.</p>
<p>The <i>Status</i> block reports the route state, the current animation state, the velocity the character actually moves at, and the rate the walk animation is played at.</p>
<p>This sample is useful for animated agents navigating a scene: characters in games, pedestrians in a simulation, any unit whose animation is expected to drive its movement.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/objects/navigations/experimental/index?rlang=cs</link_docs>
<controls>
<![CDATA[
<p>Move the target node in the scene with the <b>widget manipulator</b>.<br/>
<b>LMB</b> click on object to show the manipulator.<br/>
<b>W</b> - switch the manipulator to movement mode<br/>
<b>F</b> - focus the camera on the selected object<br/>
<b>U</b>, <b>Esc</b> - deselect the object</p>
]]>
</controls>
<tags>
<tag>Navigation & Pathfinding</tag>
</tags>
</sample>
<sample title="Experimental Navigation Mesh Conversion" id="experimental_navigation_mesh_conversion" category_id="navigation">
<sdk_desc><![CDATA[Converting navigation data between the classic <b>Navigation Mesh</b> and the <b>Experimental Navigation Mesh</b>.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how navigation data can be moved between the classic <b>Navigation Mesh</b> and the <b>Experimental Navigation Mesh</b>.</p>
<p>Both are baked by the same experimental navigation baker from one shared set of settings over the same scene geometry, so the two results can be compared side by side. Their data, however, is kept in different formats: the classic node stores a polygon mesh in a <b>.mesh</b> file, the experimental one a tiled <b>.navmesh</b> asset. The sample converts the data of one node into the format of the other: the classic mesh can be converted into the experimental format and back in memory, or exported to a <b>.mesh</b> file.</p>
<p>The experimental system bakes the walkable surface from the scene geometry instead of areas placed by hand, streams it in tiles for worlds too large to fit in memory, and supports area volumes with their own cost.</p>
<p>This sample is useful when moving a project to the new navigation system: the navigation already prepared for the classic node can be carried over as it is, and the two systems can run side by side while the migration is in progress.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/objects/navigations/experimental/index?rlang=cs</link_docs>
<controls>
<![CDATA[
<p>Move the navigation mesh nodes in the scene with the <b>widget manipulator</b>.<br/>
<b>LMB</b> click on object to show the manipulator.<br/>
<b>W</b> - switch the manipulator to movement mode<br/>
<b>E</b> - switch the manipulator to rotation mode<br/>
<b>F</b> - focus the camera on the selected object<br/>
<b>U</b>, <b>Esc</b> - deselect the object</p>
]]>
</controls>
<tags>
<tag>Navigation & Pathfinding</tag>
</tags>
</sample>
<sample title="Experimental Navigation Mesh Crowd" id="experimental_navigation_mesh_crowd" category_id="navigation">
<sdk_desc><![CDATA[Moving a crowd of agents over an <b>Experimental Navigation Mesh</b> with collision avoidance.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates a crowd of agents moving over an <b>Experimental Navigation Mesh</b>, each one planning its own route and steering around the others on the way. Before an agent moves, it evaluates its neighbors and adjusts its speed and direction to avoid a collision. The crowd starts with a hundred agents and can be restarted with ten to three hundred.</p>
<p>The sample provides three navigation scenarios:</p>
<p> - <b>Bottleneck</b> - two teams on the opposite sides of a wall swap places, each agent taking the shortest route through the gates</p>
<p> - <b>Circle</b> - the agents are placed on a circle and head for its diametrically opposite point</p>
<p> - <b>Wander</b> - the agents walk between random points of the mesh</p>
<p>The <i>Status</i> block reports the current scenario, the number of agents, and how many goals they have reached. <i>Agents without a route</i> is a diagnostic counter: anything above zero means an agent was spawned off the mesh or cannot reach its target.</p>
<p>This sample is useful for crowds of characters in games, for pedestrian and evacuation simulations, and for any scene where many units or vehicles share the same space.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/objects/navigations/experimental/index?rlang=cs</link_docs>
<tags>
<tag>Navigation & Pathfinding</tag>
</tags>
</sample>
<sample title="Experimental Navigation Mesh Demo" id="experimental_navigation_mesh_demo" category_id="navigation">
<sdk_desc><![CDATA[Configuring pathfinding to multiple targets on a plane with obstacles using <b>Experimental Navigation Mesh</b>.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates several material balls collecting coins on a plane with obstacles, navigating around by means of an <b>Experimental Navigation Mesh</b>. Each ball looks for its own way to the coin and follows it, staying on the navigation mesh as it moves; once a coin is collected, the next one appears elsewhere. Every ball has its own tab, so they can be given different settings and compared while they move - the ball being edited is highlighted in the scene.</p>
<p>This sample is useful for crowds and groups of units in games, and for simulations where many vehicles or machines move through the same space at once.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/objects/navigations/experimental/index?rlang=cs</link_docs>
<controls>
<![CDATA[
<p>Move the targets and obstacles in the scene with the <b>widget manipulator</b>.<br/>
<b>LMB</b> click on object to show the manipulator.<br/>
<b>W</b> - switch the manipulator to movement mode<br/>
<b>E</b> - switch the manipulator to rotation mode<br/>
<b>F</b> - focus the camera on the selected object<br/>
<b>U</b>, <b>Esc</b> - deselect the object</p>
]]>
</controls>
<tags>
<tag>Navigation & Pathfinding</tag>
</tags>
</sample>
<sample title="Experimental Navigation Mesh Queries" id="experimental_navigation_mesh_queries" category_id="navigation">
<sdk_desc><![CDATA[Performing spatial queries on an <b>Experimental Navigation Mesh</b>: nearest and reachable points, random points, boundaries, and polygons in an area.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates the spatial queries an <b>Experimental Navigation Mesh</b> can answer about the walkable area, without building a full route.</p>
<p>The central ball is the query point: drag it around the level and, depending on the selected mode, see the nearest walkable position, the places reachable from here within a given travel cost, where the walkable area ends, or the parts of the mesh that fall inside a box drawn around the point. Seven queries with adjustable parameters are available, switched with the <b>Query mode</b> selector.</p>
<p>These queries are the building blocks behind common gameplay and simulation tasks: placing a unit on walkable ground, showing how far it can go in one turn, scattering spawn points over the level, and keeping an agent away from ledges.</p>
<p>The <i>Status</i> block reports the state of the mesh (polygons, walkable area size, loaded tiles) and the numbers the current query returned.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/objects/navigations/experimental/index?rlang=cs</link_docs>
<controls>
<![CDATA[
<p>Move the query points in the scene with the <b>widget manipulator</b>.<br/>
<b>LMB</b> click on object to show the manipulator.<br/>
<b>W</b> - switch the manipulator to movement mode<br/>
<b>E</b> - switch the manipulator to rotation mode<br/>
<b>F</b> - focus the camera on the selected object<br/>
<b>U</b>, <b>Esc</b> - deselect the object</p>
]]>
</controls>
<tags>
<tag>Navigation & Pathfinding</tag>
</tags>
</sample>
<sample title="Experimental Navigation Mesh Terrain" id="experimental_navigation_mesh_terrain" category_id="navigation">
<sdk_desc><![CDATA[Navigating a large terrain using two levels of detail: a coarse <b>Experimental Navigation Mesh</b> for the whole world and a detailed one streamed and baked around the agents at runtime.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to build a hierarchical navigation model on a large terrain, so the full detail is only kept around the agents, instead of being held in memory all at once. The world holds two <b>Experimental Navigation Mesh</b> nodes different in resolution: a coarse one, baked with a large cell size, covering the terrain entirely, and a detailed one with small cells whose tiles are continuously baked and streamed as the agents move.</p>
<p><b>Right-click</b> a place on the terrain to send the group of animated characters there. Each agent plans the whole route on the coarse mesh first, then splits it into legs and walks every leg on the detailed mesh. Both meshes are coloured depending on the area each polygon belongs to, which defines its traversal cost.</p>
<p>Spawn and move obstacles on the agents' way to cut the walkable area out of both meshes, and see how the affected tiles are rebaked and the agents route around the obstruction.</p>
<p>The <i>Status</i> block reports the state of both meshes and the route of the lead agent leg by leg, along with the failure reason when a route cannot be built.</p>
<p>This sample is useful for open worlds and large simulation sites where the layout changes at runtime and a single navigation mesh cannot cover the needed detail.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/objects/navigations/experimental/index?rlang=cs</link_docs>
<controls>
<![CDATA[
<p><b>RMB</b> click on the terrain - send the agents to that point<br/>
Move the spawned obstacles in the scene with the <b>widget manipulator</b>.<br/>
<b>LMB</b> click on object to show the manipulator.<br/>
<b>W</b> - switch the manipulator to movement mode<br/>
<b>E</b> - switch the manipulator to rotation mode<br/>
<b>F</b> - focus the camera on the selected object<br/>
<b>U</b>, <b>Esc</b> - deselect the object</p>
]]>
</controls>
<tags>
<tag>Navigation & Pathfinding</tag>
</tags>
</sample>
<sample title="Navigation Mesh 2D" id="navigation_mesh_2d" category_id="navigation">
<sdk_desc><![CDATA[Calculating and visualizing 2D navigation paths using a <i>Navigation Mesh</i> object and <i>PathRoute</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to calculate and visualize 2D navigation paths using the <b>Navigation Mesh</b> object and <i>PathRoute</i> class via the C# API. It shows how to build a route between two points on a navigation mesh and renders the result for debugging or visualization purposes.</p>
<p>This setup is useful for prototyping AI navigation, testing route validity, and analyzing the structure of navigable areas in 2D gameplay scenarios.</p>
]]>
</brief>
</desc>
<tags>
<tag>Navigation & Pathfinding</tag>
<tag>Visualizer (Visual Debug)</tag>
</tags>
</sample>
<sample title="Navigation Mesh 2D Demo" id="navigation_mesh_2d_demo" category_id="navigation">
<sdk_desc><![CDATA[Calculating and visualizing 2D navigation paths with moving targets using <i>Navigation Mesh</i> object and <i>PathRoute</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to implement dynamic 2D pathfinding using a <b>Navigation Mesh</b> object, with autonomous robots navigating toward randomly positioned targets. Each robot uses a <i>PathRoute</i> class instance to calculate a valid route within the navigation mesh and moves along it in real time.</p>
<p>This setup is useful for prototyping simple AI behavior such as patrolling or target chasing, where agents continuously search for and move toward dynamic goals.</p>
]]>
</brief>
</desc>
<tags>
<tag>Navigation & Pathfinding</tag>
<tag>Visualizer (Visual Debug)</tag>
</tags>
</sample>
<sample title="Navigation Obstacles 2D" id="navigation_obstacles_2d" category_id="navigation">
<sdk_desc><![CDATA[Demonstrating the use of <i>Obstacles</i> within a <i>Navigation Mesh</i> to dynamically modify valid pathfinding areas at runtime.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to use dynamic <b>Obstacles</b> in combination with a <b>Navigation Mesh</b> to influence 2D pathfinding in runtime. When an obstacle overlaps the navigation mesh, it temporarily modifies the traversable area, forcing the pathfinding algorithm to recalculate a valid route around it.</p>
<p>This example is useful for prototyping interactive environments, where navigation must adapt to moving objects, barriers, or other gameplay elements affecting traversal.</p>
]]>
</brief>
</desc>
<tags>
<tag>Navigation & Pathfinding</tag>
<tag>Visualizer (Visual Debug)</tag>
</tags>
</sample>
<sample title="Navigation Sectors 2D" id="navigation_sectors_2d" category_id="navigation">
<sdk_desc><![CDATA[Calculating and visualizing 2D navigation paths using <i>Navigation Sector</i> objects and the <i>PathRoute</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to calculate and visualize 2D navigation paths using the <b>Navigation Sector</b> objects and <i>PathRoute</i> class. Unlike navigation meshes, sectors allow defining modular navigable areas that can be enabled, disabled, or moved dynamically at runtime.</p>
<p>This 2D version is well-suited for top-down navigation, grid-based layouts, or layered 2D gameplay. For more complex 3D navigation scenarios, see the <i>Navigation Sectors 3D</i> sample.</p>
]]>
</brief>
</desc>
<tags>
<tag>Navigation & Pathfinding</tag>
<tag>Visualizer (Visual Debug)</tag>
</tags>
</sample>
<sample title="Navigation Sectors 3D" id="navigation_sectors_3d" category_id="navigation">
<sdk_desc><![CDATA[Calculating and visualizing 3D navigation paths using <i>Navigation Sector</i> objects and the <i>PathRoute</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to calculate and visualize 3D navigation paths using the <b>Navigation Sector</b> objects and <i>PathRoute</i> class via the C# API. Unlike navigation meshes, sectors allow defining modular navigable areas that can be enabled, disabled, or moved dynamically at runtime.</p>
<p>This setup is useful for multilevel structures or modular environments where the layout changes dynamically. For simpler 2D navigation scenarios, see the <i>Navigation Sectors 2D</i> sample.</p> ]]>
</brief>
</desc>
<tags>
<tag>Navigation & Pathfinding</tag>
<tag>Visualizer (Visual Debug)</tag>
</tags>
</sample>
<sample title="Navigation Sectors 3D Demo" id="navigation_sectors_3d_demo" category_id="navigation">
<sdk_desc><![CDATA[Calculating and visualizing 3D navigation paths using <i>Navigation Sector</i> and the <i>PathRoute</i> class to track dynamic targets.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to implement 3D pathfinding logic using <b>Navigation Sector</b> and <i>PathRoute</i> class via the C# API. Robots autonomously fly and collect coins, which are dynamically placed at random locations within the navigation sector volume.</p>
<p>The main logic is implemented in the <b>PathRoute3DWithTarget</b> component. A <i>PathRoute</i> object is created to calculate a valid 3D path from the robot's current position to the target using <i>PathRoute.Create3D()</i>. Once a valid path is generated, the robot rotates toward the next point in the path and moves forward. If the path becomes invalid - for example, if the target ends up in an unreachable area, then the system selects a new target location and recalculates the route.</p>
<p>Target positions are chosen at random inside the volume of a <i>Navigation Sector</i>, using <i>Inside3D()</i> for validation. The route is automatically updated as the robot approaches the target. If the route is successfully resolved, the path is drawn on screen using <i>RenderVisualizer()</i>.</p>
<p>To help visualize active navigation areas, the <b>NavigationSectorVisualizer</b> component renders the geometry of all sectors during runtime.</p>
]]>
</brief>
</desc>
<tags>
<tag>Navigation & Pathfinding</tag>
<tag>Visualizer (Visual Debug)</tag>
</tags>
</sample>
<sample title="HTTP Image Request" id="http_image_request" category_id="network">
<sdk_desc><![CDATA[This sample shows how to implement an asynchronous <i>HTTP</i> request to a <i>REST API</i> to download image files and apply them to scene objects at runtime.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample shows how to implement an asynchronous <i>HTTP</i> request to a <i>REST API</i> to download image files and apply them to scene objects at runtime.</p>
<p>Two requests are performed to retrieve sample image data:</p>
<p> - <b>eu.httpbin.org/image/png</b> - to download a <i>PNG</i> image</p>
<p> - <b>eu.httpbin.org/image/jpeg</b> - to download a <i>JPEG</i> image</p>
<p>Only <i>PNG</i> and <i>JPEG</i> formats are supported for runtime loading into an <i>Image</i> Class instance from raw data.</p>
<p>The <i>System.Net.Http.HttpClient</i> class is used to perform the <i>HTTP</i> requests. Once an image is retrieved, it is loaded from raw byte data using the <i>Image.Load()</i> method. If successful, the image is assigned to the albedo texture slot of the target material using <i>Material.SetTextureImage()</i>. The texture is applied at runtime to the specified surface of an object in the scene. If loading fails, the downloaded data is written to a file for further inspection.</p>
<p>This sample showcases a practical approach to fetching external media assets, validating them, and using them in your scenes or application logic.</p>
]]>
</brief>
</desc>
<tags>
<tag>Network</tag>
</tags>
</sample>
<sample title="HTTP Request Handling" img="yes" id="http_request_handling" category_id="network">
<sdk_desc><![CDATA[Implementing asynchronous <i>HTTP GET</i> requests to external <i>REST API</i> and displaying the retrieved data in the user interface.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to implement asynchronous <i>HTTP GET</i> requests to external <i>REST API</i> and display the retrieved data in the user interface.</p>
<p>For demonstration, the sample performs two consecutive requests to external weather <i>API</i> and displays the results in real time.</p>
<p> - <b>Geocoding</b> - resolving a location by name using <i>geocoding-api.open-meteo.com</i>.</p>
<p> - <b>Current weather conditions</b> - retrieving live meteorological data for the selected location using <i>api.open-meteo.com</i>.</p>
<p>Additional response details can be viewed in the console output.</p>
<p>You can interactively test the workflow by entering a city name in the <i>UI</i>, viewing a list of possible matches, and selecting a specific location. This triggers a request for up-to-date weather data, which is then parsed and displayed in the <i>UI</i>.</p>
<p>Asynchronous processing ensures that network operations do not block or degrade the simulation performance.</p>
<p>This sample can serve as a foundation for integrating any external data providers.</p>
]]>
</brief>
</desc>
<tags>
<tag>Network</tag>
</tags>
</sample>
<sample title="TCP Sockets" id="tcp_sockets" category_id="network">
<sdk_desc><![CDATA[Establishing and managing <i>TCP</i> socket connections between a server and multiple clients each represented by a UNIGINE-application. Clients can connect to the server, exchange text messages via the Console, and receive camera transform updates from the server.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to establish and manage <i>TCP</i> socket connections between a server and multiple clients each represented by a UNIGINE-application. Clients can connect to the server, exchange text messages via the Console (<b>send_msg</b> command), and receive camera transform updates from the server.</p>
<p><b>You need to have two instances of this 'C# Samples' app running for this sample to work.</b></p>
<p>Each instance can operate in one of two modes: <i>Server</i> or <i>Client</i>. To select the mode click on the corresponding button below. There you can also specify the desired <i>host and port</i>.</p>
<p>The server uses a non-blocking socket to accept client connections and creates a dedicated background thread for each connection. The communication protocol is based on custom messages (e.g., text or camera transforms) packed and unpacked using <i>Blob</i> streams. On the client side, a socket is created and connected to the server. Incoming and outgoing messages are sent/received using two threadsafe queues. To send text messages to the peer use the sample-specific console command <b>send_msg</b> (e.g. <b>send_msg hello world</b>)</p>
<p>Incoming messages are parsed using message headers. Both client and server use message buffering, timeouts, and validation checks to maintain connection stability and prevent invalid data processing.</p>
<p>The sample provides options to configure the server address and port, switch between modes, and monitor active connections.</p>
]]>
</brief>
</desc>
<tags>
<tag>Network</tag>
<tag>Basic Recipes</tag>
</tags>
</sample>
<sample title="UDP Sockets" id="udp_sockets" category_id="network">
<sdk_desc><![CDATA[Using the sockets API to send and receive UDP messages in the network between two peers each represented by a UNIGINE-application.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample shows how to use the sockets API to send and receive UDP messages between two peers in the network.</p>
<p><b>You need to have two instances of this 'C# Samples' app running for this sample to work.</b></p>
<p>Each instance can operate in one of two modes: <i>Sender</i> or <i>Receiver</i>. To select the mode click on the corresponding button below. There you can also specify the <i>Receiver's hostname and port</i>.</p>
<p>In <i>Sender</i> mode the app packs the player's camera transform into a datagram and sends it to the <i>Receiver</i> on every engine update.</p>
<p>While in this mode you can also send text messages to the peer by using this sample-specific console command <b>send_msg</b> (e.g., <b>send_msg hello world</b>).</p>
<p>In <i>Receiver</i> mode the app receives and interprets incoming messages from the peer: the text messages are written to console, and the camera transforms are applied to the player.</p>
]]>
</brief>
</desc>
<tags>
<tag>Network</tag>
<tag>Basic Recipes</tag>
</tags>
</sample>
<sample title="Cluster" id="cluster" category_id="nodes">
<sdk_desc><![CDATA[Dynamic manipulation of <i>ObjectMeshCluster</i> in UNIGINE, showcasing how to add/remove mesh instances at runtime through user interaction.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates dynamic manipulation of <b>ObjectMeshCluster</b> in UNIGINE, showcasing how to add/remove mesh instances at runtime through user interaction. A <b>Mesh Cluster</b> allows you to bake identical meshes (with the same material applied to their surfaces) into a single object, which provides less cluttered spatial tree, reduces the number of texture fetches and speeds up rendering.</p>
<p><b>Core Features:</b></p>
<p> - <b>Placement and Removal</b> - click on empty ground adds a new mesh at the clicked position, click on existing cluster geometry removes the selected mesh instance from the cluster</p>
<p> - <b>Raycasting and Intersection Testing</b> - casts a ray from the camera through the mouse position to detect whether the user clicked on a cluster mesh or terrain</p>
<p><b>Use Cases:</b></p>
<p> - Scattering objects like rocks, grass, or debris</p>
<p> - Dynamic level editing and environment design</p>
<p> - Performance-sensitive applications with many similar mesh instances.</p>
]]>