Exemplo n.º 1
0
        public override IEnumerator RestartSequence()
        {
            MansfeldCharacter.SetAnimationBool(AnimationSequence.animationName);
            yield return(new WaitForSeconds(_duration));

            DynamicAnimation.OnAnimationFinishedPlaying();
        }
Exemplo n.º 2
0
        public override IEnumerator RestartSequence()
        {
            MansfeldCharacter.SetPosition(_oldPosition);
            _elapsedTime = 0f;

            var startingPosition = MansfeldCharacter.GetPosition();

            MansfeldCharacter.SetAnimationFloat(AnimationSequence.animationName, 1);

            yield return(new WaitUntil(() =>
            {
                //Return if elapsed time has reached its completion time.
                if (_elapsedTime >= _duration)
                {
                    return true;
                }

                //Calculate the distance traveled by the elapsed time.
                var newDistance = Mathf.InverseLerp(0, _duration, _elapsedTime) * _distance;

                //Calculate the position from the starting position and the forward direction multiplied by the distance.
                var newPosition = startingPosition + MansfeldCharacter.GetForwardVector() * newDistance;

                //Set the new position.
                MansfeldCharacter.SetPosition(newPosition);

                //Increment the elapsed time.
                _elapsedTime += Time.deltaTime;

                return false;
            }));

            MansfeldCharacter.SetAnimationFloat(AnimationSequence.animationName, 0);
            DynamicAnimation.OnAnimationFinishedPlaying();
        }
Exemplo n.º 3
0
        public Playground()
        {
            MeasureStartup();

            this.InitializeComponent();

            Loaded += Playground_Loaded;

            xamlText.TextChanged        += OnTextChanged;
            jsonDataContext.TextChanged += OnDataContextTextChanged;

            content.SizeChanged += (snd, args) =>
            {
                resolution.Text = $"{content.ActualWidth}x{content.ActualHeight}";
            };

            var abc = DynamicAnimation.StoryboardProperty.ToString();

            DynamicAnimation.GetStoryboard(this);
            DynamicAnimation.SetStoryboard(this, null);

            SizeChanged += (snd, e) => RestoreCodePaneSize(e.PreviousSize, e.NewSize);
#if __WASM__
            Uno.Foundation.WebAssemblyRuntime.InvokeJS("Uno.UI.WindowManager.current.setStyle(\"" + splitter.HtmlId + "\", {\"cursor\": \"col-resize\"});");
#endif
            InputPane.GetForCurrentView().Showing += OnInputPaneShowing;
            InputPane.GetForCurrentView().Hiding  += OnInputPaneHiding;;
        }
Exemplo n.º 4
0
        public override IEnumerator PlaySequence()
        {
            MansfeldCharacter.chair.SetActive(true);
            MansfeldCharacter.SetAnimationBool(AnimationSequence.animationName);
            yield return(new WaitForSeconds(_duration));

            MansfeldCharacter.chair.SetActive(false);
            DynamicAnimation.OnAnimationFinishedPlaying();
        }
Exemplo n.º 5
0
        public override IEnumerator RestartSequence()
        {
            _elapsedTime = 0;
            DynamicAnimation.MansfeldCharacter.SetAnimationBool(AnimationSequence.animationName);

            yield return(new WaitUntil(() =>
            {
                _elapsedTime += Time.deltaTime;
                return _elapsedTime >= _duration;
            }));

            DynamicAnimation.OnAnimationFinishedPlaying();
        }
Exemplo n.º 6
0
        public override IEnumerator PlaySequence()
        {
            DynamicAnimation.SpawnMansfeld(_offset, new Vector3(0, _rotation, 0));
            MansfeldCharacter = DynamicAnimation.MansfeldCharacter;

            _elapsedTime = 0;
            MansfeldCharacter.SetAnimationBool(AnimationSequence.animationName);

            yield return(new WaitUntil(() =>
            {
                _elapsedTime += Time.deltaTime;
                return _elapsedTime >= _duration;
            }));

            DynamicAnimation.OnAnimationFinishedPlaying();
        }
Exemplo n.º 7
0
        public override IEnumerator PlaySequence()
        {
            MansfeldCharacter.bed.SetActive(true);
            yield return(new WaitUntil(() =>
            {
                //Return if elapsed time has reached its completion time.
                if (_elapsedTime >= _duration)
                {
                    return true;
                }

                MansfeldCharacter.SetAnimationBool(AnimationSequence.animationName);
                return false;
            }));

            MansfeldCharacter.bed.SetActive(false);
            DynamicAnimation.OnAnimationFinishedPlaying();
        }
Exemplo n.º 8
0
        public override IEnumerator RestartSequence()
        {
            MansfeldCharacter.SetRotation(new Vector3(0, _oldRotation, 0));
            _elapsedTime = 0f;

            var yStartingRotation = MansfeldCharacter.GetRotation().y;

            yield return(new WaitUntil(() =>
            {
                var percentage = Mathf.InverseLerp(0, _duration, _elapsedTime);
                var newRotation = percentage * _rotationAmount;
                MansfeldCharacter.SetRotation(new Vector3(0, yStartingRotation + newRotation, 0));
                _elapsedTime += Time.deltaTime;
                return _elapsedTime >= _duration;
            }));

            DynamicAnimation.OnAnimationFinishedPlaying();
        }
Exemplo n.º 9
0
        public Playground()
        {
            MeasureStartup();

            this.InitializeComponent();

            Loaded += Playground_Loaded;

#if MONACO
            xamlText.PropertyChanged += OnPropertyChanged;
            xamlText.Loaded          += OnEditorLoaded;
            xamlText.Loading         += OnEditorLoading;
            xamlText.RequestedTheme   = ElementTheme.Dark;

            xamlText.SizeChanged += (snd, evt) =>
            {
                xamlText.ExecuteJavascript("if(typeof editor !== 'undefined') editor.layout();");
            };
#else
            xamlText.TextChanged += OnTextChanged;
#endif

#if __WASM__
            splitter.SetCssClass("resizeHandle");
#endif

            jsonDataContext.TextChanged += OnDataContextTextChanged;

            content.SizeChanged += (snd, args) =>
            {
                resolution.Text = $"{content.ActualWidth}x{content.ActualHeight}";
            };

            var abc = DynamicAnimation.StoryboardProperty.ToString();
            DynamicAnimation.GetStoryboard(this);
            DynamicAnimation.SetStoryboard(this, null);

            SizeChanged += (snd, e) => RestoreCodePaneSize(e.PreviousSize, e.NewSize);
#if false // __WASM__
            Uno.Foundation.WebAssemblyRuntime.InvokeJS("Uno.UI.WindowManager.current.setStyle(\"" + splitter.HtmlId + "\", {\"cursor\": \"col-resize\"});");
#endif
            InputPane.GetForCurrentView().Showing += OnInputPaneShowing;
            InputPane.GetForCurrentView().Hiding  += OnInputPaneHiding;;
        }
Exemplo n.º 10
0
 public LayMechanic(DynamicAnimation dynamicAnimation) : base(dynamicAnimation)
 {
 }
Exemplo n.º 11
0
 public TalkMechanic(DynamicAnimation dynamicAnimation) : base(dynamicAnimation)
 {
 }
Exemplo n.º 12
0
 public override void FastForwardSequence()
 {
     DynamicAnimation.OnAnimationFinishedPlaying();
 }
Exemplo n.º 13
0
 public RotateMechanic(DynamicAnimation dynamicAnimation) : base(dynamicAnimation)
 {
 }
Exemplo n.º 14
0
 public override void FastForwardSequence()
 {
     MansfeldCharacter.SetPosition(_oldPosition + MansfeldCharacter.transform.forward * _distance);
     MansfeldCharacter.SetAnimationFloat(AnimationSequence.animationName, 0);
     DynamicAnimation.OnAnimationFinishedPlaying();
 }
Exemplo n.º 15
0
 public override void FastForwardSequence()
 {
     MansfeldCharacter.bed.SetActive(false);
     DynamicAnimation.OnAnimationFinishedPlaying();
 }
Exemplo n.º 16
0
 public override void FastForwardSequence()
 {
     MansfeldCharacter.SetRotation(new Vector3(0, _oldRotation, 0));
     MansfeldCharacter.SetRotation(new Vector3(0, MansfeldCharacter.GetRotation().y + _rotationAmount, 0));
     DynamicAnimation.OnAnimationFinishedPlaying();
 }
Exemplo n.º 17
0
 public SpawnMechanic(DynamicAnimation dynamicAnimation) : base(dynamicAnimation)
 {
 }