private void Start() { hud = FindObjectOfType <Hud_Manager>(); collider = GetComponent <Collider2D>(); StartCoroutine(spawner()); }
private void Start() { sr = GetComponent <SpriteRenderer>(); rb = GetComponent <Rigidbody2D>(); ScoreSO = FindObjectOfType <SpawnManager>(); hud = FindObjectOfType <Hud_Manager>(); Random_color = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f)); randomIndex = Random.Range(0, ScoreSO.ObjectList.Count); score = ScoreSO.ObjectList[randomIndex].points; sr.sprite = ScoreSO.ObjectList[randomIndex].image; rb.mass = ScoreSO.ObjectList[randomIndex].mass; rb.drag = ScoreSO.ObjectList[randomIndex].drag; if (ScoreSO.ObjectList[randomIndex].hasRandomColor == true) { sr.color = Random_color; } }
private void Start() { hud = FindObjectOfType <Hud_Manager>(); }