Esempio n. 1
0
 private void OnEnable()
 {
     statScript            = GameObject.FindGameObjectWithTag("PlaneStat").GetComponent <PlaneStatus>();
     statScript.isRedPlane = true;
     redPlane.SetActive(true);
     greenPlane.SetActive(false);
 }
Esempio n. 2
0
        void initiate()
        {
            myRigidbody = GetComponent <Rigidbody2D>();

            statScript = GameObject.FindGameObjectWithTag("PlaneStat").GetComponent <PlaneStatus>();

            if (statScript.isRedPlane)
            {
                redPlane.SetActive(true);
                greenPlane.SetActive(false);

                sRend = redPlane.GetComponent <SpriteRenderer>();
            }
            else
            {
                redPlane.SetActive(false);
                greenPlane.SetActive(true);

                sRend = greenPlane.GetComponent <SpriteRenderer>();
            }

            anim = GetComponent <Animator>();
        }
Esempio n. 3
0

        
Esempio n. 4
0
 private void OnEnable()
 {
     scoreCanvas = GameObject.FindGameObjectWithTag("Score");
     scoreScript = scoreCanvas.GetComponent <ScoreBoard>();
     statScript  = GameObject.FindGameObjectWithTag("PlaneStat").GetComponent <PlaneStatus>();
 }