Esempio n. 1
0
    // --BAD--|--20--GOOD--|--10--PERFECT--|HitFrame|--10--PERFECT--|--20--GOOD--|--BAD--

    void Start()
    {
        HitFrame  = GameObject.FindGameObjectWithTag("HitFrame");
        sm        = GameObject.Find("SongManager").GetComponent <SongManager>();
        hm        = GameObject.Find("HealthManager").GetComponent <HealthManager>();
        audioGato = GameObject.FindGameObjectWithTag("SoundManager").GetComponent <AudioGato>();
        score     = GameObject.FindGameObjectWithTag("ScoreManager").GetComponent <ScoreManager>();
    }
Esempio n. 2
0
    void Start()
    {
        audioGato   = GameObject.FindGameObjectWithTag("SoundManager").GetComponent <AudioGato>();
        aux         = GameObject.FindGameObjectWithTag("HitFrame");
        hitFramePos = aux.transform.position.x;
        tap         = GameObject.FindGameObjectWithTag("TapManager").GetComponent <TapManager>();

        rb          = GetComponent <Rigidbody2D>();
        rect        = GetComponent <RectTransform>();
        rb.velocity = new Vector2(speed * Screen.width / 10, 0);

        //Pegar a parte que deve ser colorida dentre os Images dos filhos
        Image[] children = GetComponentsInChildren <Image>();
        for (int i = 0; i < children.Length; i++)
        {
            if (children[i].gameObject.name.Equals("Color"))
            {
                img = children[i];
                break;
            }
        }
    }