Пример #1
0
        public ScreenWipe(UnityEngine.GameObject target,
                          Texture2D maskTexture,
                          bool invertMask   = false,
                          Color?color       = null,
                          Texture2D texture = null,
                          float softness    = 0,
                          float delay       = 0,
                          float duration    = 0.5f,
                          TransitionHelper.TweenType tweenType = TransitionHelper.TweenType.linear,
                          AnimationCurve animationCurve        = null,
                          Action onStart          = null,
                          Action <float> onUpdate = null,
                          Action onComplete       = null) :
            base(target, delay: delay, duration: duration, tweenType: tweenType,
                 animationCurve: animationCurve, onStart: onStart, onUpdate: onUpdate, onComplete: onComplete)
        {
            Assert.IsTrue(softness >= 0 && softness <= 1, "Softness must be between 0 and 1");

            _screenWipeComponents = new ScreenWipeComponents {
                PersistantAcrossScenes = true
            };

            MaskTexture = maskTexture;
            InvertMask  = invertMask;
            Color       = color.HasValue ? color.Value : Color.white;
            Texture     = texture;
            Softness    = softness;
        }
Пример #2
0
 ///
 /// Called on first access to the singleon
 ///
 void Setup()
 {
     SharedScreenWipeComponents = new ScreenWipeComponents();
     SharedScreenFadeComponents = new ScreenFadeComponents();
 }