public static void SetPlayerSettingsFromConfig() { SXLConfiguration config = SXLFile.GetConfigFile(); float lowPop = float.Parse(config.TryGet("p_lowpop", "player", "3.0"), System.Globalization.CultureInfo.InvariantCulture); float highPop = float.Parse(config.TryGet("p_highpop", "player", "3.5"), System.Globalization.CultureInfo.InvariantCulture); float popOut = float.Parse(config.TryGet("p_popout", "player", "1.0"), System.Globalization.CultureInfo.InvariantCulture); float truckTightness = float.Parse(config.TryGet("p_trucks", "player", "1.0"), System.Globalization.CultureInfo.InvariantCulture); SetLowPop(lowPop); SetHighPop(highPop); SetPopOutMultiplier(popOut); SetTruckTightness(truckTightness); }
public static void SetTruckTightness(float value) { value = value > 1 ? 1 : value; value = value < 0 ? 0 : value; JointDrive jd = new JointDrive(); jd.positionSpring = value + 0.25f; jd.positionDamper = 0.04f * jd.positionSpring; jd.maximumForce = 3.402823E+23f; PlayerController.Instance.boardController.frontTruckJoint.angularXDrive = jd; PlayerController.Instance.boardController.backTruckJoint.angularXDrive = jd; SXLFile.GetConfigFile().Write("p_trucks", value.ToString(), "player"); }
public static void SetLowPop(float value) { PlayerController.Instance.popForce = value; SXLFile.GetConfigFile().Write("p_lowpop", value.ToString(), "player"); }
public static void SetPopOutMultiplier(float value) { PlayerController.Instance.popOutMultiplier = value; SXLFile.GetConfigFile().Write("p_popout", value.ToString(), "player"); }
private void Start() { Application.runInBackground = true; _config = SXLFile.GetConfigFile(); }