This class provides a .photonView and all callbacks/events that PUN can call. Override the events/methods you want to use.
By extending this class, you can implement individual methods as override. Visual Studio and MonoDevelop should provide the list of methods when you begin typing "override". Your implementation does not have to call "base.method()". This class implements IPunCallbacks, which is used as definition of all PUN callbacks. Don't implement IPunCallbacks in your classes. Instead, implent PunBehaviour or individual methods.
Inheritance: Photon.MonoBehaviour, IPunCallbacks
 public static void Destroy(this Photon.PunBehaviour obj, bool deactive = true)
 {
     if (PhotonNetwork.inRoom)
     {
         if (obj.photonView.isMine)
         {
             PhotonNetwork.Destroy(obj.photonView);
         }
     }
     else
     {
         if (deactive)
         {
             obj.gameObject.SetActive(false);
         }
         else
         {
             GameObject.Destroy(obj.gameObject);
         }
     }
 }
Exemple #2
0
 public static bool isMine(Photon.PunBehaviour script)
 {
     return(!PhotonNetwork.inRoom || script.photonView.isMine);
 }