void Start()
 {
     select = GetComponent<SelectToInter>();
     select.SetActive(false);
     select2 = GameObject.Find("Play").GetComponent<SelectToInter>();
 }
Beispiel #2
0
    void Start()
    {
        bioEffect = GetComponent<AudioSource>();
        backScript = backButton.GetComponent<SelectToMenu>();
        backRends = backButton.GetComponentsInChildren<SpriteRenderer>();
        cR = GetComponentsInChildren<SpriteRenderer>();
        for(int i = 0; i < cR.Length; ++i)
        {
            Color c = cR[i].color;
            c.a = 0;
            cR[i].color = c;
        }

        rhinoR = rhino.GetComponentsInChildren<SpriteRenderer>();
        bearR = bear.GetComponentsInChildren<SpriteRenderer>();
        bullR = bull.GetComponentsInChildren<SpriteRenderer>();

        rhinoNameR = rhinoName.GetComponentsInChildren<SpriteRenderer>();
        bearNameR = bearName.GetComponentsInChildren<SpriteRenderer>();
        bullNameR = bullName.GetComponentsInChildren<SpriteRenderer>();

        rhinoCollider = rhino.GetComponent<BoxCollider2D>();
        bearCollider = bear.GetComponent<BoxCollider2D>();
        bullCollider = bull.GetComponent<BoxCollider2D>();

        refPosition = rhino.transform.localPosition + new Vector3(-0.5f, 0, 0);

        rhinoFigure = GameObject.Find("Rhino");
        rhinoAnimate = rhinoFigure.GetComponents<Animate>();
        bearFigure = GameObject.Find("Bear");
        bearAnimate = bearFigure.GetComponents<Animate>();
        bullFigure = GameObject.Find("Bull");
        bullAnimate = bullFigure.GetComponents<Animate>();
        rhinoAnimate[0].enabled = true;
        rhinoAnimate[1].enabled = false;
        bearAnimate[0].enabled = true;
        bearAnimate[1].enabled = false;
        bullAnimate[0].enabled = true;
        bullAnimate[1].enabled = false;

        rhinoStoI = rhino.GetComponent<SelectToInter>();
        bearStoI = bear.GetComponent<SelectToInter>();
        bullStoI = bull.GetComponent<SelectToInter>();
        rhinoStoB = rhino.GetComponent<SelectToBio>();
        bearStoB = bear.GetComponent<SelectToBio>();
        bullStoB = bull.GetComponent<SelectToBio>();

        playInter = playButton.GetComponent<SelectToInter>();
        playRends = playButton.GetComponentsInChildren<SpriteRenderer>();

        bioTextR = bioText.GetComponent<SpriteRenderer>();

        activeScalersRhinoSlight = GameObject.FindGameObjectsWithTag("SlightScaleRhino");
        activeScalersRhinoSlightB = new BeatScaleFree[activeScalersRhinoSlight.Length];
        for(int i = 0; i < activeScalersRhinoSlight.Length; ++i)
        {
            activeScalersRhinoSlightB[i] = activeScalersRhinoSlight[i].GetComponent<BeatScaleFree>();
        }
        activeScalersRhinoMini = GameObject.FindGameObjectsWithTag("MiniScaleRhino");
        activeScalersRhinoMiniB = new BeatScaleFree[activeScalersRhinoMini.Length];
        for(int i = 0; i < activeScalersRhinoMini.Length; ++i)
        {
            activeScalersRhinoMiniB[i] = activeScalersRhinoMini[i].GetComponent<BeatScaleFree>();
        }

        activeScalersBearSlight = GameObject.FindGameObjectsWithTag("SlightScaleBear");
        activeScalersBearSlightB = new BeatScaleFree[activeScalersBearSlight.Length];
        for(int i = 0; i < activeScalersBearSlight.Length; ++i)
        {
            activeScalersBearSlightB[i] = activeScalersBearSlight[i].GetComponent<BeatScaleFree>();
        }
        activeScalersBearMini = GameObject.FindGameObjectsWithTag("MiniScaleBear");
        activeScalersBearMiniB = new BeatScaleFree[activeScalersBearMini.Length];
        for(int i = 0; i < activeScalersBearMini.Length; ++i)
        {
            activeScalersBearMiniB[i] = activeScalersBearMini[i].GetComponent<BeatScaleFree>();
        }

        activeScalersBullSlight = GameObject.FindGameObjectsWithTag("SlightScaleBull");
        activeScalersBullSlightB = new BeatScaleFree[activeScalersBullSlight.Length];
        for(int i = 0; i < activeScalersBullSlight.Length; ++i)
        {
            activeScalersBullSlightB[i] = activeScalersBullSlight[i].GetComponent<BeatScaleFree>();
        }
        activeScalersBullMini = GameObject.FindGameObjectsWithTag("MiniScaleBull");
        activeScalersBullMiniB = new BeatScaleFree[activeScalersBullMini.Length];
        for(int i = 0; i < activeScalersBullMini.Length; ++i)
        {
            activeScalersBullMiniB[i] = activeScalersBullMini[i].GetComponent<BeatScaleFree>();
        }
    }