
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
빗방울이 르탄이에게 닿지 않고 땅에 떨어져도 점수가 올라가요
코드 자체에 문제가 있는 건지.. 한 번 봐주시면 좋을 것 같습니다!

using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using UnityEditor.Experimental.GraphView;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
float size = 1.0f;
int score = 1;
SpriteRenderer renderer;
// Start is called before the first frame update
void Start()
{
renderer = GetComponent<SpriteRenderer>();
float x = Random.Range(-2.4f, 2.4f);
float y = Random.Range(5.5f, 6f);
transform.position = new Vector3(x, y, 0);
int type = Random.Range(1, 4);
if (type == 1)
{
size = 0.8f;
score = 1;
renderer.color = new UnityEngine.Color(100 / 255f, 100 / 255f, 1f, 1f);
}
else if (type == 2)
{
size = 1f;
score = 2;
renderer.color = new UnityEngine.Color(130 / 255f, 130 / 255f, 1f, 1f);
}
else if (type == 3)
{
size = 1.2f;
score = 3;
renderer.color = new UnityEngine.Color(150 / 255f, 150 / 255f, 1f, 1f);
}
transform.localScale = new Vector3(size, size, 0);
}
// Update is called once per frame
void Update()
{
}
private void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameObject.CompareTag("ground"));
{
Destroy(this.gameObject);
}
if (collision.gameObject.CompareTag("Player"));
{
Gamemanager.Instance.AddScore(score);
Destroy(this.gameObject);
}
}
}

