public void Collision(Collider c) { if (CollisionField.Intersects(c.CollisionField)) { Position = previousPosition; } }
// Use this for initialization void Start() { collisionField = GetComponent<CollisionField>(); if( null == collisionField ) Debug.LogError( "Could not find 'CollisionField' component" ); collisionField.ObjectMoved += OnObjectMoved; collisionField.ObjectEntered += OnObjectEntered; collisionField.ObjectLeft += OnObjectLeft; }