// Use this for initialization void Start() { m_Animator = GetComponent <Animator>(); my_colour = GetComponent <TargetColour>(); if (my_colour.colour == "red") { m_Animator.SetInteger("color", 1); } else if (my_colour.colour == "blue") { m_Animator.SetInteger("color", 2); } else if (my_colour.colour == "green") { m_Animator.SetInteger("color", 3); } else if (my_colour.colour == "yellow") { m_Animator.SetInteger("color", 4); } else { m_Animator.SetInteger("color", 5); } }
void OnTriggerExit2D(Collider2D coll) { other_colour = coll.GetComponent <TargetColour>(); if (coll.tag == "tag_target_location" && other_colour.colour == my_colour.colour) { Debug.Log("EXIT tag_target_location"); CandleManager.Instance.DecreasePlaced(); m_Animator.SetBool("lit", false); } }