Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     doorOpen.SetActive(false);
     meterObj = GameObject.Find("ProgressBar");
     meter = meterObj.GetComponent<MischiefMeter>();
 }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        myAudio = GetComponent<AudioSource> ();
        gameController = GameObject.Find("GameController");
        myScore = gameController.GetComponent<ScoreHandler>();
        meter = GameObject.Find("ProgressBar");
        meterBar = meter.GetComponent<MischiefMeter>();
        rB = GetComponent<Rigidbody2D>();
        mySprite = GetComponent<SpriteRenderer>();
        spriteId = UnityEngine.Random.Range(0, foodSprites.Length);
        mySprite.sprite = foodSprites[spriteId];

        pointsPos = new Vector2(transform.position.x, transform.position.y + initOffsetY);
        pointsPos2 = new Vector2(pointsPos.x + offsetX, pointsPos.y + offsetY);
    }