I get a "Missing Reference Exception" if I reload my Scene by using Application.LoadLevel()
and the iTweenStop-Action (with id) fires in one of my FSMs.
Everything works fine before I reload my scene.
It seems it doesn't like it if an "id" is supplied to iTweenStop after the Application.LoadLevel() since somehow the reference to the GameObject gets lost.
instead of using
iTween.StopByName(id.Value);in iTweenStop.cs in the Action Folder I use:
GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
if (go == null)
I hope that helps anyone with a similar problem.
Just for completeness, here's the ErrorLog:
MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.GameObject.GetComponents (System.Type type) (at C:/BuildAgent/work/b0bcff80449a48aa/Runtime/ExportGenerated/Editor/UnityEngineGameObject.cs:63)
iTween.StopByName (UnityEngine.GameObject target, System.String name) (at Assets/iTween/iTween.cs:6445)
iTween.StopByName (System.String name) (at Assets/iTween/iTween.cs:6393)
HutongGames.PlayMaker.Actions.iTweenStop.DoiTween () (at Assets/PlayMaker/Actions/iTween/iTweenStop.cs:56)
HutongGames.PlayMaker.Actions.iTweenStop.OnEnter () (at Assets/PlayMaker/Actions/iTween/iTweenStop.cs:30)