Example #1
0
        public static IEnumerator Flicker(List <GameObject> objects, int flickerCount = 7, float durationFactor = 0.02f, bool reverse = false)
        {
            bool active = objects[0].activeSelf;

            for (int i = 0; i < flickerCount; i++)
            {
                active = !active;
                objects.ForEach(delegate(GameObject o)
                {
                    o.SetActive(active);
                });
                int num = reverse ? (flickerCount - i) : (i + 1);
                yield return(CoreUtil.WaitForSecondsOrBreak((float)num * durationFactor));
            }
        }