Example #1
0
    void DebugGen()
    {
        for (int i = 0; i < transform.childCount; i++)
        {
            Destroy(transform.GetChild(i).gameObject);
        }

        //Instantiate(dm.prefabArray[Random.Range(0, dm.prefabArray.Length)]);
        //GameObject go = Instantiate(dm.prefabArray[0], transform);

        ////yeah there's a better way to do this
        //go.GetComponent<IItem>().RollStats(new RollInfo(BaseRoller.RollInitiative(100)));

        BaseRoller.InstantiateRandomItem(100, transform.position, transform.rotation, transform);
    }
Example #2
0
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player")
        {
            gg = other;

            go = BaseRoller.InstantiateItem(roll, other.transform.position, other.transform.rotation, other.transform.GetChild(0)).GetComponent <Item>();
            go.gameObject.SetActive(false);

            GameObject dg = Instantiate(slot, pending.position, pending.rotation, pending);
            dg.name = "Slot";

            GameObject item = Instantiate(PrefabHolder.staticIconArray[roll.prefabID].icon, dg.transform.position, dg.transform.rotation, dg.transform);
            item.tag = Constants.Tag_UI_Item;
            Instantiate(PrefabHolder.staticTierArray[(int)go.Rarity], item.transform.position, item.transform.rotation).transform.SetParent(item.transform);

            DragContainer dragContainer = dg.GetComponentInChildren <DragContainer>();
            dragContainer.Item = go;

            Destroy(gameObject);
        }
    }
Example #3
0
 void Start()
 {
     spawn = Instantiate(item, transform.position, transform.rotation, null);
     spawn.GetComponent <PickupItem>().roll = BaseRoller.RollItem(100);
 }