예제 #1
0
 private void Start()
 {
     _player        = FindObjectOfType <PlayerModel>();
     _goldList      = new List <GoldModel>();
     _listOfGold    = FindObjectOfType <ListOfGoldModel>();
     _goldCollector = FindObjectOfType <GoldCollector>();
 }
예제 #2
0
 private void OnTriggerEnter(Collider other)
 {
     _goldCollector = other.gameObject.GetComponent <GoldCollector>();
     if (_goldCollector != null && !_isCollected)
     {
         _isCollected = true;
         _goldCollector.AddGold();
         _goldCollector.PlaceGold(this.transform, this);
     }
 }