C# Класс PhotonView

Наследование: Photon.MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
ObservedComponents List
group int
instantiationId int
observed Component
onSerializeRigidBodyOption OnSerializeRigidBody
onSerializeTransformOption OnSerializeTransform
ownerId int
ownershipTransfer OwnershipOption
prefixBackup int
synchronization ViewSynchronization

Защищенные свойства (Protected)

Свойство Тип Описание
didAwake bool
lastOnSerializeDataReceived object[]
lastOnSerializeDataSent object[]
mixedModeIsReliable bool
removedFromLocalViewList bool

Открытые методы

Метод Описание
DeserializeView ( PhotonStream, stream, PhotonMessageInfo, info ) : void
Find ( int viewID ) : PhotonView,
Get ( Component component ) : PhotonView,
Get ( GameObject gameObj ) : PhotonView,
RPC ( string methodName, PhotonPlayer, targetPlayer ) : void

Call a RPC method of this GameObject on remote clients of this room (or on all, inclunding this client).

[Remote Procedure Calls](@ref rpcManual) are an essential tool in making multiplayer games with PUN. It enables you to make every client in a room call a specific method. This method allows you to make an RPC calls on a specific player's client. Of course, calls are affected by this client's lag and that of remote clients. Each call automatically is routed to the same PhotonView (and GameObject) that was used on the originating client. See: [Remote Procedure Calls](@ref rpcManual).

RPC ( string methodName, PhotonTargets target ) : void

Call a RPC method of this GameObject on remote clients of this room (or on all, inclunding this client).

[Remote Procedure Calls](@ref rpcManual) are an essential tool in making multiplayer games with PUN. It enables you to make every client in a room call a specific method. RPC calls can target "All" or the "Others". Usually, the target "All" gets executed locally immediately after sending the RPC. The "*ViaServer" options send the RPC to the server and execute it on this client when it's sent back. Of course, calls are affected by this client's lag and that of remote clients. Each call automatically is routed to the same PhotonView (and GameObject) that was used on the originating client. See: [Remote Procedure Calls](@ref rpcManual).

RefreshRpcMonoBehaviourCache ( ) : void

Can be used to refesh the list of MonoBehaviours on this GameObject while PhotonNetwork.UseRpcMonoBehaviourCache is true.

Set PhotonNetwork.UseRpcMonoBehaviourCache to true to enable the caching. Uses this.GetComponents() to get a list of MonoBehaviours to call RPCs on (potentially). While PhotonNetwork.UseRpcMonoBehaviourCache is false, this method has no effect, because the list is refreshed when a RPC gets called.

RequestOwnership ( ) : void

Depending on the PhotonView's ownershipTransfer setting, any client can request to become owner of the PhotonView.

Requesting ownership can give you control over a PhotonView, if the ownershipTransfer setting allows that. The current owner might have to implement IPunCallbacks.OnOwnershipRequest to react to the ownership request. The owner/controller of a PhotonView is also the client which sends position updates of the GameObject.

RpcSecure ( string methodName, PhotonPlayer, targetPlayer, bool encrypt ) : void

Call a RPC method of this GameObject on remote clients of this room (or on all, inclunding this client).

[Remote Procedure Calls](@ref rpcManual) are an essential tool in making multiplayer games with PUN. It enables you to make every client in a room call a specific method. This method allows you to make an RPC calls on a specific player's client. Of course, calls are affected by this client's lag and that of remote clients. Each call automatically is routed to the same PhotonView (and GameObject) that was used on the originating client. See: [Remote Procedure Calls](@ref rpcManual).

RpcSecure ( string methodName, PhotonTargets target, bool encrypt ) : void

Call a RPC method of this GameObject on remote clients of this room (or on all, inclunding this client).

[Remote Procedure Calls](@ref rpcManual) are an essential tool in making multiplayer games with PUN. It enables you to make every client in a room call a specific method. RPC calls can target "All" or the "Others". Usually, the target "All" gets executed locally immediately after sending the RPC. The "*ViaServer" options send the RPC to the server and execute it on this client when it's sent back. Of course, calls are affected by this client's lag and that of remote clients. Each call automatically is routed to the same PhotonView (and GameObject) that was used on the originating client. See: [Remote Procedure Calls](@ref rpcManual).

SerializeView ( PhotonStream, stream, PhotonMessageInfo, info ) : void
ToString ( ) : string
TransferOwnership ( PhotonPlayer, newOwner ) : void

Transfers the ownership of this PhotonView (and GameObject) to another player.

The owner/controller of a PhotonView is also the client which sends position updates of the GameObject.

TransferOwnership ( int newOwnerId ) : void

Transfers the ownership of this PhotonView (and GameObject) to another player.

The owner/controller of a PhotonView is also the client which sends position updates of the GameObject.

Защищенные методы

Метод Описание
Awake ( ) : void

Called by Unity on start of the application and does a setup the PhotonView.

DeserializeComponent ( Component component, PhotonStream, stream, PhotonMessageInfo, info ) : void
ExecuteComponentOnSerialize ( Component component, PhotonStream, stream, PhotonMessageInfo, info ) : void
OnDestroy ( ) : void
SerializeComponent ( Component component, PhotonStream, stream, PhotonMessageInfo, info ) : void

Приватные методы

Метод Описание
OpenPunWizard ( ) : void

Описание методов

Awake() защищенный Метод

Called by Unity on start of the application and does a setup the PhotonView.
protected Awake ( ) : void
Результат void

DeserializeComponent() защищенный Метод

protected DeserializeComponent ( Component component, PhotonStream, stream, PhotonMessageInfo, info ) : void
component Component
stream PhotonStream,
info PhotonMessageInfo,
Результат void

DeserializeView() публичный Метод

public DeserializeView ( PhotonStream, stream, PhotonMessageInfo, info ) : void
stream PhotonStream,
info PhotonMessageInfo,
Результат void

ExecuteComponentOnSerialize() защищенный Метод

protected ExecuteComponentOnSerialize ( Component component, PhotonStream, stream, PhotonMessageInfo, info ) : void
component Component
stream PhotonStream,
info PhotonMessageInfo,
Результат void

Find() публичный статический Метод

public static Find ( int viewID ) : PhotonView,
viewID int
Результат PhotonView,

Get() публичный статический Метод

public static Get ( Component component ) : PhotonView,
component Component
Результат PhotonView,

Get() публичный статический Метод

public static Get ( GameObject gameObj ) : PhotonView,
gameObj GameObject
Результат PhotonView,

OnDestroy() защищенный Метод

protected OnDestroy ( ) : void
Результат void

RPC() публичный Метод

Call a RPC method of this GameObject on remote clients of this room (or on all, inclunding this client).
[Remote Procedure Calls](@ref rpcManual) are an essential tool in making multiplayer games with PUN. It enables you to make every client in a room call a specific method. This method allows you to make an RPC calls on a specific player's client. Of course, calls are affected by this client's lag and that of remote clients. Each call automatically is routed to the same PhotonView (and GameObject) that was used on the originating client. See: [Remote Procedure Calls](@ref rpcManual).
public RPC ( string methodName, PhotonPlayer, targetPlayer ) : void
methodName string The name of a fitting method that was has the RPC attribute.
targetPlayer PhotonPlayer, The group of targets and the way the RPC gets sent.
Результат void

RPC() публичный Метод

Call a RPC method of this GameObject on remote clients of this room (or on all, inclunding this client).
[Remote Procedure Calls](@ref rpcManual) are an essential tool in making multiplayer games with PUN. It enables you to make every client in a room call a specific method. RPC calls can target "All" or the "Others". Usually, the target "All" gets executed locally immediately after sending the RPC. The "*ViaServer" options send the RPC to the server and execute it on this client when it's sent back. Of course, calls are affected by this client's lag and that of remote clients. Each call automatically is routed to the same PhotonView (and GameObject) that was used on the originating client. See: [Remote Procedure Calls](@ref rpcManual).
public RPC ( string methodName, PhotonTargets target ) : void
methodName string The name of a fitting method that was has the RPC attribute.
target PhotonTargets The group of targets and the way the RPC gets sent.
Результат void

RefreshRpcMonoBehaviourCache() публичный Метод

Can be used to refesh the list of MonoBehaviours on this GameObject while PhotonNetwork.UseRpcMonoBehaviourCache is true.
Set PhotonNetwork.UseRpcMonoBehaviourCache to true to enable the caching. Uses this.GetComponents() to get a list of MonoBehaviours to call RPCs on (potentially). While PhotonNetwork.UseRpcMonoBehaviourCache is false, this method has no effect, because the list is refreshed when a RPC gets called.
public RefreshRpcMonoBehaviourCache ( ) : void
Результат void

RequestOwnership() публичный Метод

Depending on the PhotonView's ownershipTransfer setting, any client can request to become owner of the PhotonView.
Requesting ownership can give you control over a PhotonView, if the ownershipTransfer setting allows that. The current owner might have to implement IPunCallbacks.OnOwnershipRequest to react to the ownership request. The owner/controller of a PhotonView is also the client which sends position updates of the GameObject.
public RequestOwnership ( ) : void
Результат void

RpcSecure() публичный Метод

Call a RPC method of this GameObject on remote clients of this room (or on all, inclunding this client).
[Remote Procedure Calls](@ref rpcManual) are an essential tool in making multiplayer games with PUN. It enables you to make every client in a room call a specific method. This method allows you to make an RPC calls on a specific player's client. Of course, calls are affected by this client's lag and that of remote clients. Each call automatically is routed to the same PhotonView (and GameObject) that was used on the originating client. See: [Remote Procedure Calls](@ref rpcManual).
public RpcSecure ( string methodName, PhotonPlayer, targetPlayer, bool encrypt ) : void
methodName string The name of a fitting method that was has the RPC attribute.
targetPlayer PhotonPlayer, The group of targets and the way the RPC gets sent.
encrypt bool
Результат void

RpcSecure() публичный Метод

Call a RPC method of this GameObject on remote clients of this room (or on all, inclunding this client).
[Remote Procedure Calls](@ref rpcManual) are an essential tool in making multiplayer games with PUN. It enables you to make every client in a room call a specific method. RPC calls can target "All" or the "Others". Usually, the target "All" gets executed locally immediately after sending the RPC. The "*ViaServer" options send the RPC to the server and execute it on this client when it's sent back. Of course, calls are affected by this client's lag and that of remote clients. Each call automatically is routed to the same PhotonView (and GameObject) that was used on the originating client. See: [Remote Procedure Calls](@ref rpcManual).
public RpcSecure ( string methodName, PhotonTargets target, bool encrypt ) : void
methodName string The name of a fitting method that was has the RPC attribute.
target PhotonTargets The group of targets and the way the RPC gets sent.
encrypt bool
Результат void

SerializeComponent() защищенный Метод

protected SerializeComponent ( Component component, PhotonStream, stream, PhotonMessageInfo, info ) : void
component Component
stream PhotonStream,
info PhotonMessageInfo,
Результат void

SerializeView() публичный Метод

public SerializeView ( PhotonStream, stream, PhotonMessageInfo, info ) : void
stream PhotonStream,
info PhotonMessageInfo,
Результат void

ToString() публичный Метод

public ToString ( ) : string
Результат string

TransferOwnership() публичный Метод

Transfers the ownership of this PhotonView (and GameObject) to another player.
The owner/controller of a PhotonView is also the client which sends position updates of the GameObject.
public TransferOwnership ( PhotonPlayer, newOwner ) : void
newOwner PhotonPlayer,
Результат void

TransferOwnership() публичный Метод

Transfers the ownership of this PhotonView (and GameObject) to another player.
The owner/controller of a PhotonView is also the client which sends position updates of the GameObject.
public TransferOwnership ( int newOwnerId ) : void
newOwnerId int
Результат void

Описание свойств

ObservedComponents публичное свойство

public List ObservedComponents
Результат List

didAwake защищенное свойство

protected bool didAwake
Результат bool

group публичное свойство

public int group
Результат int

instantiationId публичное свойство

public int instantiationId
Результат int

lastOnSerializeDataReceived защищенное свойство

For internal use only, don't use
protected object[] lastOnSerializeDataReceived
Результат object[]

lastOnSerializeDataSent защищенное свойство

For internal use only, don't use
protected object[] lastOnSerializeDataSent
Результат object[]

mixedModeIsReliable защищенное свойство

protected bool mixedModeIsReliable
Результат bool

observed публичное свойство

public Component observed
Результат Component

onSerializeRigidBodyOption публичное свойство

public OnSerializeRigidBody onSerializeRigidBodyOption
Результат OnSerializeRigidBody

onSerializeTransformOption публичное свойство

public OnSerializeTransform onSerializeTransformOption
Результат OnSerializeTransform

ownerId публичное свойство

public int ownerId
Результат int

ownershipTransfer публичное свойство

Defines if ownership of this PhotonView is fixed, can be requested or simply taken.
Note that you can't edit this value at runtime. The options are described in enum OwnershipOption. The current owner has to implement IPunCallbacks.OnOwnershipRequest to react to the ownership request.
public OwnershipOption ownershipTransfer
Результат OwnershipOption

prefixBackup публичное свойство

public int prefixBackup
Результат int

removedFromLocalViewList защищенное свойство

protected bool removedFromLocalViewList
Результат bool

synchronization публичное свойство

public ViewSynchronization synchronization
Результат ViewSynchronization