コード例 #1
0
        private static void Init()
        {
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/UI/ScreenTintCanvas"), RoR2Application.instance.mainCanvas.transform);

            FadeToBlackManager.alpha = 0f;
            FadeToBlackManager.image = gameObject.transform.GetChild(0).GetComponent <Image>();
            FadeToBlackManager.UpdateImageAlpha();
            RoR2Application.onUpdate   += FadeToBlackManager.Update;
            SceneManager.sceneUnloaded += FadeToBlackManager.OnSceneUnloaded;
        }
コード例 #2
0
        private static void Init()
        {
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/UI/ScreenTintCanvas"));

            UnityEngine.Object.DontDestroyOnLoad(gameObject);
            FadeToBlackManager.alpha = 0f;
            FadeToBlackManager.image = gameObject.transform.GetChild(0).GetComponent <Image>();
            FadeToBlackManager.UpdateImageAlpha();
            RoR2Application.onUpdate += FadeToBlackManager.Update;
        }
コード例 #3
0
        // Token: 0x0600059C RID: 1436 RVA: 0x00017394 File Offset: 0x00015594
        private static void Update()
        {
            float target = 2f;
            float num    = 4f;

            if (FadeToBlackManager.fadeCount <= 0)
            {
                target = 0f;
                num   *= 0.25f;
            }
            FadeToBlackManager.alpha = Mathf.MoveTowards(FadeToBlackManager.alpha, target, Time.unscaledDeltaTime * num);
            FadeToBlackManager.UpdateImageAlpha();
        }
コード例 #4
0
 // Token: 0x0600059A RID: 1434 RVA: 0x0001737F File Offset: 0x0001557F
 public static void OnSceneUnloaded(Scene scene)
 {
     FadeToBlackManager.ForceFullBlack();
 }
コード例 #5
0
 // Token: 0x06000AF4 RID: 2804 RVA: 0x0003687D File Offset: 0x00034A7D
 private static void Update()
 {
     FadeToBlackManager.alpha = Mathf.MoveTowards(FadeToBlackManager.alpha, (FadeToBlackManager.fadeCount > 0) ? 2f : 0f, Time.deltaTime * 4f);
     FadeToBlackManager.UpdateImageAlpha();
 }