Native and Unity Hybrid Development¶
If your project is primarily developed natively, with some pages or business processes implemented using Unity, it is recommended to handle the SDK installation and initialization as follows.
Integration Principles¶
- The installation method remains unchanged. You can continue to refer to Application Integration
- It is recommended to complete SDK initialization within the native project
- The original initialization part in
FTSDK.cswithin the Unity project needs to be disabled to avoid duplicate initialization
Initialization Location¶
Please refer to the initialization documentation for the native platform and complete the configuration in the native project:
Disable Default Initialization on the Unity Side¶
// FTSDK.cs
IEnumerator _LoadPrefabs()
{
yield return Instantiate(MainThreadDispatch);
//_InitSDK(); // Disable initialization to avoid duplicate SDK startup
yield return Instantiate(ViewObserver);
}