Exemplo n.º 1
0
        private static IEnumerator GenerateWrapper(IEnumerator generateRoutine, Chunk instance, PlanetInfo planet)
        {
            yield return(instance.StartCoroutine(generateRoutine));

            IEnumerable <GameObject> objs = planet.InvokeOnGenerateInside(instance);

            if (objs == null)
            {
                yield break;
            }
            GameObject[] networkStuff = networkStuffField.GetValue <GameObject[]>(instance);
            int          temp         = tempField.GetValue <int>(instance);

            foreach (GameObject obj in objs)
            {
                if (obj == null)
                {
                    continue;
                }
                networkStuff[temp] = obj;
                temp++;
            }
            tempField.SetValue(instance, temp);
            yield break;
        }