Beispiel #1
0
 private void Awake()
 {
     ImpactPosition = Vector3.zero;
     rbody = this.GetComponent<Rigidbody>();
     prevPos = rbody.transform.position;
     Collider coll = rbody.GetComponentInChildren<Collider>();
     Vector3 extents = coll.bounds.extents;
     Vector3 colliderBounds = coll.bounds.size;
     maxColliderSize = Mathf.Max(colliderBounds.x, colliderBounds.y, colliderBounds.z);
     minBoundsExtent = Mathf.Min(new float[] { extents.x, extents.y, extents.z });
     minExtentSquared = (minBoundsExtent * minBoundsExtent);
 }