예제 #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        //Debug.Log(collision.name);

        if (collision.name == "Goal")
        {
            TriggerGoal();
        }
        else if (collision.name.Contains("Snowflake"))
        {
            Snowflake snowflake = collision.gameObject.GetComponent <Snowflake>();
            TriggerSnowflake(snowflake.Color());
        }
    }
예제 #2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        //Debug.Log(collision.name);

        if (collision.name == "Goal")
        {
            TriggerGoal();
        }
        else if (collision.name.Contains("Snowflake"))
        {
            Snowflake snowflake = collision.gameObject.GetComponent <Snowflake>();
            TriggerSnowflake(snowflake.Color());
        }
        else if (collision.name == "FluffysPenguinDetector")
        {
            fluffy.gameObject.GetComponent <Fluffy>().FollowMe();
            Destroy(collision);
        }
    }