public void DeregisterPickup(PickUpBase pickup)
    {
        var collectable = collectables.Find(x => x.targetTransform == pickup.transform);

        collectables.Remove(collectable);
        collectables.TrimExcess();
    }
Example #2
0
 public void DeRegisterPickupToRadarHelper(PickUpBase pickup)
 {
     for (int i = 0; i < RadarHelper.Count; ++i)
     {
         RadarHelper[i].DeregisterPickup(pickup);
     }
 }
    public void RegisterPickup(PickUpBase pickup)
    {
        if (collectables.Find(x => x.targetTransform == pickup.transform) != null)
        {
            return;
        }
        PickupGameObject newPickupGameObject = new PickupGameObject();

        newPickupGameObject.targetTransform = pickup.transform;
        collectables.Add(newPickupGameObject);
    }