Пример #1
0
        public void OpenClipsTransitionsModal(MVideoClip clip, MTransition transition)
        {
            var modalContent = this.ShowModalWindow("Transition");

            // Create a new field and assign it its value.
            var TypeField = new EnumField("Type:", transition.Type);

            modalContent.Add(TypeField);

            var durationField = new FloatField("Duration:");

            durationField.value = transition.duration;

            modalContent.Add(durationField);

            TypeField.RegisterCallback <ChangeEvent <System.Enum> >((evt) =>
            {
                transition.Type = (MTransition.TransitionType)evt.newValue;
            });

            durationField.RegisterCallback <ChangeEvent <float> >((evt) =>
            {
                transition.duration = evt.newValue;
            });
        }
Пример #2
0
        public void ManagedUpdate()
        {
            if (this.mTransition == null)
            {
                return;
            }

            if (this.mTransition.Type == MTransition.TransitionType.dipToBlack || this.mTransition.Type == MTransition.TransitionType.dipToWhite)
            {
                var value = this.currentTime / this.mTransition.duration;
                if (value <= 1)
                {
                    if (this.mTransition.isLeftTransition)
                    {
                        value = 1 - value;
                    }

                    var color = this.getColor();

                    this.transitionColorMaterial.SetColor("_Color", new Color(
                                                              color.r,
                                                              color.g,
                                                              color.b,
                                                              value));
                }
                else
                {
                    this.isPlaying   = false;
                    this.mTransition = null;
                    //this.ResetAll();
                    StartCoroutine(DelayedReset());
                }
                this.currentTime += Time.deltaTime;
            }
        }
        public void FireTransition()
        {
            MTransition mTransition = new MTransition("Игорь");

            mTransition.isEnable = true;
            bool        expected = true;
            CTransition c        = new CTransition();
            bool        actual   = c.fireTransition(mTransition);

            Assert.AreEqual(expected, actual);
        }
        public void AddArc()
        {
            MTransition mTransition = new MTransition("Игорь");
            MPlace      mPlace      = new MPlace("Олег");
            MArc        arc         = new MArc(mPlace, mTransition, true);
            bool        expected    = true;
            CTransition c           = new CTransition();
            bool        actual      = c.addArc(mTransition, arc);

            Assert.AreEqual(expected, actual);
        }
        public void RemoveLink()
        {
            MTransition mTransition = new MTransition("Игорь");
            MPlace      mPlace      = new MPlace("Олег");
            MArc        arc         = new MArc(mPlace, mTransition, true);
            bool        expected    = true;
            CTransition c           = new CTransition();
            List <MArc> arcs        = new List <MArc>();

            arcs.Add(arc);
            bool actual = c.removeLink(arc, arcs);

            Assert.AreEqual(expected, actual);
        }
Пример #6
0
        public void PlayTransition(MVideoClip clip, int clipIndex, MTransition transition)
        {
            if (transition.Type == MTransition.TransitionType.dipToBlack || transition.Type == MTransition.TransitionType.dipToWhite)
            {
                this.currentTime = 0;
                this.isPlaying   = true;
                this.mTransition = transition;
                if (this.mTransition.isLeftTransition)
                {
                    var color = this.getColor();

                    this.transitionColorMaterial.SetColor("_Color", new Color(
                                                              color.r,
                                                              color.g,
                                                              color.b,
                                                              1));
                }
            }
            else
            {
                this.ResetAll();
            }
        }