예제 #1
0
    public void DropItem(Vector2 pos)
    {
        foreach (DroppedItem item_d in DroppedItems)
        {
            if (!item_d.gameObject.activeSelf)
            {
                item_d.gameObject.SetActive(true);
                item_d.RandomItem();
                item_d.transform.position = pos;
                return;
            }
        }

        Transform   child = Instantiate(item_dropped).transform;
        DroppedItem ditem = child.GetComponent <DroppedItem>();

        ditem.RandomItem();

        child.SetParent(Items_t);
        child.localPosition = pos;
        child.localScale    = new Vector3(50, 50, 1);
    }