Beispiel #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,
                          TimeUpdateMethodType timeUpdateMethod = TimeUpdateMethodType.GameTime,
                          TransitionHelper.TweenType tweenType  = TransitionHelper.TweenType.linear,
                          AnimationCurve animationCurve         = null,
                          Action <TransitionStep> onStart       = null,
                          Action <TransitionStep> onUpdate      = null,
                          Action <TransitionStep> onComplete    = null) :
            base(target, delay: delay, duration: duration, timeUpdateMethod: timeUpdateMethod, 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;
        }
Beispiel #2
0
 ///
 /// Called on first access to the singleon
 ///
 void Setup()
 {
     SharedScreenWipeComponents = new ScreenWipeComponents();
     SharedScreenFadeComponents = new ScreenFadeComponents();
 }