Пример #1
0
    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);
    }
Пример #2
0
 public void Initialize(BallsCreator ballsCreator)
 {
     _ballsCreator = ballsCreator;
 }