Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        GameObject go = GameObject.Find("Hit_marker");

        ok        = go.GetComponent <Rob_Beats>();
        ok_points = ok.points;
    }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        GameObject go = GameObject.Find("Hit_marker");

        ok        = go.GetComponent <Rob_Beats>();
        ok_points = ok.points;
        points    = ok.points;

        if (Input.GetKeyDown("left") && Input.GetKeyDown("right") && hit == true)
        {
            points = points + 100;
            //score.text = ("score: " + points);
            Destroy(cull);

            Debug.Log(points);
            hit = false;
        }

        else if (Input.GetKeyDown("left") && Input.GetKeyDown("right") && hit == false)
        {
            Destroy(cull);
            hit_L = false;
            hit_R = false;
        }

        if (Input.GetKeyDown("left") && hit_L == true)
        {
            points = points + 50;
            // score.text = ("score: " + points);
            Destroy(cull);

            Debug.Log(points);
            hit_L = false;
        }

        else if (Input.GetKeyDown("left") && hit_L == false)
        {
            Destroy(cull);
            hit_R = false;
        }

        if (Input.GetKeyDown("right") && hit_R == true)
        {
            points = points + 50;
            // score.text = ("score: " + points);
            Destroy(cull);

            Debug.Log(points);
            hit_R = false;
        }

        else if (Input.GetKeyDown("right") && hit_R == false)
        {
            Destroy(cull);
            hit_L = false;
        }
    }