Esempio n. 1
0
        public void Spawn(IEnumerator routine, bool isRecyclable)
        {
            AssertTools.IsNotNull(routine);

            CoroutineItem item;
            var           checkIndex = _size;

            if (checkIndex < _capacity && null != _items [checkIndex])
            {
                item          = _items [checkIndex];
                item.isDone   = false;
                item.isKilled = false;
            }
            else
            {
                if (checkIndex + 1 > _capacity)
                {
                    Array.Resize(ref _items, _capacity + 16);
                }

                item = new CoroutineItem();
                _items[checkIndex] = item;
            }

            ++_size;
            item.routine      = routine;
            item.isRecyclable = isRecyclable;
        }
Esempio n. 2
0
 private void _SetMainAsset(GameObject mainAsset)
 {
     _mainAsset = mainAsset;
     AssertTools.IsNotNull(mainAsset);
 }