private static void HandleCollistion(BallPhysics biggerBall, BallPhysics otherBall, BallsCreator ballsCreator) { if (biggerBall._isDestroyed || otherBall._isDestroyed || ballsCreator.ChangePhysics) { return; } biggerBall._rigidBody.mass += otherBall._rigidBody.mass; biggerBall.GravityRange += otherBall.GravityRange; biggerBall._howManyBallsMarged += otherBall._howManyBallsMarged; biggerBall.gameObject.transform.localScale += otherBall.transform.localScale;; otherBall._isDestroyed = true; Destroy(otherBall.gameObject); }
public void Initialize(BallsCreator ballsCreator) { _ballsCreator = ballsCreator; }