I'm getting a warning in Unity 5.3.1 (EDIT: 5.3.2f1 as well) and 2D Toolkit 2.5.6.
DontDestroyOnLoad only work for root GameObjects or components on root GameObjects.
UnityEngine.Object:DontDestroyOnLoad(Object)
Double clicking the warning sends me here:
public static tk2dSystem inst
{
get
{
if (_inst == null)
{
// Attempt to load the global instance and create one if it doesn't exist
_inst = Resources.Load(assetName, typeof(tk2dSystem)) as tk2dSystem;
if (_inst == null)
{
_inst = ScriptableObject.CreateInstance<tk2dSystem>();
}
// We don't want to destroy this throughout the lifetime of the game
DontDestroyOnLoad(_inst); //<--- This generates the warning!
}
return _inst;
}
}
Line 52 of tk2dSystem.cs