| 123456789101112131415161718192021222324252627 |
- using System;
- using UnityEngine;
- public class PickUp : MonoBehaviour
- {
- private GameManager gameManager;
- private void Start()
- {
- gameManager = GameObject.Find("Game Manager").GetComponent<GameManager>();
- }
- private void OnCollisionEnter(Collision other)
- {
- if (other.gameObject.CompareTag("Orb"))
- {
- gameManager.UpdateCollectedOrbs();
- Destroy(other.gameObject);
-
- }
- else
- {
- Debug.Log(other.gameObject.name);
- }
-
- }
- }
|