Beispiel #1
0
        public void BeltItemSlotProcessorCheck()
        {
            // Arrange
            List <List <BeltItemSlot> > dummyBeltItemSlotGroup = new List <List <BeltItemSlot> >();

            dummyBeltItemSlotGroup.Add(new List <BeltItemSlot>());
            dummyBeltItemSlotGroup[0].Add(new BeltItemSlot(Vector3.zero));
            dummyBeltItemSlotGroup[0].Add(new BeltItemSlot(Vector3.zero));
            BeltItemSlot.ConnectBeltItemSlots(dummyBeltItemSlotGroup[0][0], dummyBeltItemSlotGroup[0][1]);

            ObjectPoolSimple <BeltItem> dummyItemPool = new ObjectPoolSimple <BeltItem>(1, 1);

            dummyItemPool.SetUp();
            dummyBeltItemSlotGroup[0][0].myItem = dummyItemPool.Spawn();


            List <BeltPreProcessor.BeltGroup> dummyBeltGroup = new List <BeltPreProcessor.BeltGroup>();

            BeltPreProcessor.BeltGroup newGroup = new BeltPreProcessor.BeltGroup();
            newGroup.beltItemSlotGroups = dummyBeltItemSlotGroup;
            dummyBeltGroup.Add(newGroup);

            BeltItemSlotUpdateProcessor myBeltItemSlotUpdateProcessor = new BeltItemSlotUpdateProcessor(dummyItemPool, dummyBeltGroup);

            // Act
            myBeltItemSlotUpdateProcessor.UpdateBeltItemSlots();

            // Assert
            Assert.IsNull(dummyBeltItemSlotGroup[0][0].myItem);
            Assert.IsNotNull(dummyBeltItemSlotGroup[0][1].myItem);
        }
Beispiel #2
0
    public void LateStart()
    {
        print("Starting Belt System");
        itemPool = new ObjectPoolSimple <BeltItem>(maxItemCount, maxItemCount);
        itemPool.SetUp();

        entityPoolEcs = GetComponent <ObjectPoolECS>();

        SetupBeltSystem();

        //StartCoroutine(CreateGfxsSlowly());
        StartBeltSystemLoops();


        allCreators   = new List <MagicItemCreator>(FindObjectsOfType <MagicItemCreator>());
        allDestroyers = new List <MagicItemDestroyer>(FindObjectsOfType <MagicItemDestroyer>());

        FindObjectOfType <AutoRotate>().speed *= -1f;
    }