示例#1
0
        public void Refresh()
        {
            if (!_config.IsEnabled)
            {
                return;
            }

            if (_texturePool == null || _texturePool.Count == 0 || _constellation == null)
            {
                return;
            }

            DespawnAll();

            var shuffledList = GenerateShuffledList(_texturePool, _constellation.TransformDataCollections.Count);

            //foreach pillow
            for (var i = 0; i < _constellation.TransformDataCollections.Count; i++)
            {
                var collection = _constellation.TransformDataCollections[i];
                var options    = new Pillow.PillowParams
                {
                    TransformSetter = new AdvancedTransformSetter(collection.TransformData),
                    Texture         = shuffledList[i]
                };

                Spawn(options);
            }
        }
示例#2
0
        public void MassSpawn(MassSpawnParams spawnParams)
        {
            if (spawnParams.Textures.Count == 0 || spawnParams.Amount == 0)
            {
                return;
            }

            for (int i = 0; i < spawnParams.Amount; i++)
            {
                var tSetter = new SimpleTransformSetter(new TransformData
                {
                    Position = GetRandomVector3(spawnParams.AreaStart, spawnParams.AreaEnd),
                    Rotation = Quaternion.identity,
                    Scale    = Vector3.one
                });

                var options = new Pillow.PillowParams
                {
                    TransformSetter = tSetter,
                    Texture         = spawnParams.Textures[Random.Range(0, spawnParams.Textures.Count)]
                };

                Spawn(options);
            }
        }
示例#3
0
        private void Spawn(Pillow.PillowParams spawnParams)
        {
            if (!CanSpawn)
            {
                return;
            }

            var pillow = _factory.Create();

            pillow.Init(spawnParams);

            _spawnedPillows.Add(pillow);
        }