RedBall.cs 358 Bytes
Newer Older
cann-alberto's avatar
cann-alberto committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
using UnityEngine;

namespace Mirror.Examples.Billiards
{
    public class RedBall : NetworkBehaviour
    {
        // destroy when entering a pocket.
        // there's only one trigger in the scene (the pocket).
        [ServerCallback]
        void OnTriggerEnter(Collider other)
        {
            NetworkServer.Destroy(gameObject);
        }
    }
}