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; }
private void Start() { canvas = gameObject.GetComponent <Canvas>(); movement = GameObject.Find("MilesNewWorking").GetComponent <Movement>(); treasureCounter = GameObject.Find("Treasure").GetComponent <treasureCounter>(); }