Reputation: 3266
I have unity 4.5 and added Sixense package to it. My scene includes: Sixense hands prefab and Sixense input prefab. the sixense input prefab has a script called SixenseInput.cs which came with the Sixense package. The problem is when I start the scene everything works but when I stop the scene and start again unity is crashing and the log says - Access Violation. I disabled the SixensInput script from the inspector and then Unity is never crashes. What can I do?!
Upvotes: 0
Views: 164
Reputation: 11
I also found the "SixenseUnityPlugin" asset to be sensitive to repeated stop and start of the Unity editor. The cause appeared to be a crash in the bundled native DLL.
The fix for me was to add the following to the file SixenseInput.cs:
public static bool isAlreadyQuited = false;
/// <summary>
/// Exit sixense when the application quits.
/// </summary>
void OnApplicationQuit()
{
if (!isAlreadyQuited)
{
isAlreadyQuited = true;
SixensePlugin.sixenseExit();
}
}
I cannot recall wheter the used function "sixenseExit()" from SixensePlugin.cs was already present before, but this are the necessary lines there:
[DllImport("sixense", EntryPoint = "sixenseExit")]
public static extern int sixenseExit();
Upvotes: 1
Reputation: 3266
Something with the Sixense files was wrong. I uninstalled the Sixense asset from Unity - and then I downloaded and re-install it.
Upvotes: 0