PickupOnCollide
How do I use Pickup On Collide
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
20 | if (this.PickupOnCollide && otherpv != null && otherpv.isMine) | 1 |
File name: PickupItemSimple.cs
Copy
14 public void OnTriggerEnter(Collider other)
15 {
16 // we only call Pickup() if "our" character collides with this PickupItem.
17 // note: if you "position" remote characters by setting their translation, triggers won't be hit.
18
19 PhotonView otherpv = other.GetComponent
20 if (this.PickupOnCollide && otherpv != null && otherpv.isMine)
21 {
22 //Debug.Log("OnTriggerEnter() calls Pickup().");
23 this.Pickup();
24 }
25 }
PickupOnCollide 136 lượt xem
Gõ tìm kiếm nhanh...