si-m1-face-package/Documentation~/SDK_Configuration.md

2.6 KiB

SDK Configuration

中文说明见 SDK_Configuration.zh-CN.md.

The SDK uses FaceSdkSettings as the recommended configuration asset. It is a ScriptableObject created inside the importing Unity project and can be synchronized to scene FaceModuleManager instances.

Default Settings Asset

Default path in the importing Unity project:

Assets/AISU/SI-M1 Face SDK/FaceSdkSettings.asset

Open AISU/SI-M1 Face SDK/Settings to load or create this asset.

FaceSdkSettings Fields

Field Type Description
TransportMode FaceTransportMode Auto, SerialPort, or Mock
UseMockInEditor bool Force mock transport in Unity Editor
PortName string Runtime/player serial port
BaudRate int Runtime/player baud rate
ReadBufferSize int Runtime/player read buffer size
UseEditorSerialDebugParameters bool Use separate serial parameters in Editor
EditorPortName string Editor debug serial port
EditorBaudRate int Editor debug baud rate
EditorReadBufferSize int Editor debug read buffer size
MockResponseDelayFrames int Mock response delay in frames
DebugLogEnabled bool Enable SDK debug logs
RawLogEnabled bool Dispatch raw TX/RX logs
LogPrefix string Log prefix

TransportMode

Mode Behavior
Auto Editor chooses mock or serial based on UseMockInEditor; Player uses serial
SerialPort Use SerialPortTransport
Mock Use MockFaceModuleTransport

When UseMockInEditor = true, the Editor always uses mock transport and does not open a real serial port.

Editor Tools

Menu Purpose
AISU/SI-M1 Face SDK/Settings Open SDK settings window
AISU/SI-M1 Face SDK/Create Manager GameObject Create or update one scene FaceModuleManager
AISU/SI-M1 Face SDK/Open Diagnostics Open diagnostics window

The public DLL-only package does not include importable demo samples. Any demo-related menu item should be treated as unavailable in the public release if it appears in the current Editor DLL.

manager.ApplySettings(settings);
manager.Open();

Legacy quick configuration:

manager.Configure(useMockInEditor: true, portName: "COM3", baudRate: 115200);
manager.Open();

Custom transport injection:

manager.ConfigureTransport(customTransport);
manager.Open();

Keep only one FaceModuleManager in each scene to avoid duplicate serial connections and duplicated events.