// Update is called once per frame void Update() { Stage2_IceScript ice = Ice_Break.GetComponent <Stage2_IceScript>(); if (ice.Ice_Count == 0) { anim.SetBool("Tobasu", true); } }
void OnTriggerEnter2D(Collider2D other) { //Debug.Log("Enter : " + other.gameObject.name); hit = other.gameObject; Stage2_IceScript ice = GetComponent <Stage2_IceScript>(); if (hit.gameObject.CompareTag("Rock")) { ice.Ice_Count--; } }