public void Bowl(int pinFall) { pinFalls.Add(pinFall); ActionMaster2.Action nextAction = ActionMaster2.NextAction(pinFalls); pinSetter.PerformAction(nextAction); try { scoreDisplay.FillRolls(pinFalls); scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(pinFalls)); } catch { Debug.LogWarning("Something went wrong in Bowl()"); } ball.Reset(); dragLaunch.Reset(); }
public void Reset() { //Debug.Log ("Reset the bowling ball"); //Reset all rigid body. //rigidBody.useGravity=false; //rigidBody.velocity = Vector3.zero; //rigidBody.angularVelocity = Vector3.zero; // Freeze movement, rotation and gravity. Can be replace by isKinemativ. rigidBody.isKinematic = true; //Reset all transform. transform.position = startPos; //transform.eulerAngles = startRot; transform.rotation = Quaternion.Euler(startRot); //Unlock scrolling dragLaunch.CheckLaunched(); //Unlock Drag launch. dragLaunch.Reset(); }