Photon Unity Networking: Photon.MonoBehaviour Class Reference

Photon Unity Networking

Photon.MonoBehaviour Class Reference

This class adds the property photonView, while logging a warning when your game still uses the networkView. More...

Inherits MonoBehaviour.

Inherited by Photon.PunBehaviour, and PhotonView.

Properties

PhotonView photonView [get]
 A cached reference to a PhotonView on this GameObject. More...
 
new PhotonView networkView [get]
 This property is only here to notify developers when they use the outdated value. More...
 

Detailed Description

This class adds the property photonView, while logging a warning when your game still uses the networkView.

Property Documentation

new PhotonView Photon.MonoBehaviour.networkView
get

This property is only here to notify developers when they use the outdated value.

If Unity 5.x logs a compiler warning "Use the new keyword if hiding was intended" or "The new keyword is not required", you may suffer from an Editor issue. Try to modify networkView with a if-def condition:

#if UNITY_EDITOR new #endif public PhotonView networkView

PhotonView Photon.MonoBehaviour.photonView
get

A cached reference to a PhotonView on this GameObject.

If you intend to work with a PhotonView in a script, it's usually easier to write this.photonView.

If you intend to remove the PhotonView component from the GameObject but keep this Photon.MonoBehaviour, avoid this reference or modify this code to use PhotonView.Get(obj) instead.

Online Documentation  -  Dashboard  -  Support Forum Exit Games GmbH