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(); }
private bool CollisionPredicate(CollisionPayload payload) { return(payload.GameObject != null && payload.GameObject == gameObject); }
private void OnCollision(CollisionPayload payload) { Instantiate(explosion).transform.position = transform.position; Destroy(gameObject); }