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
双精度坐标
应用程序接口
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

Unigine.Plugins.SpiderVision.DebugData Class

This object stores the debug data such as the warp grid state, blend zone adjustment points, viewport debug color filling, etc.

Notice
The debug data are not stored in the configuration file.

This object is accessible via the corresponding method of the ViewportData class.

DebugData Class

Properties

bool ShowBlendLines#

The value indicating if the visualization is enabled for blend area control lines and selected points on the screen.

vec2[] BlendPointPositions#

The positions of blend area points displayed in the viewport.

bool ShowGrid#

The value indicating if the visualization of warping grid on the screen is enabled.

bool WarpPointsEnabled#

The value indicating if warping control points are displayed in the viewport.

vec2[] WarpPointPositions#

The positions of warping grid control points displayed in the viewport.

int DebugColorIndex#

The indexed color used in debug mode.
Notice
Setting individual colors for different viewports enables you to visualize overlapping regions for different viewports and facilitates the setup process.

vec4 DebugColor#

The color used in debug mode.
Notice
Setting individual colors for different viewports enables you to visualize overlapping regions for different viewports and facilitates the setup process.

Event EventChanged#

The event triggered on changing debug data. You can subscribe to events via Connect() and unsubscribe via Disconnect(). You can also use EventConnection and EventConnections classes for convenience (see examples below).
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Usage Example

Source code (C#)
// implement the Changed event handler
void changed_event_handler()
{
	Log.Message("\Handling Changed event\n");
}

//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an EventConnections instance
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections changed_event_connections = new EventConnections();


// link to this instance when subscribing to an event (subscription to various events can be linked)
DebugData.EventChanged.Connect(changed_event_connections, changed_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
DebugData.EventChanged.Connect(changed_event_connections, () => { 
		Log.Message("Handling Changed event lambda\n");
		}
	);

// later all of these linked subscriptions can be removed with a single line
changed_event_connections.DisconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe to the Changed event with a handler function
DebugData.EventChanged.Connect(changed_event_handler);


// remove subscription to the Changed event later by the handler function
DebugData.EventChanged.Disconnect(changed_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   3. Subscribe to an event and unsubscribe later via an EventConnection instance
//////////////////////////////////////////////////////////////////////////////

// define a connection to be used to unsubscribe later
EventConnection changed_event_connection;

// subscribe to the Changed event with a lambda handler function and keeping the connection
changed_event_connection = DebugData.EventChanged.Connect(() => { 
		Log.Message("Handling Changed event lambda\n");
	}
);

// ...

// you can temporarily disable a particular event connection 
changed_event_connection.Enabled = false;

// ... perform certain actions

// and enable it back when necessary
changed_event_connection.Enabled = true;

// ...

// remove the subscription later using the saved connection
changed_event_connection.Disconnect();

//////////////////////////////////////////////////////////////////////////////
//   4. Ignoring Changed events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
DebugData.EventChanged.Enabled = false;

// ... actions to be performed

// and enable it back when necessary
DebugData.EventChanged.Enabled = true;

Members


string GetDebugColorName ( int index ) #

Returns the name of the debug color by its index.

Arguments

  • int index - Index of the color used in debug mode.

Return value

Name of the indexed color.

int GetNumDebugColors ( ) #

Returns the total number of indexed debug colors.

Return value

The total number of indexed debug colors.

void Save ( Stream stream ) #

Saves the debug data to the specified stream.

Arguments

  • Stream stream - Stream to which the data is to be written.

void Restore ( Stream stream ) #

Loads the debug data from the specified stream.

Arguments

  • Stream stream - Stream the data from which is to be loaded.

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

Last update: 2024-12-13
Build: ()