PhotonView.Get(this) returns null

Options
I integrate PUN 1.22 to my Unity3d wp8 project. It builds correct, but PhotonView.Get(this) returns null. What can it be?

public static PhotonView Get(Component component)
{
return component.GetComponent<PhotonView>() as PhotonView;
}

public static PhotonView Get(GameObject gameObj)
{
return gameObj.GetComponent<PhotonView>() as PhotonView;
}

Comments

  • Tobias
    Options
    Maybe the GameObject or Component doesn't have a PhotonView? You need to attach the PV component of course.
  • it works, thanks))
    this.gameObject.AddComponent<PhotonView>();
    photonView = PhotonView.Get(this);