示例#1
0
 // Update is called once per frame
 protected void Update()
 {
     if (InstructionsController.isMessageOnScreen())
     {
         GetComponent <RocketBase>().SetPlayerVelocity(0.0001f);
     }
 }
示例#2
0
    // 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;
        }
    }
示例#3
0
    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 = "";
        }
    }
示例#4
0
    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 = "";
        }
    }