// Use this for initialization void Start() { warpTime = warpSound.length + 0.5f; FindObjectOfType <QuestProgress>().StartTimer(); engineAnimation = GetComponentInChildren <EnginesAnimation>(); rb = GetComponent <Rigidbody>(); stats = GameObject.Find("Stats").GetComponent <ShipStats>(); player = GetComponent <Player>(); Cursor.visible = showCursor; //drag = rb.drag; UpdateSpeedAndAcceleration(); if (warpGauge == null) { warpGauge = GameObject.Find("WarpGauge"); } if (warpGauge != null) { warpSlider = warpGauge.GetComponentInChildren <Slider>(); if (warpSlider == null) { Debug.LogError("Couldn't find warp slider"); } } noise1.Play(); }
// Use this for initialization void Start() { engineAnimation = GetComponentInChildren <EnginesAnimation>(); rb = GetComponent <Rigidbody>(); stats = GameObject.Find("Stats").GetComponent <ShipStats>(); player = GetComponent <Player>(); Cursor.visible = showCursor; //drag = rb.drag; UpdateSpeedAndAcceleration(); if (warpGauge == null) { warpGauge = GameObject.Find("WarpGauge"); } if (warpGauge != null) { warpSlider = warpGauge.GetComponentInChildren <Slider>(); if (warpSlider == null) { Debug.Log("Couldn't find warp slider"); } else { Debug.Log("warpGauge gameObject empty"); } } }