// Check Hit against other entity public void HitCollisionCheck(GameEntityModel model, GameEntityModel otherModel) { AnimationModel animModel = GetAnimationModel(model); AnimationModel otherAnimModel = GetAnimationModel(otherModel); AnimationController animController = animModel.Controller() as AnimationController; FixedVector3 position = GetRealPosition(model); FixedVector3 otherPosition = GetRealPosition(otherModel); HitInformation hitInformation = animController.HitCollisionCheck( animModel, position, model.IsFacingRight(), otherAnimModel, otherPosition, otherModel.IsFacingRight() ); if (hitInformation != null) { // Both entities get knowing one hit the other GameEntityController otherController = otherModel.Controller() as GameEntityController; otherController.lastHurts.Add(hitInformation.HitWithEntity(model.Index)); lastHits.Add(hitInformation.HitWithEntity(otherModel.Index)); // Debug.Log(model.Index + " hit " + otherModel.Index); } }