Ejemplo n.º 1
0
    public void CreateItemsBasedOnTick()
    {
        if (isFirstRun)
        {
            isFirstRun = false;
            StopAllCoroutines();
        }

        if (curTick >= tickCount)
        {
            for (int i = 0; i < allBeltItemSlotsArray.Length; i++)
            {
                BeltItemSlot slot = allBeltItemSlotsArray[i];
                if (slot != null)
                {
                    if (slot.myItem == null)
                    {
                        BeltMaster.CreateItemAtBeltSlot(Instantiate(itemPrefab).GetComponent <BeltItem>(), slot);
                    }
                }
            }
            curTick = 0;
        }

        curTick++;
    }
Ejemplo n.º 2
0
    public void CreateItemsBasedOnTick()
    {
        if (curTick >= tickCount)
        {
            foreach (BeltItemSlot slot in myBeltItemSlots)
            {
                if (slot != null)
                {
                    BeltMaster.CreateItemAtBeltSlot(Instantiate(itemPrefab).GetComponent <BeltItem>(), slot);
                }
            }
            curTick = 0;
        }

        curTick++;
    }
Ejemplo n.º 3
0
    // Update is called once per frame
    IEnumerator CreateItems()
    {
        yield return(new WaitForSeconds(1f));

        while (true)
        {
            if (isActive)
            {
                foreach (BeltItemSlot slot in myBeltItemSlots)
                {
                    if (slot != null)
                    {
                        BeltMaster.CreateItemAtBeltSlot(Instantiate(itemPrefab).GetComponent <BeltItem>(), slot);
                    }
                }
            }
            yield return(new WaitForSeconds(delay));
        }
    }
Ejemplo n.º 4
0
    // Update is called once per frame
    IEnumerator CreateItems()
    {
        yield return(new WaitForSeconds(1f));

        while (true)
        {
            if (isActive)
            {
                for (int i = 0; i < allBeltItemSlotsArray.Length; i++)
                {
                    BeltItemSlot slot = allBeltItemSlotsArray[i];
                    if (slot != null)
                    {
                        if (slot.myItem == null)
                        {
                            BeltMaster.CreateItemAtBeltSlot(Instantiate(itemPrefab).GetComponent <BeltItem>(), slot);
                        }
                    }
                }
            }
            yield return(new WaitForSeconds(delay));
        }
    }