예제 #1
0
    void Start()
    {
        Time.timeScale = 1;

        anim              = GetComponent <Animator>();
        rb                = GetComponent <Rigidbody>();
        text              = scoreText.GetComponent <TextMeshProUGUI>();
        checkpointText    = GameObject.Find("CheckpointCanvas");
        checkpointCanvas  = checkpointText.GetComponent <Canvas>();
        isGrounded        = false;
        defaultScale      = transform.localScale.x; // assuming this is facing right
        treasure          = GameObject.Find("Treasure");
        treasureCounter   = treasure.GetComponent <treasureCounter>();
        treasureCollected = new bool[treasureCounter.chestControllers.Length];
        treasureCounter.anim.Play("TreasureHudSlideIn");
        LoadPlayerScore();
        //distanceGround = GetComponent<Collider> ().bounds.extents.y;
    }
예제 #2
0
 private void Start()
 {
     canvas          = gameObject.GetComponent <Canvas>();
     movement        = GameObject.Find("MilesNewWorking").GetComponent <Movement>();
     treasureCounter = GameObject.Find("Treasure").GetComponent <treasureCounter>();
 }