RedBall.cs 358 B

123456789101112131415
  1. using UnityEngine;
  2. namespace Mirror.Examples.Billiards
  3. {
  4. public class RedBall : NetworkBehaviour
  5. {
  6. // destroy when entering a pocket.
  7. // there's only one trigger in the scene (the pocket).
  8. [ServerCallback]
  9. void OnTriggerEnter(Collider other)
  10. {
  11. NetworkServer.Destroy(gameObject);
  12. }
  13. }
  14. }