C# 클래스 PhotonNetwork, PaperCowboys

The main class to use the PhotonNetwork plugin. This class is static.
파일 보기 프로젝트 열기: Gamieon/PaperCowboys 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
MAX_VIEW_IDS int
PrefabCache GameObject>.Dictionary
UsePrefabCache bool
logLevel PhotonLogLevel
precisionForFloatSynchronization float
precisionForQuaternionSynchronization float
precisionForVectorSynchronization float

Private Properties

프로퍼티 타입 설명
AllocateSceneViewIDs int[]
AllocateViewID int
Connect void
ConnectUsingSettings void
InitializeSecurity void
PhotonNetwork System
RPC void
RPC void
VerifyCanUseNetwork bool

공개 메소드들

메소드 설명
AllocateViewID ( ) : int

Allocates a viewID that's valid for the current/local player.

CloseConnection ( PhotonPlayer, kickPlayer ) : void

Request a client to disconnect (KICK). Only the master client can do this.

Connect ( string serverAddress, int port, string appID, string gameVersion ) : void

Connect to the photon server by address, port, appID and game(client) version. This method is used by ConnectUsingSettings which applies values from the settings file.

To connect to the Photon Cloud, a valid AppId must be in the settings file (shown in the Photon Cloud Dashboard). https://cloud.exitgames.com/dashboard Connecting to the Photon Cloud might fail due to: - Network issues (calls: OnFailedToConnectToPhoton()) - Invalid region (calls: OnConnectionFail() with DisconnectCause.InvalidRegion) - Subscription CCU limit reached (calls: OnConnectionFail() with DisconnectCause.MaxCcuReached. also calls: OnPhotonMaxCccuReached()) More about the connection limitations: http://doc.exitgames.com/photon-cloud/

ConnectUsingSettings ( string gameVersion ) : void

Connect to the configured Photon server: Reads PhotonNetwork.serverSettingsAssetPath and connects to cloud or your own server.

The PUN Setup Wizard stores your appID in a settings file and applies a server address/port. This is used for Connect(string serverAddress, int port, string appID, string gameVersion). To connect to the Photon Cloud, a valid AppId must be in the settings file (shown in the Photon Cloud Dashboard). https://cloud.exitgames.com/dashboard Connecting to the Photon Cloud might fail due to: - Network issues (calls: OnFailedToConnectToPhoton()) - Invalid region (calls: OnConnectionFail() with DisconnectCause.InvalidRegion) - Subscription CCU limit reached (calls: OnConnectionFail() with DisconnectCause.MaxCcuReached. also calls: OnPhotonMaxCccuReached()) More about the connection limitations: http://doc.exitgames.com/photon-cloud

CreateRoom ( string roomName ) : void

Creates a room with given name but fails if this room is existing already.

If you don't want to create a unique room-name, pass null or "" as name and the server will assign a roomName (a GUID as string). Call this only on the master server. Internally, the master will respond with a server-address (and roomName, if needed). Both are used internally to switch to the assigned game server and roomName. PhotonNetwork.autoCleanUpPlayerObjects will become this room's AutoCleanUp property and that's used by all clients that join this room.

CreateRoom ( string roomName, bool isVisible, bool isOpen, int maxPlayers ) : void

Creates a room with given name but fails if this room is existing already.

If you don't want to create a unique room-name, pass null or "" as name and the server will assign a roomName (a GUID as string). Call this only on the master server. Internally, the master will respond with a server-address (and roomName, if needed). Both are used internally to switch to the assigned game server and roomName

CreateRoom ( string roomName, bool isVisible, bool isOpen, int maxPlayers, Hashtable customRoomProperties, string propsToListInLobby ) : void

Creates a room with given name but fails if this room is existing already.

If you don't want to create a unique room-name, pass null or "" as name and the server will assign a roomName (a GUID as string). Call this only on the master server. Internally, the master will respond with a server-address (and roomName, if needed). Both are used internally to switch to the assigned game server and roomName. PhotonNetwork.autoCleanUpPlayerObjects will become this room's AutoCleanUp property and that's used by all clients that join this room.

Destroy ( GameObject go ) : void

Destroys given GameObject. This GameObject must've been instantiated using PhotonNetwork.Instantiate and must have a PhotonView at it's root. This has the same effect as calling Destroy by passing an attached PhotonView from this GameObject

Destroy ( PhotonView view ) : void

Destroy supplied PhotonView. This will remove all Buffered RPCs and destroy the GameObject this view is attached to (plus all childs, if any) This has the same effect as calling Destroy by passing a GameObject

DestroyPlayerObjects ( PhotonPlayer destroyPlayer ) : void

Destroy all GameObjects/PhotonViews of this player. can only be called on the local player. The only exception is the master client which call call this for all players.

Disconnect ( ) : void

Makes this client disconnect from the photon server, a process that leaves any room and calls OnDisconnectedFromPhoton on completition.

When the client is connected, the server is being informed that this client disconnects. This speeds up leave/disconnect messages for players in the same room as you (otherwise the server would timeout this client's connection). When used in offlineMode, the state-change and event-call OnDisconnectedFromPhoton are immediate. Offline mode is set to false as well. Once disconnected, the client can connect again. Use ConnectUsingSettings.

GetPing ( ) : int

The current roundtrip time to the photon server

GetRoomList ( ) : RoomInfo[]

Gets an array of (currently) known rooms as RoomInfo. This list is automatically updated every few seconds while this client is in the lobby (on the Master Server). Not available while being in a room.

Creates a new instance of the list each time called. Copied from networkingPeer.mGameList.

Instantiate ( string prefabName, Vector3 position, Quaternion rotation, int group ) : GameObject

Instantiate a prefab over the network. This prefab needs to be located in the root of a "Resources" folder.

Instead of using prefabs in the Resources folder, you can manually Instantiate and assign PhotonViews. See doc.

Instantiate ( string prefabName, Vector3 position, Quaternion rotation, int group, object data ) : GameObject

Instantiate a prefab over the network. This prefab needs to be located in the root of a "Resources" folder.

Instead of using prefabs in the Resources folder, you can manually Instantiate and assign PhotonViews. See doc.

InstantiateSceneObject ( string prefabName, Vector3 position, Quaternion rotation, int group, object data ) : GameObject

Instantiate a scene-owned prefab over the network. The PhotonViews will be controllable by the MasterClient. This prefab needs to be located in the root of a "Resources" folder.

Only the master client can Instantiate scene objects. Instead of using prefabs in the Resources folder, you can manually Instantiate and assign PhotonViews. See doc.

InternalCleanPhotonMonoFromSceneIfStuck ( ) : void

Internally used by Editor scripts, called on Hierarchy change (includes scene save) to remove surplus hidden PhotonHandlers.

JoinRandomRoom ( ) : void

Joins any available room but will fail if none is currently available.

If this fails, you can still create a room (and make this available for the next who uses JoinRandomRoom). Alternatively, try again in a moment.

JoinRandomRoom ( Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers ) : void

Attempts to join an open room with fitting, custom properties but fails if none is currently available.

If this fails, you can still create a room (and make this available for the next who uses JoinRandomRoom). Alternatively, try again in a moment.

JoinRandomRoom ( Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers, MatchmakingMode matchingType ) : void

Attempts to join an open room with fitting, custom properties but fails if none is currently available.

If this fails, you can still create a room (and make this available for the next who uses JoinRandomRoom). Alternatively, try again in a moment.

JoinRoom ( RoomInfo listedRoom ) : void

Join room by room.Name. This fails if the room is either full or no longer available (might close at the same time).

JoinRoom ( string roomName ) : void

Join room with given title. This fails if the room is either full or no longer available (might close at the same time).

LeaveRoom ( ) : void

Leave the current room

LoadLevel ( int levelNumber ) : void

Loads the level and automatically pauses the network queue. Call this in OnJoinedRoom to make sure no cached RPCs are fired in the wrong scene.

LoadLevel ( string levelTitle ) : void

Loads the level and automatically pauses the network queue. Call this in OnJoinedRoom to make sure no cached RPCs are fired in the wrong scene.

NetworkStatisticsReset ( ) : void

Resets the traffic stats and re-enables them.

NetworkStatisticsToString ( ) : string

Only available when NetworkStatisticsEnabled was used to gather some stats.

RemoveAllBufferedMessages ( ) : void

Remove ALL buffered messages of the local player (RPC's and Instantiation calls) Note that this only removed the buffered messages on the server, you will still need to remove the Instantiated GameObjects yourself.

RemoveAllBufferedMessages ( PhotonPlayer targetPlayer ) : void

Remove ALL buffered messages of a player (RPC's and Instantiation calls) Note that this only removed the buffered messages on the server, you will still need to remove the Instantiated GameObjects yourself.

RemoveAllInstantiatedObjects ( ) : void

MasterClient method only: Destroy ALL instantiated GameObjects

RemoveAllInstantiatedObjects ( PhotonPlayer targetPlayer ) : void

Destroy ALL PhotonNetwork.Instantiated GameObjects by given player. Can only be called on the local player or MasterClient. The MasterClient can call this for all players.

RemoveRPCs ( ) : void

Remove ALL buffered RPCs of the local player

RemoveRPCs ( PhotonPlayer targetPlayer ) : void

Remove ALL buffered RPCs of a player

RemoveRPCs ( PhotonView view ) : void

Remove all buffered RPCs on given PhotonView (if they are owned by this player).

RemoveRPCsInGroup ( int group ) : void

Remove all buffered RPCs with given group

SendOutgoingCommands ( ) : void

Can be used to immediately send the RPCs and Instantiates just made, so they are on their way to the other players.

This could be useful if you do a RPC to load a level and then load it yourself. While loading, no RPCs are sent to others, so this would delay the "load" RPC. You can send the RPC to "others", use this method, disable the message queue (by isMessageQueueRunning) and then load.

SetLevelPrefix ( short prefix ) : void

Sets level prefix for PhotonViews instantiated later on. Don't set it if you need only one!

Important: If you don't use multiple level prefixes, simply don't set this value. The default value is optimized out of the traffic. This won't affect existing PhotonViews (they can't be changed yet for existing PhotonViews). Messages sent with a different level prefix will be received but not executed. This affects RPCs, Instantiates and synchronization. Be aware that PUN never resets this value, you'll have to do so yourself.

SetPlayerCustomProperties ( Hashtable customProperties ) : void

Sets this (local) player's properties. This caches the properties in PhotonNetwork.player.customProperties. CreateRoom, JoinRoom and JoinRandomRoom will all apply your player's custom properties when you enter the room. While in a room, your properties are synced with the other players. If the Hashtable is null, the custom properties will be cleared. Custom properties are never cleared automatically, so they carry over to the next room, if you don't change them.

Don't set properties by modifying PhotonNetwork.player.customProperties!

SetReceivingEnabled ( int group, bool enabled ) : void

Enable/disable receiving on given group (applied to PhotonViews)

SetSendingEnabled ( int group, bool enabled ) : void

Enable/disable sending on given group (applied to PhotonViews)

UnAllocateViewID ( int viewID ) : void

Unregister a viewID (of manually instantiated and destroyed networked objects).

비공개 메소드들

메소드 설명
AllocateSceneViewIDs ( int countOfNewViews ) : int[]
AllocateViewID ( int ownerId ) : int
Connect ( string serverAddress, int port, string uniqueGameID ) : void
ConnectUsingSettings ( ) : void
InitializeSecurity ( ) : void
PhotonNetwork ( ) : System

Static constructor used for basic setup.

RPC ( PhotonView view, string methodName, PhotonPlayer targetPlayer ) : void

Internal to send an RPC on given PhotonView. Do not call this directly but use: PhotonView.RPC!

RPC ( PhotonView view, string methodName, PhotonTargets target ) : void

Internal to send an RPC on given PhotonView. Do not call this directly but use: PhotonView.RPC!

VerifyCanUseNetwork ( ) : bool

Helper function which is called inside this class to erify if certain functions can be used (e.g. RPC when not connected)

메소드 상세

AllocateViewID() 공개 정적인 메소드

Allocates a viewID that's valid for the current/local player.
public static AllocateViewID ( ) : int
리턴 int

CloseConnection() 공개 정적인 메소드

Request a client to disconnect (KICK). Only the master client can do this.
public static CloseConnection ( PhotonPlayer, kickPlayer ) : void
kickPlayer PhotonPlayer, The PhotonPlayer to kick.
리턴 void

Connect() 공개 정적인 메소드

Connect to the photon server by address, port, appID and game(client) version. This method is used by ConnectUsingSettings which applies values from the settings file.
To connect to the Photon Cloud, a valid AppId must be in the settings file (shown in the Photon Cloud Dashboard). https://cloud.exitgames.com/dashboard Connecting to the Photon Cloud might fail due to: - Network issues (calls: OnFailedToConnectToPhoton()) - Invalid region (calls: OnConnectionFail() with DisconnectCause.InvalidRegion) - Subscription CCU limit reached (calls: OnConnectionFail() with DisconnectCause.MaxCcuReached. also calls: OnPhotonMaxCccuReached()) More about the connection limitations: http://doc.exitgames.com/photon-cloud/
public static Connect ( string serverAddress, int port, string appID, string gameVersion ) : void
serverAddress string The master server's address (either your own or Photon Cloud address).
port int The master server's port to connect to.
appID string Your application ID (Photon Cloud provides you with a GUID for your game).
gameVersion string This client's version number. Users are separated from each other by gameversion (which allows you to make breaking changes).
리턴 void

ConnectUsingSettings() 공개 정적인 메소드

Connect to the configured Photon server: Reads PhotonNetwork.serverSettingsAssetPath and connects to cloud or your own server.
The PUN Setup Wizard stores your appID in a settings file and applies a server address/port. This is used for Connect(string serverAddress, int port, string appID, string gameVersion). To connect to the Photon Cloud, a valid AppId must be in the settings file (shown in the Photon Cloud Dashboard). https://cloud.exitgames.com/dashboard Connecting to the Photon Cloud might fail due to: - Network issues (calls: OnFailedToConnectToPhoton()) - Invalid region (calls: OnConnectionFail() with DisconnectCause.InvalidRegion) - Subscription CCU limit reached (calls: OnConnectionFail() with DisconnectCause.MaxCcuReached. also calls: OnPhotonMaxCccuReached()) More about the connection limitations: http://doc.exitgames.com/photon-cloud
public static ConnectUsingSettings ( string gameVersion ) : void
gameVersion string This client's version number. Users are separated from each other by gameversion (which allows you to make breaking changes).
리턴 void

CreateRoom() 공개 정적인 메소드

Creates a room with given name but fails if this room is existing already.
If you don't want to create a unique room-name, pass null or "" as name and the server will assign a roomName (a GUID as string). Call this only on the master server. Internally, the master will respond with a server-address (and roomName, if needed). Both are used internally to switch to the assigned game server and roomName. PhotonNetwork.autoCleanUpPlayerObjects will become this room's AutoCleanUp property and that's used by all clients that join this room.
public static CreateRoom ( string roomName ) : void
roomName string Unique name of the room to create.
리턴 void

CreateRoom() 공개 정적인 메소드

Creates a room with given name but fails if this room is existing already.
If you don't want to create a unique room-name, pass null or "" as name and the server will assign a roomName (a GUID as string). Call this only on the master server. Internally, the master will respond with a server-address (and roomName, if needed). Both are used internally to switch to the assigned game server and roomName
public static CreateRoom ( string roomName, bool isVisible, bool isOpen, int maxPlayers ) : void
roomName string Unique name of the room to create. Pass null or "" to make the server generate a name.
isVisible bool Shows (or hides) this room from the lobby's listing of rooms.
isOpen bool Allows (or disallows) others to join this room.
maxPlayers int Max number of players that can join the room.
리턴 void

CreateRoom() 공개 정적인 메소드

Creates a room with given name but fails if this room is existing already.
If you don't want to create a unique room-name, pass null or "" as name and the server will assign a roomName (a GUID as string). Call this only on the master server. Internally, the master will respond with a server-address (and roomName, if needed). Both are used internally to switch to the assigned game server and roomName. PhotonNetwork.autoCleanUpPlayerObjects will become this room's AutoCleanUp property and that's used by all clients that join this room.
public static CreateRoom ( string roomName, bool isVisible, bool isOpen, int maxPlayers, Hashtable customRoomProperties, string propsToListInLobby ) : void
roomName string Unique name of the room to create. Pass null or "" to make the server generate a name.
isVisible bool Shows (or hides) this room from the lobby's listing of rooms.
isOpen bool Allows (or disallows) others to join this room.
maxPlayers int Max number of players that can join the room.
customRoomProperties Hashtable Custom properties of the new room (set on create, so they are immediately available).
propsToListInLobby string Array of custom-property-names that should be forwarded to the lobby (include only the useful ones).
리턴 void

Destroy() 공개 정적인 메소드

Destroys given GameObject. This GameObject must've been instantiated using PhotonNetwork.Instantiate and must have a PhotonView at it's root. This has the same effect as calling Destroy by passing an attached PhotonView from this GameObject
public static Destroy ( GameObject go ) : void
go GameObject
리턴 void

Destroy() 공개 정적인 메소드

Destroy supplied PhotonView. This will remove all Buffered RPCs and destroy the GameObject this view is attached to (plus all childs, if any) This has the same effect as calling Destroy by passing a GameObject
public static Destroy ( PhotonView view ) : void
view PhotonView
리턴 void

DestroyPlayerObjects() 공개 정적인 메소드

Destroy all GameObjects/PhotonViews of this player. can only be called on the local player. The only exception is the master client which call call this for all players.
public static DestroyPlayerObjects ( PhotonPlayer destroyPlayer ) : void
destroyPlayer PhotonPlayer
리턴 void

Disconnect() 공개 정적인 메소드

Makes this client disconnect from the photon server, a process that leaves any room and calls OnDisconnectedFromPhoton on completition.
When the client is connected, the server is being informed that this client disconnects. This speeds up leave/disconnect messages for players in the same room as you (otherwise the server would timeout this client's connection). When used in offlineMode, the state-change and event-call OnDisconnectedFromPhoton are immediate. Offline mode is set to false as well. Once disconnected, the client can connect again. Use ConnectUsingSettings.
public static Disconnect ( ) : void
리턴 void

GetPing() 공개 정적인 메소드

The current roundtrip time to the photon server
public static GetPing ( ) : int
리턴 int

GetRoomList() 공개 정적인 메소드

Gets an array of (currently) known rooms as RoomInfo. This list is automatically updated every few seconds while this client is in the lobby (on the Master Server). Not available while being in a room.
Creates a new instance of the list each time called. Copied from networkingPeer.mGameList.
public static GetRoomList ( ) : RoomInfo[]
리턴 RoomInfo[]

Instantiate() 공개 정적인 메소드

Instantiate a prefab over the network. This prefab needs to be located in the root of a "Resources" folder.
Instead of using prefabs in the Resources folder, you can manually Instantiate and assign PhotonViews. See doc.
public static Instantiate ( string prefabName, Vector3 position, Quaternion rotation, int group ) : GameObject
prefabName string Name of the prefab to instantiate.
position Vector3 Position Vector3 to apply on instantiation.
rotation Quaternion Rotation Quaternion to apply on instantiation.
group int The group for this PhotonView.
리턴 GameObject

Instantiate() 공개 정적인 메소드

Instantiate a prefab over the network. This prefab needs to be located in the root of a "Resources" folder.
Instead of using prefabs in the Resources folder, you can manually Instantiate and assign PhotonViews. See doc.
public static Instantiate ( string prefabName, Vector3 position, Quaternion rotation, int group, object data ) : GameObject
prefabName string Name of the prefab to instantiate.
position Vector3 Position Vector3 to apply on instantiation.
rotation Quaternion Rotation Quaternion to apply on instantiation.
group int The group for this PhotonView.
data object Optional instantiation data. This will be saved to it's PhotonView.instantiationData.
리턴 GameObject

InstantiateSceneObject() 공개 정적인 메소드

Instantiate a scene-owned prefab over the network. The PhotonViews will be controllable by the MasterClient. This prefab needs to be located in the root of a "Resources" folder.
Only the master client can Instantiate scene objects. Instead of using prefabs in the Resources folder, you can manually Instantiate and assign PhotonViews. See doc.
public static InstantiateSceneObject ( string prefabName, Vector3 position, Quaternion rotation, int group, object data ) : GameObject
prefabName string Name of the prefab to instantiate.
position Vector3 Position Vector3 to apply on instantiation.
rotation Quaternion Rotation Quaternion to apply on instantiation.
group int The group for this PhotonView.
data object Optional instantiation data. This will be saved to it's PhotonView.instantiationData.
리턴 GameObject

InternalCleanPhotonMonoFromSceneIfStuck() 공개 정적인 메소드

Internally used by Editor scripts, called on Hierarchy change (includes scene save) to remove surplus hidden PhotonHandlers.
public static InternalCleanPhotonMonoFromSceneIfStuck ( ) : void
리턴 void

JoinRandomRoom() 공개 정적인 메소드

Joins any available room but will fail if none is currently available.
If this fails, you can still create a room (and make this available for the next who uses JoinRandomRoom). Alternatively, try again in a moment.
public static JoinRandomRoom ( ) : void
리턴 void

JoinRandomRoom() 공개 정적인 메소드

Attempts to join an open room with fitting, custom properties but fails if none is currently available.
If this fails, you can still create a room (and make this available for the next who uses JoinRandomRoom). Alternatively, try again in a moment.
public static JoinRandomRoom ( Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers ) : void
expectedCustomRoomProperties Hashtable Filters for rooms that match these custom properties (string keys and values). To ignore, pass null.
expectedMaxPlayers byte Filters for a particular maxplayer setting. Use 0 to accept any maxPlayer value.
리턴 void

JoinRandomRoom() 공개 정적인 메소드

Attempts to join an open room with fitting, custom properties but fails if none is currently available.
If this fails, you can still create a room (and make this available for the next who uses JoinRandomRoom). Alternatively, try again in a moment.
public static JoinRandomRoom ( Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers, MatchmakingMode matchingType ) : void
expectedCustomRoomProperties Hashtable Filters for rooms that match these custom properties (string keys and values). To ignore, pass null.
expectedMaxPlayers byte Filters for a particular maxplayer setting. Use 0 to accept any maxPlayer value.
matchingType MatchmakingMode Selects one of the available matchmaking algorithms. See MatchmakingMode enum for options.
리턴 void

JoinRoom() 공개 정적인 메소드

Join room by room.Name. This fails if the room is either full or no longer available (might close at the same time).
public static JoinRoom ( RoomInfo listedRoom ) : void
listedRoom RoomInfo
리턴 void

JoinRoom() 공개 정적인 메소드

Join room with given title. This fails if the room is either full or no longer available (might close at the same time).
public static JoinRoom ( string roomName ) : void
roomName string Unique name of the room to create.
리턴 void

LeaveRoom() 공개 정적인 메소드

Leave the current room
public static LeaveRoom ( ) : void
리턴 void

LoadLevel() 공개 정적인 메소드

Loads the level and automatically pauses the network queue. Call this in OnJoinedRoom to make sure no cached RPCs are fired in the wrong scene.
public static LoadLevel ( int levelNumber ) : void
levelNumber int /// Number of the level to load (make sure it's in the build preferences). ///
리턴 void

LoadLevel() 공개 정적인 메소드

Loads the level and automatically pauses the network queue. Call this in OnJoinedRoom to make sure no cached RPCs are fired in the wrong scene.
public static LoadLevel ( string levelTitle ) : void
levelTitle string /// Name of the level to load. ///
리턴 void

NetworkStatisticsReset() 공개 정적인 메소드

Resets the traffic stats and re-enables them.
public static NetworkStatisticsReset ( ) : void
리턴 void

NetworkStatisticsToString() 공개 정적인 메소드

Only available when NetworkStatisticsEnabled was used to gather some stats.
public static NetworkStatisticsToString ( ) : string
리턴 string

RemoveAllBufferedMessages() 공개 정적인 메소드

Remove ALL buffered messages of the local player (RPC's and Instantiation calls) Note that this only removed the buffered messages on the server, you will still need to remove the Instantiated GameObjects yourself.
public static RemoveAllBufferedMessages ( ) : void
리턴 void

RemoveAllBufferedMessages() 공개 정적인 메소드

Remove ALL buffered messages of a player (RPC's and Instantiation calls) Note that this only removed the buffered messages on the server, you will still need to remove the Instantiated GameObjects yourself.
public static RemoveAllBufferedMessages ( PhotonPlayer targetPlayer ) : void
targetPlayer PhotonPlayer
리턴 void

RemoveAllInstantiatedObjects() 공개 정적인 메소드

MasterClient method only: Destroy ALL instantiated GameObjects
public static RemoveAllInstantiatedObjects ( ) : void
리턴 void

RemoveAllInstantiatedObjects() 공개 정적인 메소드

Destroy ALL PhotonNetwork.Instantiated GameObjects by given player. Can only be called on the local player or MasterClient. The MasterClient can call this for all players.
public static RemoveAllInstantiatedObjects ( PhotonPlayer targetPlayer ) : void
targetPlayer PhotonPlayer
리턴 void

RemoveRPCs() 공개 정적인 메소드

Remove ALL buffered RPCs of the local player
public static RemoveRPCs ( ) : void
리턴 void

RemoveRPCs() 공개 정적인 메소드

Remove ALL buffered RPCs of a player
public static RemoveRPCs ( PhotonPlayer targetPlayer ) : void
targetPlayer PhotonPlayer
리턴 void

RemoveRPCs() 공개 정적인 메소드

Remove all buffered RPCs on given PhotonView (if they are owned by this player).
public static RemoveRPCs ( PhotonView view ) : void
view PhotonView
리턴 void

RemoveRPCsInGroup() 공개 정적인 메소드

Remove all buffered RPCs with given group
public static RemoveRPCsInGroup ( int group ) : void
group int
리턴 void

SendOutgoingCommands() 공개 정적인 메소드

Can be used to immediately send the RPCs and Instantiates just made, so they are on their way to the other players.
This could be useful if you do a RPC to load a level and then load it yourself. While loading, no RPCs are sent to others, so this would delay the "load" RPC. You can send the RPC to "others", use this method, disable the message queue (by isMessageQueueRunning) and then load.
public static SendOutgoingCommands ( ) : void
리턴 void

SetLevelPrefix() 공개 정적인 메소드

Sets level prefix for PhotonViews instantiated later on. Don't set it if you need only one!
Important: If you don't use multiple level prefixes, simply don't set this value. The default value is optimized out of the traffic. This won't affect existing PhotonViews (they can't be changed yet for existing PhotonViews). Messages sent with a different level prefix will be received but not executed. This affects RPCs, Instantiates and synchronization. Be aware that PUN never resets this value, you'll have to do so yourself.
public static SetLevelPrefix ( short prefix ) : void
prefix short Max value is short.MaxValue = 32767
리턴 void

SetPlayerCustomProperties() 공개 정적인 메소드

Sets this (local) player's properties. This caches the properties in PhotonNetwork.player.customProperties. CreateRoom, JoinRoom and JoinRandomRoom will all apply your player's custom properties when you enter the room. While in a room, your properties are synced with the other players. If the Hashtable is null, the custom properties will be cleared. Custom properties are never cleared automatically, so they carry over to the next room, if you don't change them.
Don't set properties by modifying PhotonNetwork.player.customProperties!
public static SetPlayerCustomProperties ( Hashtable customProperties ) : void
customProperties Hashtable Only string-typed keys will be used from this hashtable. If null, custom properties are all deleted.
리턴 void

SetReceivingEnabled() 공개 정적인 메소드

Enable/disable receiving on given group (applied to PhotonViews)
public static SetReceivingEnabled ( int group, bool enabled ) : void
group int
enabled bool
리턴 void

SetSendingEnabled() 공개 정적인 메소드

Enable/disable sending on given group (applied to PhotonViews)
public static SetSendingEnabled ( int group, bool enabled ) : void
group int
enabled bool
리턴 void

UnAllocateViewID() 공개 정적인 메소드

Unregister a viewID (of manually instantiated and destroyed networked objects).
public static UnAllocateViewID ( int viewID ) : void
viewID int A viewID manually allocated by this player.
리턴 void

프로퍼티 상세

MAX_VIEW_IDS 공개적으로 정적으로 프로퍼티

The maximum amount of assigned PhotonViews PER player (or scene). See the documentation on how to raise this limitation
public static int MAX_VIEW_IDS
리턴 int

PrefabCache 공개적으로 정적으로 프로퍼티

Keeps references to GameObjects for frequent instantiation (out of memory instead of loading the Resources).
You should be able to modify the cache anytime you like, except while Instantiate is used. Best do it only in the main-Thread.
public static Dictionary PrefabCache
리턴 GameObject>.Dictionary

UsePrefabCache 공개적으로 정적으로 프로퍼티

While enabled (true), Instantiate uses PhotonNetwork.PrefabCache to keep game objects in memory (improving instantiation of the same prefab).
Setting UsePrefabCache to false during runtime will not clear PrefabCache but will ignore it right away. You could clean and modify the cache yourself. Read its comments.
public static bool UsePrefabCache
리턴 bool

logLevel 공개적으로 정적으로 프로퍼티

Network log level. Controls how verbose PUN is.
public static PhotonLogLevel logLevel
리턴 PhotonLogLevel

precisionForFloatSynchronization 공개적으로 정적으로 프로퍼티

The minimum difference between floats before we send it via a PhotonView's OnSerialize/ObservingComponent
public static float precisionForFloatSynchronization
리턴 float

precisionForQuaternionSynchronization 공개적으로 정적으로 프로퍼티

The minimum angle that a rotation needs to change before we send it via a PhotonView's OnSerialize/ObservingComponent
public static float precisionForQuaternionSynchronization
리턴 float

precisionForVectorSynchronization 공개적으로 정적으로 프로퍼티

The minimum difference that a Vector2 or Vector3(e.g. a transforms rotation) needs to change before we send it via a PhotonView's OnSerialize/ObservingComponent Note that this is the sqrMagnitude. E.g. to send only after a 0.01 change on the Y-axix, we use 0.01f*0.01f=0.0001f. As a remedy against float inaccuracy we use 0.000099f instead of 0.0001f.
public static float precisionForVectorSynchronization
리턴 float