Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class PipeMiddleScript : MonoBehaviour
- {
- public LogicScript logic;
- void Start()
- {
- logic = GameObject.FindGameObjectWithTag("Logic").GetComponent<LogicScript>();
- }
- // OnTriggerEnter2D is called when the attached Collider2D component
- // detects a trigger collision.
- private void OnTriggerEnter2D(Collider2D collision)
- {
- if (collision.CompareTag("Player")) // Check if the collided object is the bird
- {
- logic.addScore(1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement