Get specific GameObject in Windows Phone Object

Hi,

After reading this post http://docs.unity3d.com/Documentation/Manual/wp8-unity-interaction.html, i’m trying to launch videos when events are raised from my unity project.

Then i attempt to do this :

LaunchMovieScript mvScript;
private void Unity_Loaded()
{
    mvScript = UnityEngine.Object.FindObjectOfType<LaunchMovieScript>();
    mvScript.LaunchMovie += mvScript_LaunchMovie;
}

But the mvScript member is always null.

I’ve tried UnityEngine.GameObject.Find(“MyGameObject”), and I have the same result.

Can someone help me ?

That will only work if there is a gameobject in the scene that has the script attached.

Yes, it is like you said : i have attached this script to a game object containing a gui texture (start new game). that script check on mouse down if it is the first time the player launch the game, and if true, raise an event.

I don’t understand why my VS project does’nt get the instance of that gameObject.

Maybe you can publish the unity project associated to that step by step guide, it will help me a lot :slight_smile:

It’s attached to the sample. Check below the screenshot.