public static void UpdateSettings() { DroneRacer dr = FindDroneRacer(); if (dr != null) { dr.power = PlayerPrefs.GetFloat(Constants.PowerOutput); dr.autoLevelStrength = PlayerPrefs.GetFloat(Constants.AutoLevelStrength); dr.autoLevel = PlayerPrefs.GetInt(Constants.AutoLevel) == 0 ? false : true; dr.altitudeHold = PlayerPrefs.GetInt(Constants.AltitudeHold) == 0 ? false : true; dr.altitudeHoldStrength = PlayerPrefs.GetFloat(Constants.AltitudeHoldStrength); dr.airMode = PlayerPrefs.GetInt(Constants.AirMode) == 0 ? false : true; dr.crashTolerance = PlayerPrefs.GetFloat(Constants.CrashTolerance); dr.detectCrash = PlayerPrefs.GetInt(Constants.DetectCrash) == 0 ? false : true; Camera c = SceneHelper.FindFirstChildInHierarchy <Camera>(dr, Constants.FpvCameraName); c.gameObject.SetActive(true); dr.UpdateCameraAngle(c); dr.UpdateCameraFov(c); DroneRacerJoystickInput.UpdateSettings(); } }
public static DroneRacerJoystickInput FindDroneRacerJoystickInput() { DroneRacerJoystickInput drji = null; DroneRacer dr = DroneRacer.FindDroneRacer(); if (dr != null) { drji = dr.GetComponent <DroneRacerJoystickInput>(); } return(drji); }
public static DroneRacerArm FindDroneRacerArm() { DroneRacerArm dra = null; DroneRacer dr = DroneRacer.FindDroneRacer(); if (dr != null) { dra = dr.GetComponent <DroneRacerArm>(); } return(dra); }
public static void UpdateSettings() { DroneRacer dr = DroneRacer.FindDroneRacer(); if (dr != null) { DroneRacerJoystickInput drji = dr.gameObject.GetComponent <DroneRacerJoystickInput>(); drji.rotationRate = PlayerPrefs.GetFloat(Constants.RotationRate); drji.halfRotationRate = drji.rotationRate / 2; drji.exponentialRate = PlayerPrefs.GetInt(Constants.ExponentialRate) == 0 ? false : true; drji.exponentialRateFactor = PlayerPrefs.GetFloat(Constants.ExponentialRateFactor); drji.throttleChangeRate = PlayerPrefs.GetFloat(Constants.ThrottleChangeRate); } }
void Awake() { droneRacer = GetComponent <DroneRacer>(); droneRacerArm = GetComponent <DroneRacerArm>(); motorSound = GetComponent <AudioSource>(); }
void Start() { droneRacer = GetComponent <DroneRacer>(); }