Пример #1
0
    public void DropNewItem(string itemName)
    {
        GameObject go     = (GameObject)Instantiate(Resources.Load(itemName));
        Vector3    newPos = transform.position;

        newPos.z = go.transform.position.z;
        go.transform.position = newPos;

        DropItem dropItem = go.GetComponent <DropItem>();

        if (!Manager.S.itemPickups)
        {
            if (Manager.S.teamManas [team] >= 1 && dropItem.TryDrop(this))
            {
                Manager.S.teamManas [team] -= 1;
            }
            else
            {
                Destroy(go);
            }
        }
        else if (dropItem.TryDrop(this))
        {
            Destroy(itemIcon);
        }
    }