Пример #1
0
        // Objects may not be able to be spawned if they are too close to another object, for example
        public virtual bool CanSpawnObject(float distance, ObjectSpawnData spawnData)
        {
            // can't spawn if the sections don't match up
            if (!thisInfiniteObject.CanSpawnInSection(spawnData.section))
            {
                return(false);
            }

            for (int i = 0; i < avoidObjectRuleMaps.Count; ++i)
            {
                if (!avoidObjectRuleMaps[i].CanSpawnObject(distance))
                {
                    return(false); // all it takes is one
                }
            }
            return(true);
        }