private IEnumerator ActivateSpeedLines() { float timeToLive = 1.0f; SpeedLineController trailRenderers = GetComponent <SpeedLineController>(); SetSpeedLineState(true); mySpeedLineFX.Play(); while (timeToLive > 0) { timeToLive -= Time.deltaTime; yield return(null); } SetSpeedLineState(false); }
private void Start() { if (!(myFuel = GetComponent <Fuel>())) { Debug.LogWarning("No Fuel-component attached!"); } if (!(myRigidbody = GetComponent <Rigidbody>())) { Debug.LogWarning("No Rigidbody-component attached!"); } if (!(mySpeedLineController = GetComponent <SpeedLineController>())) { Debug.LogWarning("No SpeedLineController-component attached!"); } if (!(mySpeedBoost = GetComponent <SpeedBoost>())) { Debug.LogWarning("No SpeedBoost-component attached!"); } else { mySpeedBoost.myOnSpeedBoost += SpeedBoost; } if (myPerfectColitionBox) { transform.localScale = new Vector3(1f, 1f, 1f); transform.GetChild(0).localScale = new Vector3(1f, 1f, 1f); } else { transform.localScale = new Vector3(0.65f, 1f, 1f); transform.GetChild(0).localScale = new Vector3(2.43f, 1.4774f, 1.4774f); } myCurrentVelocity = myStartingVelocity; }