| 1234567891011121314151617181920212223242526 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class SoulCollector : MonoBehaviour
- {
- public PlayerController player;
- private void Awake()
- {
- player = GetComponentInParent<PlayerController>();
- }
- private void OnTriggerEnter(Collider other)
- {
- if (player == null)
- {
- player = GetComponentInParent<PlayerController>();
- }
- Soul soul = other.GetComponentInParent<Soul>();
- if (soul)
- {
- soul.BeCollect(player.playerId);
- }
- }
- }
|