Пример #1
0
        void Start()
        {
            speed = Random.Range(MIN_SPEED, MAX_SPEED);

            transform.Rotate(new Vector3(0, 0, Random.Range(0, 360)));

            boundsPayload            = new BoundableObjectPayload();
            boundsPayload.GameObject = gameObject;
            boundsPayload.Type       = BoundableObjectPayload.BehaviourType.Repositionable;

            collisionPayload = new CollisionPayload();
        }
Пример #2
0
 private bool CollisionPredicate(CollisionPayload payload)
 {
     return(payload.GameObject != null && payload.GameObject == gameObject);
 }
Пример #3
0
 private void OnCollision(CollisionPayload payload)
 {
     Instantiate(explosion).transform.position = transform.position;
     Destroy(gameObject);
 }