Example #1
0
    void OnTriggerEnter2D(Collider2D other)  //TODO
    {
        BlazeFoxController controller = other.GetComponent <BlazeFoxController>();

        if (controller != null)
        {
            controller.changeHealth(1);
        }
        projectile noTouch = other.GetComponent <projectile>();

        if (noTouch != null)
        {
            return;
        }

        if (other.tag == "projectile platform")
        {
            speed     = 0;
            TempSpeed = 0;
            return;
        }
        if (other.tag == "ground")
        {
            HighScore.instance.changeScore(1);
        }
        Instantiate(Particle, transform.position, Quaternion.identity);
        Destroy(gameObject);
    }
Example #2
0
    void OnTriggerEnter2D(Collider2D other)   //TODO
    {
        BlazeFoxController controller = other.GetComponent <BlazeFoxController>();

        if (controller != null)
        {
            if (Icon.tag == "coffee")
            {
                if (otherIcon.activeSelf)
                {
                    otherIcon.SetActive(false);
                }
                Icon.SetActive(true);
                controller.ChangeSpeed(10);
            }

            if (Icon.tag == "monster" && !otherIcon.activeSelf)
            {
                if (otherIcon.activeSelf)
                {
                    otherIcon.SetActive(false);
                }
                Icon.SetActive(true);
                controller.ChangeSpeed(100);
            }
            Destroy(gameObject);
        }
    }