⌨
Initialization
Initialize the Kinetix Unity SDK
The initialization of the Kinetix SDK should only be done ONCE when the app starts
You can initialize the SDK with parameters in the KinetixCoreConfiguration :
- GameAPIKey => Game API Key
- PlayAutomaticallyAnimationOnAnimators => true if you want the SDK to handle the animator.
- EnableAnalytics => true if you want to help us and share general informations of how users use our SDK.
- ShowLogs => true if you want to log the behaviour of the SDK for debug purposes.
- EnableUGC => true if you want to enable UGC
- NetworkConfiguration => Customize network configuration
- CachedEmotesNb => Number of emotes cache in storage
C#
[SerializeField] private Animator myAnimator;
[SerializeField] private string myConnectedUserID;
private void Awake()
{
KinetixCore.OnInitialized += OnInitialize;
KinetixCore.Initialize(new KinetixCoreConfiguration()
{
GameAPIKey = "yourGameAPIKey",
PlayAutomaticallyAnimationOnAnimators = true,
EnableAnalytics = true
});
}
// This callback is used for the actions made after the SDK is initialized
// Such as initializing the UI and Registering our LocalPlayer's animator
private void OnInitialize()
{
// Register local player to receive animation
// See "Animation System" documentation
KinetixCore.Animation.RegisterLocalPlayerAnimator(myAnimator);
// Initialise the UI package here
// This is an optional package
// Please see "UI Integration" under "Configure Modules"
KinetixUIEmoteWheel.Initialize();
// Now, we connect the current user's account to get his emotes
// The userID is chosen by you, and must be unique to each user
// See "Account Management" documentation
KinetixCore.Account.ConnectAccount(string myConnectedUserID, () => {
Debug.Log("Account connected successfully");
}, () => {
Debug.LogError("There was a problem during account connection. Is the GameAPIKey correct?");
});
}
Last modified 1mo ago