Exemplo n.º 1
0
 public void PlayForward(TransitionStyle transitionStyle = TransitionStyle.Default)
 {
     DetermineTransitionTexture(transitionStyle);
     tweenScale.enabled = true;
     tweenScale.PlayForward();
     state = State.Forward;
 }
Exemplo n.º 2
0
        public static bool IsAvailable(this TransitionStyle style, DeviceProfile profile)
        {
            if (!style.IsValid())
            {
                return(false);
            }

            switch (style)
            {
            case TransitionStyle.Mix:
                return(true);

            case TransitionStyle.Dip:
                return(true);

            case TransitionStyle.Wipe:
                return(true);

            case TransitionStyle.DVE:
                return(profile.DVE > 0);

            case TransitionStyle.Stinger:
                return(profile.Stingers > 0);

            default:
                throw new ArgumentOutOfRangeException(nameof(style), style, null);
            }
        }
 public Config()
 {
     RegistryKey reg = Registry.CurrentUser.OpenSubKey(KEY);
     if (reg == null)
         return;
     xCount = (int)reg.GetValue("xCount", xCount);
     longInterval = (int)reg.GetValue("longInterval", longInterval);
     shortInterval = (int)reg.GetValue("shortInterval", shortInterval);
     isEnabledFileImageSource = (int)reg.GetValue("isEnabledFileImageSource", Convert.ToInt32(isEnabledFileImageSource)) == 1;
     fileImageSourcePath = (string)reg.GetValue("fileImageSourcePath", fileImageSourcePath);
     isEnabledFlickrImageSource = (int)reg.GetValue("isEnabledFlickrImageSource", Convert.ToInt32( isEnabledFlickrImageSource)) == 1;
     flickrImageSourceTags = (string)reg.GetValue("flickrImageSourceTags", flickrImageSourceTags);
     isFlickrImageSourceTagAndLogic = (int)reg.GetValue("isFlickrImageSourceTagAndLogic", isFlickrImageSourceTagAndLogic) == 1;
     flickrImageSourceUserName = (string)reg.GetValue("flickrImageSourceUserName", flickrImageSourceUserName);
     flickrImageSourceText = (string)reg.GetValue("flickrImageSourceText", flickrImageSourceText);
     backgroundstyle = (BackGroundStyle)Enum.Parse(typeof(BackGroundStyle), (string)reg.GetValue("backgroundstyle", Enum.GetName(typeof(BackGroundStyle), backgroundstyle)));
     imagestyle = (ImageStyle)Enum.Parse(typeof(ImageStyle), (string)reg.GetValue("imagestyle", Enum.GetName(typeof(ImageStyle), imagestyle)));
     transitionin = (TransitionStyle)Enum.Parse(typeof(TransitionStyle), (string)reg.GetValue("transitionin", Enum.GetName(typeof(TransitionStyle), transitionin)));
     transitionout = (TransitionStyle)Enum.Parse(typeof(TransitionStyle), (string)reg.GetValue("transitionout", Enum.GetName(typeof(TransitionStyle), transitionout)));
     //theme = (Theme)Enum.Parse(typeof(Theme), (string)reg.GetValue("theme", Enum.GetName(typeof(Theme), theme)));
     comicstyle = (Comicstyle)Enum.Parse(typeof(Comicstyle), (string)reg.GetValue("comicstyle", Enum.GetName(typeof(Comicstyle), comicstyle)));
     isLoggingEnabled = (int)reg.GetValue("isLoggingEnabled", Convert.ToInt32(isLoggingEnabled)) == 1;
     filesearchfilter = (string)reg.GetValue("filesearchfilter", filesearchfilter);
     enablefilesearchfilter = (int)reg.GetValue("enablefilesearchfilter", Convert.ToInt32(enablefilesearchfilter)) == 1;
     reg.Close();
 }
Exemplo n.º 4
0
 public void PlayReverse(TransitionStyle transitionStyle = TransitionStyle.Default)
 {
     DetermineTransitionTexture(transitionStyle);
     tweenScale.enabled = true;
     tweenScale.PlayReverse();
     state = State.Reverse;
 }
Exemplo n.º 5
0
        public void Remove(Control control, TransitionStyle transition = TransitionStyle.NOFADE)
        {
            // If there is nothing, do nothing
            if (!Screens.Contains(control))
            {
                return;
            }

            // Peek the foremost control
            Control foremost = Screens.Peek();

            // if this is the topmost element, perform a Pop instead
            if (foremost == control)
            {
                Pop(transition);
                return;
            }

            this.SuspendDrawing();
            FadeOut(transition, () =>
            {
                this.SuspendDrawing();
                RemoveInner(control);
                FadeIn(transition, Current, null);
                this.ResumeDrawing();
            });
            this.ResumeDrawing();
        }
        public void TestNextStyle()
        {
            bool tested  = false;
            var  handler = CommandGenerator.CreateAutoCommandHandler <TransitionPropertiesSetCommand, TransitionPropertiesGetCommand>("NextStyle");

            AtemMockServerWrapper.Each(Output, Pool, handler, DeviceTestCases.All, helper =>
            {
                EachMixEffect <IBMDSwitcherTransitionParameters>(helper, (stateBefore, meBefore, sdk, meId, i) =>
                {
                    tested = true;

                    var omitStyles = new List <TransitionStyle>();
                    if (stateBefore.Info.DVE == null)
                    {
                        omitStyles.Add(TransitionStyle.DVE);
                    }
                    if (stateBefore.MediaPool.Clips.Count == 0)
                    {
                        omitStyles.Add(TransitionStyle.Stinger);
                    }

                    TransitionStyle target = Randomiser.EnumValue(omitStyles.ToArray());
                    _BMDSwitcherTransitionStyle target2      = AtemEnumMaps.TransitionStyleMap[target];
                    meBefore.Transition.Properties.NextStyle = target;
                    helper.SendAndWaitForChange(stateBefore, () => { sdk.SetNextTransitionStyle(target2); });
                });
            });
            Assert.True(tested);
        }
        public void TestGetStyle()
        {
            bool tested = false;

            AtemMockServerWrapper.Each(Output, Pool, null, DeviceTestCases.All, helper =>
            {
                EachMixEffect <IBMDSwitcherTransitionParameters>(helper, (stateBefore, meBefore, sdk, meId, i) =>
                {
                    tested = true;

                    TransitionStyle target = Randomiser.EnumValue <TransitionStyle>();
                    meBefore.Transition.Properties.Style = target;
                    helper.SendAndWaitForChange(stateBefore, () => {
                        helper.Server.SendCommands(new TransitionPropertiesGetCommand
                        {
                            Index         = meId,
                            NextStyle     = meBefore.Transition.Properties.NextStyle,
                            Style         = target,
                            NextSelection = meBefore.Transition.Properties.NextSelection,
                            Selection     = meBefore.Transition.Properties.Selection,
                        });
                    });
                });
            });
            Assert.True(tested);
        }
 public TransitionDetails(
     ITransitionDetails transitionDetails
     ) : base(transitionDetails)
 {
     m_TransitionOnWake       = transitionDetails.TransitionOnWake;
     m_TransitionStyle        = transitionDetails.TransitionStyle;
     m_TransitionLoop         = transitionDetails.TransitionLoop;
     m_VisibleAfterTransition = transitionDetails.VisibleAfterTransition;
 }
Exemplo n.º 9
0
 void UpdateTransitionStyle(TransitionStyle style, float value)
 {
     if (style == TransitionStyle.Fade)
     {
         renderer.Color = new Color(1, 1, 1, value);
     }
     else if (style == TransitionStyle.Grow)
     {
         transform.localScale = new Vector3(value * maxScale.x, value * maxScale.y);
     }
 }
Exemplo n.º 10
0
 public void Push(Control control, TransitionStyle transition = TransitionStyle.NOFADE)
 {
     this.SuspendDrawing();
     FadeOut(transition, () =>
     {
         this.SuspendDrawing();
         PushInner(control);
         FadeIn(transition, control, null);
         this.ResumeDrawing();
     });
     this.ResumeDrawing();
 }
 public TransitionDetails(
     ITransitionDetailsBase transitionDetailsBase,
     bool transitionOnWake,
     TransitionStyle transitionStyle,
     bool transitionLoop,
     bool visibleAfterTransition
     ) : base(transitionDetailsBase)
 {
     m_TransitionOnWake       = transitionOnWake;
     m_TransitionStyle        = transitionStyle;
     m_TransitionLoop         = transitionLoop;
     m_VisibleAfterTransition = visibleAfterTransition;
 }
Exemplo n.º 12
0
        private AnimatorBase GetForwardOutAnimator(TransitionStyle style)
        {
            switch (style)
            {
            case TransitionStyle.Turnstile:
                return(new TurnstileForwardOutAnimator());

            case TransitionStyle.Slide:
                return(new SlideDownAnimator());

            default:
                throw new ArgumentOutOfRangeException("style");
            }
        }
 public TransitionDetailsExtended(
     ITransitionDetailsBase transitionDetailsBase,
     bool transitionOnWake,
     TransitionStyle transitionStyle,
     bool transitionLoop,
     bool visibleAfterTransition
     ) : base(
         transitionDetailsBase,
         transitionOnWake,
         transitionStyle,
         transitionLoop,
         visibleAfterTransition
         )
 {
 }
 public TransitionDetails(
     AnimationCurve interpolation,
     float transitionDuration,
     CanvasGroup transitionOverlay,
     ITransitionElement transitionElementChild,
     bool transitionOnWake,
     TransitionStyle transitionStyle,
     bool transitionLoop,
     bool visibleAfterTransition
     ) : base(interpolation, transitionDuration, transitionOverlay, transitionElementChild)
 {
     m_TransitionOnWake       = transitionOnWake;
     m_TransitionStyle        = transitionStyle;
     m_TransitionLoop         = transitionLoop;
     m_VisibleAfterTransition = visibleAfterTransition;
 }
Exemplo n.º 15
0
    private void ApplyTransitionStyle(TransitionStyle style, float attrStartValue)
    {
        currentStyle = style;

        Material mat = transitionScreen.GetComponent <MeshRenderer>().material;
        TransitionTexturePreset texturePreset = presets[(int)style];

        mat.SetTexture("_PatternTex", texturePreset.texture);
        mat.SetTextureScale("_PatternTex", texturePreset.scale);
        mat.SetTextureOffset("_PatternTex", texturePreset.offset);
        mat.SetColor("_Color", texturePreset.color);

        mat.SetFloat("_Progress", 1);
        mat.SetFloat("_Alpha", 1);
        mat.SetFloat(presets[(int)style].attrName, attrStartValue);
    }
Exemplo n.º 16
0
    private void DetermineTransitionTexture(TransitionStyle transitionStyle)
    {
        switch (transitionStyle)
        {
        case TransitionStyle.Default:
            guiTexture.texture = defaultTransition;
            break;

        case TransitionStyle.Death:
            guiTexture.texture = deathTransition;
            break;

        case TransitionStyle.LevelFinish:
            guiTexture.texture = levelFinishTransition;
            break;
        }
    }
Exemplo n.º 17
0
 public void SwitchCamera(TransitionStyle style, bool doNotActuallySwitch = false)
 {
     if (!doNotActuallySwitch)
     {
         var tmpTex = texA;
         texA = texB;
         texB = tmpTex;
         var tmpCam = CamA;
         CamA = CamB;
         CamB = tmpCam;
     }
     BlendProcess    = 1 - BlendProcess;
     transitionStyle = style;
     triggered       = false;
     initializeMaterials();
     tweenMat.SetFloat("_Tweener", BlendProcess);
 }
Exemplo n.º 18
0
        public void Pop(TransitionStyle transition = TransitionStyle.NOFADE)
        {
            // If there is nothing, do nothing
            if (Screens.Count == 0)
            {
                return;
            }

            this.SuspendDrawing();
            FadeOut(transition, () =>
            {
                this.SuspendDrawing();
                PopInner();
                FadeIn(transition, Current, null);
                this.ResumeDrawing();
            });
            this.ResumeDrawing();
        }
Exemplo n.º 19
0
 void Awake()
 {
     // SpreadCenterInverseShader = Shader.Find("Hidden/ScannerActiveCamInverse");
     if (ReadFromPref)
     {
         string t = PlayerPrefs.GetString("GS2Trans", "none");
         if (t != "none")
         {
             transitionStyle = (TransitionStyle)System.Enum.Parse(typeof(TransitionStyle), t);
         }
     }
     brain             = GetComponent <Camera>();
     brain.cullingMask = 0;
     brain.clearFlags  = CameraClearFlags.Nothing;
     texA = SetBlendCamera(CamA);
     texB = SetBlendCamera(CamB);
     initializeMaterials();
 }
Exemplo n.º 20
0
        protected AnimatorBase GetAnimation(TransitionDirection animationType, TransitionStyle style)
        {
            switch (animationType)
            {
            case TransitionDirection.BackwardIn:
                return(this.GetBackwardInAnimator(style));

            case TransitionDirection.BackwardOut:
                return(this.GetBackwardOutAnimator(style));

            case TransitionDirection.ForwardIn:
                return(this.GetForwardInAnimator(style));

            case TransitionDirection.ForwardOut:
                return(this.GetForwardOutAnimator(style));

            default:
                throw new ArgumentOutOfRangeException("animationType");
            }
        }
Exemplo n.º 21
0
    public void FadeOutOfLoadingScreen(TransitionStyle style)
    {
        if (isTransiting)
        {
            //Debug.Log("Fade out");
            //GenerateTransitionScreen();
            ApplyTransitionStyle(style, 1);

            Services.taskManager.Do(new TimedTransitionMaterialTask(loadingBarUp, transitionCamera, "_Alpha", DataSet.magicNumber, 0, presets[(int)style].duration, false));
            Services.taskManager.Do(new TimedTransitionMaterialTask(loadingBarDown, transitionCamera, "_Alpha", DataSet.magicNumber, 0, presets[(int)style].duration, false));
            Services.taskManager.Do(new TimedTransitionMaterialTask(transitionScreen, transitionCamera, presets[(int)style].attrName, 1, 0, presets[(int)style].duration, true))
            .Then(new ActionTask(() => SetTransition(false)));
            //.Then(new ActionTask(Services.sceneController.LoadingEnded));

            float halfHeight    = transitionCamera.orthographicSize;
            float halfBarHeight = halfHeight / 10;
            Services.dotweenEvents.MoveTo("LoadingBarUp y " + (halfHeight + halfBarHeight).ToString() + " " + (presets[(int)style].duration).ToString());
            Services.dotweenEvents.MoveTo("LoadingBarDown y " + (-halfHeight - halfBarHeight).ToString() + " " + (presets[(int)style].duration).ToString());
        }
    }
Exemplo n.º 22
0
    public void FadeIntoLoadingScreen(TransitionStyle style)
    {
        if (transitionScreen)
        {
            if (!isTransiting)
            {
                SetTransition(true);

                ApplyTransitionStyle(style, 0);

                Services.taskManager.Do(new TimedTransitionMaterialTask(transitionScreen, transitionCamera, presets[(int)style].attrName, 0, 1, presets[(int)style].duration, false));
                Services.taskManager.Do(new TimedTransitionMaterialTask(loadingBarUp, transitionCamera, "_Alpha", 0, 1, presets[(int)style].duration, false));
                Services.taskManager.Do(new TimedTransitionMaterialTask(loadingBarDown, transitionCamera, "_Alpha", 0, 1, presets[(int)style].duration, false));

                float halfHeight    = transitionCamera.orthographicSize;
                float halfBarHeight = halfHeight / 10;
                Services.dotweenEvents.MoveTo("LoadingBarUp y " + (halfHeight - halfBarHeight).ToString() + " " + (presets[(int)style].duration).ToString());
                Services.dotweenEvents.MoveTo("LoadingBarDown y " + (-halfHeight + halfBarHeight).ToString() + " " + (presets[(int)style].duration).ToString());
            }
        }
    }
Exemplo n.º 23
0
        public void FadeIn(TransitionStyle transition, Control control, Action next)
        {
            if (transition == TransitionStyle.NOFADE || ClientRectangle.IsEmpty)
            {
                next?.Invoke();
                return;
            }
            else
            {
                fadePanel.CaptureForeground(control ?? this);
                fadePanel.BringToFront();
                fadePanel.FadeFinished = () => next?.Invoke();
                switch (transition)
                {
                case TransitionStyle.FADE_BLACK:
                    fadePanel.SetFade(Globals.MENU_FADE_FRAMES, FadeStyle.FADEIN_FROM_BLACK);
                    break;

                case TransitionStyle.FADE_TWEEN:
                    fadePanel.SetFade(Globals.MENU_FADE_FRAMES, FadeStyle.FADEIN_FROM_BACKGROUND);
                    break;
                }
            }
        }
Exemplo n.º 24
0
        public void FadeOut(TransitionStyle transition, Action next)
        {
            if (transition == TransitionStyle.NOFADE || ClientRectangle.IsEmpty)
            {
                next?.Invoke();
                return;
            }
            else
            {
                fadePanel.CaptureBackground(this);
                switch (transition)
                {
                case TransitionStyle.FADE_BLACK:
                    fadePanel.BringToFront();
                    fadePanel.FadeFinished = () => next?.Invoke();
                    fadePanel.SetFade(Globals.MENU_FADE_FRAMES, FadeStyle.FADEOUT_TO_BLACK);
                    break;

                case TransitionStyle.FADE_TWEEN:
                    next?.Invoke();
                    return;
                }
            }
        }
 public void SetTransitionStyle(TransitionStyle value)
 {
     m_TransitionStyle = value;
 }
Exemplo n.º 26
0
 public Cuts(TransitionStyle style)
 {
     this.Style = style;
 }
Exemplo n.º 27
0
 public MenuTransition(TransitionStyle style, Menu targetMenu)
 {
     tStyle = style;
     mMenu = targetMenu;
 }
Exemplo n.º 28
0
        //Title, Body Text, Buttons, Animation, Animation's duration, Buttons' actions
        public static void LoadAlert(string titleLabel, string bodyText, string[] buttonTexts, TransitionStyle transitionStyle, float duration, Action <int, string> buttonClicked)
        {
            GameObject alertCanvas = Instantiate(Resources.Load("GOAlert/AlertCanvas") as GameObject);
            GOAlert    alert       = alertCanvas.GetComponent <GOAlert>();

            alert.titleLabel.text = titleLabel;
            alert.bodyText.text   = bodyText;
            alert.buttonTexts     = buttonTexts;
            alert.buttonClicked   = buttonClicked;
            alert.duration        = duration;
            alert.CreateButtons();
            alert.transitionStyle = transitionStyle;
            RectTransform bannerRect = alert.alertPanel.GetComponent <RectTransform>();

            switch (transitionStyle)
            {
            case TransitionStyle.BottomToBottom:
                alert.destinationPosition   = new Vector2(bannerRect.anchoredPosition.x, -Screen.height);
                bannerRect.anchoredPosition = new Vector2(bannerRect.anchoredPosition.x, -Screen.height);
                break;

            case TransitionStyle.BottomToTop:
                alert.destinationPosition   = new Vector2(bannerRect.anchoredPosition.x, Screen.height);
                bannerRect.anchoredPosition = new Vector2(bannerRect.anchoredPosition.x, -Screen.height);
                break;

            case TransitionStyle.TopToBottom:
                alert.destinationPosition   = new Vector2(bannerRect.anchoredPosition.x, -Screen.height);
                bannerRect.anchoredPosition = new Vector2(bannerRect.anchoredPosition.x, Screen.height);
                break;

            case TransitionStyle.TopToTop:
                alert.destinationPosition   = new Vector2(bannerRect.anchoredPosition.x, Screen.height);
                bannerRect.anchoredPosition = new Vector2(bannerRect.anchoredPosition.x, Screen.height);
                break;

            case TransitionStyle.Fade:
                break;

            default:
                break;
            }
        }