Ejemplo n.º 1
0
    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++;
            }
        }
    }
Ejemplo n.º 2
0
    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++;
        }
    }