使用 PhotonView.isMine 方法时无法检测到错误
Unable to detect error while using PhotonView.isMine method
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
using System.IO;
using UnityEngine.UI;
public class PhotonPlayerSetup : MonoBehaviourPunCallbacks, IInRoomCallbacks
{
private PhotonView PV;
void Awake()
{
PV = GetComponent<PhotonView>();
}
void Start()
{
if(PV.isMine)
{
}
}
}
使用上述代码时出现此错误:
"PhotonView does not contain a definition for isMine
and no
accessible extension method isMine
accepting a first argument of
type 'PhotonView' could be found (are you missing a using directive or
an assembly reference?)"
感谢您选择光子!
PUN Classic 中的 PhotonView.isMine
在 PUN 2 中重命名为 PhotonView.IsMine
。
请务必查看 Migration Notes.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
using System.IO;
using UnityEngine.UI;
public class PhotonPlayerSetup : MonoBehaviourPunCallbacks, IInRoomCallbacks
{
private PhotonView PV;
void Awake()
{
PV = GetComponent<PhotonView>();
}
void Start()
{
if(PV.isMine)
{
}
}
}
使用上述代码时出现此错误:
"PhotonView does not contain a definition for
isMine
and no accessible extension methodisMine
accepting a first argument of type 'PhotonView' could be found (are you missing a using directive or an assembly reference?)"
感谢您选择光子!
PUN Classic 中的PhotonView.isMine
在 PUN 2 中重命名为 PhotonView.IsMine
。
请务必查看 Migration Notes.