示例#1
0
    /// <summary>
    /// Notify the manager to free up the spawn point this pickup has been spawned at
    /// and decrement the number of pickups in the scene.
    /// </summary>
    protected void NotifyManager()
    {
        GameObject    pickupMgr = GameObject.Find("PickupManager");
        PickupManager pMgr      = pickupMgr.GetComponent <PickupManager>();

        // Free up the spawn point this pickup instance was located at,
        // so that a new health pickup can be spawned there.
        pMgr.FreeSpawn(spawnIndex);
        // Decrement number of pickups in the scene
        pMgr.PickupCount = pMgr.PickupCount - 1;
    }