Beispiel #1
0
    //Function runs when an item is collected
    protected virtual void OnCollectItem(SpawnerScript item)
    {
        //if the entity tag is "Player" set Collect parameter 0
        if (gameObject.transform.tag == "Player")
        {
            item.Collect(0);
        }

        //if the entity tag is "Player2" set Collect parameter 1
        if (gameObject.transform.tag == "Player2")
        {
            item.Collect(1);
        }
    }