private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "Player" && !inuse) { inuse = true; StopAllCoroutines(); parent.Send(channel_id); parent.setActiveTrigger(gameObject, channel_id); updateColor(); if (channelmode) { StartCoroutine(ChangeColor(0)); return; } int i = 0; foreach (GameObject obj in objects) { StartCoroutine(ChangeColor(i)); i++; } } }
public void Enter() { StopAllCoroutines(); parent.Send(channel_id); parent.setActiveTrigger(gameObject, channel_id); updateColor(); if (channelmode) { StartCoroutine(ChangeColor(0)); return; } int i = 0; foreach (GameObject obj in objects) { StartCoroutine(ChangeColor(i)); i++; } }