Пример #1
0
 public void SpawnTutorialSet(int stage)
 {
     for (int i = 1; i < AssemblyLineItem.SPRITE_COUNT; i++)
     {
         GameObject item = GameObjectUtils.AddChild(itemParent, itemPrefab);
         item.transform.position = GetPosition(index: i, indexOffset: -1);            //StartPosition.position + (i - 1) * new Vector3(distanceBetween, 0);
         AssemblyLineItem newItemScript = item.GetComponent <AssemblyLineItem>();
         newItemScript.Init(i - 1, stage, i);
         itemQueue.Enqueue(newItemScript);
         newItemScript.CompareVisible(visibleCount, false);
     }
 }
Пример #2
0
    public void ShiftAndAddNewItem()
    {
        MoveUpLine();
        // Add new item
        GameObject item         = GameObjectUtils.AddChild(itemParent, itemPrefab);
        int        newItemIndex = itemQueue.Count;

        item.transform.position = GetPosition(index: newItemIndex);        //StartPosition.position + newItemIndex * new Vector3(distanceBetween, 0);
        AssemblyLineItem newItemScript = item.GetComponent <AssemblyLineItem>();

        newItemScript.Init(newItemIndex);
        itemQueue.Enqueue(newItemScript);
        newItemScript.CompareVisible(visibleCount, true);
    }
Пример #3
0
    public void PopulateQueue(bool compare = false, int count = -1, int indexOffset = 0)
    {
        UpdateVisibleCount();
        int toSpawn = (count == -1) ? startingCount + 1 : count;

        for (int i = 0; i < toSpawn; i++)
        {
            GameObject item = GameObjectUtils.AddChild(itemParent, itemPrefab);
            item.transform.position = GetPosition(index: i, indexOffset: indexOffset);
            AssemblyLineItem itemScript = item.GetComponent <AssemblyLineItem>();
            itemScript.Init((i + indexOffset));
            itemQueue.Enqueue(itemScript);
            itemScript.CompareVisible(visibleCount, compare);
        }
    }