Ejemplo n.º 1
0
        internal override void FadeToColor(Color screen_color, float time)
        {
            if (screen_fade == null || !screen_fade)
            {
                screen_fade      = GameObject.CreatePrimitive(PrimitiveType.Quad);
                screen_fade.name = "screen fade quad";
                screen_fade.transform.SetParent(camera_rig.centerEyeAnchor);
                screen_fade.transform.localPosition = new Vector3(0, 0, 1);
                screen_fade.transform.localRotation = Quaternion.identity;
                screen_fade.transform.localScale    = 10 * Vector3.one;

                screen_fade_material.color = new Color(0, 0, 0, 0);
                screen_fade.GetComponent <Renderer>().sharedMaterial = screen_fade_material;
            }
            if (screen_fade_coro != null)
            {
                camera_rig.StopCoroutine(screen_fade_coro);
            }
            screen_fade_coro = camera_rig.StartCoroutine(_Fading(screen_color, Time.time, time));
        }