DisableOnOwnObjects
How do I use Disable On Own Objects
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
53 | bool showInfo = !this.DisableOnOwnObjects || this.photonView.isMine; | 1 |
File name: ShowInfoOfPlayer.cs
Copy
51 void Update()
52 {
53 bool showInfo = !this.DisableOnOwnObjects || this.photonView.isMine;
54 if (textGo != null)
55 {
56 textGo.SetActive(showInfo);
57 }
58 if (!showInfo)
59 {
60 return;
61 }
62
63
64 PhotonPlayer owner = this.photonView.owner;
65 if (owner != null)
66 {
67 tm.text = (string.IsNullOrEmpty(owner.name)) ? "player"+owner.ID : owner.name;
68 }
69 else if (this.photonView.isSceneView)
70 {
71 tm.text = "scn";
72 }
73 else
74 {
75 tm.text = "n/a";
76 }
77 }
DisableOnOwnObjects 117 lượt xem
Gõ tìm kiếm nhanh...