OnAwakeRPC
How do I use On Awake R P C
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
File name: OnAwakeUsePhotonView.cs
Copy
8 // tries to send an RPC as soon as this script awakes (e.g. immediately when instantiated)
9 void Awake()
10 {
11 if (!this.photonView.isMine)
12 {
13 return;
14 }
15
16 // Debug.Log("OnAwakeSendRPC.Awake() of " + this + " photonView: " + this.photonView + " this.photonView.instantiationData: " + this.photonView.instantiationData);
17 this.photonView.RPC("OnAwakeRPC", PhotonTargets.All);
18 }
File name: OnAwakeUsePhotonView.cs
Copy
20 // tries to send an RPC as soon as this script starts (e.g. immediately when instantiated)
21 void Start()
22 {
23 if (!this.photonView.isMine)
24 {
25 return;
26 }
27
28 // Debug.Log("OnAwakeSendRPC.Start() of " + this + " photonView: " + this.photonView);
29 this.photonView.RPC("OnAwakeRPC", PhotonTargets.All, (byte)1);
30 }
File name: OnAwakeUsePhotonView.cs
Copy
33 public void OnAwakeRPC()
34 {
35 Debug.Log("RPC: 'OnAwakeRPC' PhotonView: " + this.photonView);
36 }
File name: OnAwakeUsePhotonView.cs
Copy
39 public void OnAwakeRPC(byte myParameter)
40 {
41 Debug.Log("RPC: 'OnAwakeRPC' Parameter: " + myParameter + " PhotonView: " + this.photonView);
42 }
OnAwakeRPC 126 lượt xem
Gõ tìm kiếm nhanh...