protected override void OnCollisionWith <T> (T component) { Pushable pushable = component as Pushable; if (pushable != null) { OnCollisionWithPushable(pushable); } }
protected override void OnCollisionWith <T> (T component) { Pushable pushable = component as Pushable; if (pushable) { pushable.Push(Direction); } }
private void OnCollisionWithPushable(Pushable pushable) { if (!Pushing) { BraceForPush(); } else { Push(pushable); } }
public void Push(Pushable pushable) { pushable.Push(Direction); Idle(); }