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 ExtraLife : MonoBehaviour
- {
- private LifeManager lifeStystem;
- // Start is called before the first frame update
- void Start()
- {
- lifeStystem = FindObjectOfType<LifeManager>();
- }
- void OnTriggerEnter2D(Collider2D other)
- {
- if (other.name == "Player")
- {
- lifeStystem.AddLife();
- Destroy(gameObject);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement