public bool haveNeighbors (HolleController holleController) { if(!holleController) return false; foreach(HolleController item in neighbors) { if(holleController == item) return true; } return false; }
public void OnSetHoleSpline (float lenght, int holleId) { HolleController holleController = HolleController.FindeHoleById (holleId); holeSpline = holleController.ballSpline; holeSplineLungth = lenght; this.holleController = holleController; if(!isMain && cueController.ballController.ballIsOut && (this.holleController == cueController.ballController.holleController || this.holleController.haveNeighbors (cueController.ballController.holleController))) { cueController.ballController.holeSplineLungth = holeSplineLungth - 2.0f * cueController.ballRadius; if(cueController.ballController.step >= cueController.ballController.holeSplineLungth) { cueController.ballController.body.position = cueController.ballController.holeSpline.Evaluate (holeSplineLungth); } } }