SquareDash/Assets/TopPartScript.cs
2023-11-03 17:32:50 +01:00

27 lines
559 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TopPartScript : MonoBehaviour
{
public LogicScript logic;
// Start is called before the first frame update
void Start()
{
logic = GameObject.FindGameObjectWithTag("Logic").GetComponent<LogicScript>();
}
// Update is called once per frame
void Update()
{
}
private void OnTriggerEnter2D(Collider2D collision) {
if (collision.gameObject.layer == 3){
logic.addScore(1);
}
}
}