Пример #1
0
    private void OnCollisionEnter(Collision collision)
    {
        BallPhysics biggerBall = this;
        BallPhysics otherBall  = collision.gameObject.GetComponent <BallPhysics>();

        if (otherBall._rigidBody.mass > biggerBall._rigidBody.mass)
        {
            BallPhysics temp = otherBall;
            otherBall  = biggerBall;
            biggerBall = temp;
        }

        HandleCollistion(biggerBall, otherBall, _ballsCreator);
        biggerBall.CheckIfSplitBall();
    }