This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口(API)参考
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Complex

Arcade#


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.

Core Features:

  • Player Controller: Control a robot character with keyboard input for movement and rotation.
  • Projectile System: An automated turret fires projectiles using raycasting for hit detection and visual impact effects.
  • Enemy Turret: A rotating turret that periodically shoots projectiles at the player.
  • Health System: The robot takes damage and is destroyed when health reaches zero, with corresponding visual effects and cleanup.
  • Node Spawning & Deletion: Bullets and particle effects are dynamically created and removed, with timed destruction to manage scene performance.
  • Visual FX (Optional): Includes particle effects for shooting, impact, and destruction events.

Use Cases:

  • Game Prototyping: Provides a foundation for building shooter mechanics, or arcade-style gameplay.
  • Physics & Interaction: Demonstrates raycasting-based hit detection.
  • Learning Tool: Ideal for beginners exploring the UNIGINE C# API and gameplay scripting.

SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/arcade

Day-Night Switching#

This sample showcases a dynamic day-night cycle driven by the rotation of a World Light source (sun), animated according to a simulated global time. The sun's position is updated continuously or in response to manual time input. The time progression speed can be adjusted using the Timescale slider.

The sun's orientation influences both the overall scene lighting and object-specific responses, enabling or disabling nodes and adjusting the emission states of designated materials depending on whether it's currently day or night. Additional props, such as Projected Light node and door closed/open signage, are toggled to reflect the time of day. Red and blue helper vectors visualize the zenith direction and the sun's current orientation, respectively.

Two control modes are available:

  • Zenith Angle: Uses the angle between the sun's direction and the zenith (up vector). If the angle is below a threshold, it is considered daytime.
  • Time-Based: Defines day/night using configurable Morning and Evening hour boundaries sliders.

Use Cases:

Ideal for games, simulations, or architectural walkthroughs that need consistent lighting transitions and dynamic environmental response.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/day_night_switch

Robot Arm#


This sample demonstrates how to build a physics-based robotic arm with a kinematic chain composed of six links: one fixed and five movable. Each movable link is connected via a hinge joint (JointHinge) and driven by a motor that responds to keyboard inputs.

The arm's end effector is a magnetic gripper capable of grabbing, holding, and releasing dynamic objects in its environment. The gripper and each joint can be controlled independently via key bindings, which are configurable and demonstrated in the Controls section.

This setup provides a flexible starting point for creating custom robotic arms with any required number of degrees of freedom (DoF). You can replace manual input with a control system (e.g., inverse kinematics, AI, joystick, or ROS integration) to adapt the robot arm to your specific use case.

Use Cases:

  • Simulation & prototyping of industrial robotic manipulators.
  • Educational environments to teach principles of robotics, joint control, or physics-based animation.
  • AI training for robotic arms using reinforcement learning or motion planning.
  • Human-machine interfaces: test robotic interaction with dynamic environments.
  • Virtual reality robotics simulations or operator training.

SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/robot_arm

Camera First-Person#

This sample demonstrates a first-person spectator-style camera with free movement.

The CameraSpectator.cs component provides free-flight first-person controls by modifying the position and orientation of a PlayerDummy node in real time. The movement and rotation are handled via the CameraControls.cs component that defines directional input.

The camera moves in six directions (forward, backward, left, right, up, down) and rotates using pitch and yaw angles. The Speed and Angular Speed parameters can be adjusted in the component properties to control the camera's movement and rotation responsiveness.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/camera_first_person

Camera Orbit#

This sample demonstrates an orbital camera rotating around a target.

The CameraOrbit.cs component enables orbit-style camera movement around a target object using a PlayerDummy node. Input is handled via the CameraControls.cs component, which provides configurable input controls for camera movement and zoom.

The camera behavior can be customized using the exposed parameters: Angular Speed, Zoom Speed, Min/Max Distance, and Min/Max Vertical Angle. The Target field defines the object the camera orbits around.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/camera_orbit

Camera Panning#

This sample demonstrates a camera moving parallel to the screen plane using the CameraPanning.cs component assigned to a PlayerDummy node.

The CameraPanning.cs component implements a free panning camera that allows movement along the view plane, rotation, and zoom based on mouse input.

The camera position can be adjusted by dragging the scene, and rotation is enabled by holding the right mouse button. Zooming is controlled with the mouse wheel. The responsiveness of movement and rotation is configurable via the Default Linear Speed, Mouse Sensitivity, and Mouse Wheel Sensitivity parameters in the component properties.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/camera_panning

Camera Persecutor#

This sample demonstrates a camera following a moving target.

The CameraPersecutor.cs component implements a third-person follow camera that smoothly tracks a moving target defined in the Target field. The camera adjusts its distance, pitch, and yaw to maintain the desired view of the target, using the PlayerDummy node as its base.

Input is handled via the CameraControls.cs component and allows orbiting around the target as well as zooming in and out. The behavior is configurable through parameters such as Angular Speed, Zoom Speed, Min/Max Distance, Min/Max Vertical Angle, and the Use Fixed Angles toggle. The Target field can be manually assigned and defines the object the camera will follow.

The target movement is defined by the CameraPersecutorTarget.cs component, which moves the object along a circular path over time to demonstrate dynamic tracking.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/camera_persecutor

First-Person Controller#

This sample demonstrates implementation of the character controller using the component assigned to PlayerDummy.

Intersection is detected using shape-surface collision, and collision is detailed via the surface intersection.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/first_person_controller

Observer Controller#

This sample replicates the free camera used in the UnigineEditor. The camera offers the following key features:

  • Fly-Through Mode Freely move the camera in all directions using keyboard and mouse controls.
  • Focus on Objects Center the camera on any selected object and adjust distance automatically.
  • Zoom & Pan Zoom in and out, and pan while preserving view direction.
  • Speed Control Menu Switch between predefined movement speeds (1-3) or adjust custom speed values.
  • Position Management Set or teleport the camera to specific world coordinates through the menu.

SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/observer_controller

Spectator Controller#

This sample implements a first-person Spectator camera controller with configurable movement and physical collision detection using the Sphere collision shape, assigned to respond to collisions with geometry (e.g. with terrain) in the world.

Movement parameters such as speed, sprint acceleration, turning rate, and mouse sensitivity can be adjusted in real-time using the sliders in the Parameters section.

Use Cases:

  • Building custom camera tools with physical awareness for scene editing or testing purposes.
  • First-person 3D scenes navigation and exploring while preserving configurable interaction with the geometry.

SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/spectator_controller

Top Down Controller#

This sample demonstrates how to set up and control a top-down camera controller for real-time strategy or tactics-style gameplay. It implements core features typical for such games, including camera movement, zooming, rotation, unit selection, and focus tracking.

The logic is implemented across four components: CameraTopDown, CameraSelection, CameraUnitSelection, and CameraUnitPathControl:

  • The camera controls are implemented in the CameraTopDown component, which handles moving, adjusting zoom levels, and interpreting user input for panning and rotating the view. The camera also supports edge scrolling - when the mouse cursor moves near the edge of the screen, the camera starts moving in that direction. When one or more units are selected, the camera can optionally shift focus to the selection and follow it continuously while a key is held.
  • Selection logic is managed by the CameraSelection component. It enables rectangular selection of multiple units using a screen-space box and calculates the combined bounding sphere of all selected objects for proper camera focusing.
  • The CameraUnitSelection component is responsible for visual feedback during selection. It highlights selected units by rendering a visual circle beneath them.
  • One of the units in the scene includes the CameraUnitPathControl component, which drives its movement along a predefined path that includes multiple waypoints. The unit traverses the path in a loop, demonstrating how moving elements can be integrated into a top-down control system.

This setup provides a flexible base for implementing top-down camera control and unit interaction, useful for strategy games, tactical simulations, or scene overview tools.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/top_down_controller

The information on this page is valid for UNIGINE 2.20 SDK.

Last update: 2025-06-30
Build: ()