Exemple #1
0
 //Freeze the Y position of the ring when it is placed on a pin, this is to avoid the player being able to nudge other rings off the pin with the held ring, do not freeze if the game is won
 private void FreezeYPosition()
 {
     if (rigidbody.constraints != RigidbodyConstraints2D.FreezePositionY && !ruleManager.AllRingsPlaced(ringSize) && rigidbody.velocity == Vector2.zero && !ruleManager.GameWon())
     {
         rigidbody.constraints = RigidbodyConstraints2D.FreezePositionY;
     }
 }