Exemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        CollectableMono collectable = collider.gameObject.GetComponent <CollectableMono>();

        if (collectable != null)
        {
            Collect(collectable);
            collectable.OnCollect();
        }
    }
Exemplo n.º 2
0
 public void AddCollected(CollectableMono collectable)
 {
     Uncollected.Remove(collectable);
     if (!Collected.Contains(collectable))
     {
         Collected.Add(collectable);
     }
     else
     {
         Debug.LogError("attempted to add collectable " + collectable.name + " that's already been added.");
     }
 }
Exemplo n.º 3
0
 private void Collect(CollectableMono collectable)
 {
     Collected.Add(collectable);
 }