2013-10-14 57 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);