2013-10-14 54 views
0

我将PUN 1.22集成到我的Unity3d wp8项目中。它构建正确,但是PhotonView.Get(this)返回null。它会是什么?PhotonView.Get(this)返回null

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

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

回答

0

只是忘记PhotonView连接到我的游戏对象

解决方案:

this.gameObject.AddComponent<PhotonView>(); 
photonView = PhotonView.Get(this);