Exemplo 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++;
    }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        s = this;

        if (autoStart)
        {
            Invoke("LateStart", 5f);
        }
    }
Exemplo n.º 3
0
 public void DestroyItemsOnSlots()
 {
     foreach (BeltItemSlot slot in allBeltItemSlots)
     {
         if (slot != null)
         {
             BeltMaster.DestroyItem(slot.myItem);
         }
     }
 }
Exemplo n.º 4
0
    // Start is called before the first frame update
    void Start()
    {
        s = this;

        if (autoStart)
        {
            print("Starting Belt System");
            SetupBeltSystem();
            StartBeltSystemLoops();
        }
    }
Exemplo n.º 5
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++;
    }
Exemplo n.º 6
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));
        }
    }
Exemplo n.º 7
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));
        }
    }