private void OnTriggerEnter2D(Collider2D collision) { ChronoObject chronoObject = collision.GetComponentInParent <ChronoObject>(); if (chronoObject != null) { chronoObject.ChangeTimeState(timeModifier); } }
private void OnTriggerEnter2D(Collider2D collision) { Debug.Log("collision"); Debug.Log(collision.tag); if (collision.CompareTag("chrono")) { ChronoObject chrono = collision.GetComponentInParent <ChronoObject>(); chrono.ChangeTimeState(timeModifier); Destroy(gameObject); } }