// Update is called once per frame protected void Update() { if (InstructionsController.isMessageOnScreen()) { GetComponent <RocketBase>().SetPlayerVelocity(0.0001f); } }
// Use this for initialization void Start() { Rocket current = GameObject.Find("RocketDatabase").GetComponent <RocketsDatabase>().GetCurrentRocket(); Map currentMap = GameObject.Find("MapDatabase").GetComponent <MapsDatabase>().GetCurrentMap(); SetRocket(current); SetMap(currentMap); if (PlayerPrefsX.GetBool("ShowArrows") || InstructionsController.isMessageOnScreen()) { GameObject.Find("BotBody").GetComponent <SpriteRenderer>().enabled = false; GameObject.Find("BotHead").GetComponent <SpriteRenderer>().enabled = false; GameObject.Find("TopBody").GetComponent <SpriteRenderer>().enabled = false; GameObject.Find("TopHead").GetComponent <SpriteRenderer>().enabled = false; GameObject.Find("TopSpeedBody").GetComponent <SpriteRenderer>().enabled = false; GameObject.Find("TopSpeedHead").GetComponent <SpriteRenderer>().enabled = false; } }
private void ShowVelocityText() { string velocityText; float velocity; velocity = Mathf.Abs(GameObject.FindWithTag("Player").GetComponent <Rigidbody2D>().velocity.y); velocityText = (velocity * 10).ToString("####0.0"); if (!InstructionsController.isMessageOnScreen()) { GameObject.Find("TextVelocity").GetComponent <Text>().text = "" + velocityText + "\n" + "km/h"; } else { GameObject.Find("TextVelocity").GetComponent <Text>().text = ""; } if (Time.timeScale <= 0.98f) { GameObject.Find("TextVelocity").GetComponent <Text>().text = ""; } }
private void ShowHeightText() { string heightText; float height; height = GameObject.FindWithTag("Player").GetComponent <Transform>().position.y; heightText = ((height + 2.872187f) * 5).ToString("####0.0"); if (!InstructionsController.isMessageOnScreen()) { GameObject.Find("TextHeight").GetComponent <Text>().text = "" + heightText + "\n" + "m"; } else { GameObject.Find("TextHeight").GetComponent <Text>().text = ""; } if (Time.timeScale <= 0.98f) { GameObject.Find("TextHeight").GetComponent <Text>().text = ""; } }