private void FixedUpdate() { if (!InvalidPress()) { if (Input.GetKey(KeyCode.A)) { rb.MovePosition(rb.position - (Vector3.right * Speed)); } if (Input.GetKey(KeyCode.D)) { rb.MovePosition(rb.position + (Vector3.right * Speed)); } } if (env.bonusSphere.Collided) { env.ResetAllPositions(); } if (OutOfBounds()) { env.ResetAllPositions(); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); if (GUILayout.Button("Reset All Positions")) { Debug.Log("Resetting All Positions"); TestingEnvironment e = (TestingEnvironment)target; e.ResetAllPositions(); } }