Esempio n. 1
0
        public HeightMapRenderer(HeightMapMesh heightMap, AnimationUtilities.SkinnedEffect effect)
        {
            mMesh = heightMap;
            mEffect = effect;

            mUIConfigurer = null;
        }
Esempio n. 2
0
    public void Switch(int destination)
    {
        switch (destination)
        {
        case 0:
            this.destination = main;
            break;

        case 1:
            this.destination = settings;
            break;

        case 2:
            this.destination = credits;
            break;
        }

        //current pos - destination pos bc these positions are inside the rect transform
        //that we actually intend on moving, so they must go the opposite direction
        containerPathVector     = currentMenuTransform.anchoredPosition - this.destination.GetComponent <RectTransform>().anchoredPosition;
        containerSourcePosition = rt.anchoredPosition;
        StartCoroutine(AnimationUtilities.MoveUI(rt, containerSourcePosition, containerPathVector, menuSwitchCurve, duration, false));
        currentMenuTransform = this.destination.GetComponent <RectTransform>();
        dest = destination;
    }
Esempio n. 3
0
    IEnumerator MoveMissionPanel(Vector2 delta, float inTime, float holdTime, float outTime)
    {
        Vector2 deltaOffset = missionPanel.anchoredPosition - missionPanelStartPosition;
        Vector2 newDelta    = delta - deltaOffset;

        float newInTime = (newDelta.magnitude / delta.magnitude) * inTime;

        Debug.Log("deltaOffset: " + deltaOffset + " newDelta: " + newDelta + " newInTime: " + newInTime);
        IEnumerator showPanel = AnimationUtilities.MoveUI(missionPanel, newDelta, UISlideIn, newInTime);
        IEnumerator hidePanel = AnimationUtilities.MoveUI(missionPanel, -delta, UISlideIn, outTime);

        missionPanelCoroutines.Add(showPanel);

        //show panel
        yield return(StartCoroutine(showPanel));

        missionPanel.anchoredPosition = missionPanelStartPosition + delta;
        StartCoroutine(AnimationUtilities.ScaleWobble(missionPanel, new Vector2(-.01f, .02f), UIWobble, holdTime / 2));


        //hold panel
        yield return(new WaitForSeconds(holdTime));

        missionPanelCoroutines.Add(hidePanel);
        //hide panel
        yield return(StartCoroutine(hidePanel));

        missionPanel.anchoredPosition = missionPanelStartPosition;
    }
Esempio n. 4
0
 public void RunIntroAnimations()
 {
     if (!_appeared)
     {
         AnimationUtilities.FeatherIn(_title1, _body1, _title2, _body2);
         _appeared = true;
     }
 }
Esempio n. 5
0
        public ContactView()
        {
            BindingContext = new ContactViewModel();
            InitializeComponent();

            AnimationUtilities.InitializeAppear(_twitterWhiteLogo, _twitterText,
                                                _linkedinWhiteLogo, _linkedinText, _emailLogo, _emailText, _githubLogo, _githubText);
        }
        private void AnimateHeight(double containerHeight, DependencyObject target)
        {
            var heightStoryBoard = new Storyboard();
            var heightAnimation  = AnimationUtilities.PrepareAnimation(0, containerHeight, target, HeightProperty, 0.3f);

            //var widthAnimation = AnimationUtilities.PrepareAnimation(10, containerWidth, target, WidthProperty, 1);
            heightStoryBoard.Children.Add(heightAnimation);
            heightStoryBoard.Begin();
        }
Esempio n. 7
0
 public void RunIntroAnimations()
 {
     if (!_appeared)
     {
         AnimationUtilities.FeatherIn(_twitterWhiteLogo, _twitterText,
                                      _linkedinWhiteLogo, _linkedinText, _emailLogo, _emailText, _githubLogo, _githubText);
         _appeared = true;
     }
 }
Esempio n. 8
0
 public GridRenderer(HeightMapMesh heightMap, AnimationUtilities.SkinnedEffect effect)
     : base(heightMap, effect)
 {
     mNormalDepthConfigurer = null;
     mPickingConfigurer = null;
     mShadowMapConfigurer = null;
     mUIConfigurer = null;
     mWithoutShadowsConfigurer = null;
     mWithShadowsConfigurer = null;
 }
Esempio n. 9
0
        public WaterRenderer(Vector2 resolution, AnimationUtilities.SkinnedEffect effect)
        {
            mEffect = effect;
            mResolution = resolution;

            ResizeVertices();
            ResizeIndices();
            FillBuffers();

            mUIConfigurer = null;
        }
Esempio n. 10
0
        public async void RunIntroAnimations()
        {
            if (!appeared)
            {
                AnimationUtilities.FeatherIn(_nameLabel, _bodyLabel, _hireButton);
                await Task.Delay(1000);

                AnimationUtilities.RollIn(_bryanImage);
                appeared = true;
            }
        }
Esempio n. 11
0
        public SkyBoxRenderer(AnimationUtilities.SkinnedEffect effect)
        {
            mEffect = effect;

            CreateBuffers();

            mNormalDepthConfigurer = null;
            mShadowMapConfigurer = null;
            mPickingConfigurer = null;
            mUIConfigurer = null;
            mOverlayConfigurer = null;
        }
Esempio n. 12
0
        protected override void NormalDepthConfigurer(AnimationUtilities.SkinnedEffect effect, RendererParameters instance, object[] optionalParameters)
        {
            base.NormalDepthConfigurer(effect, instance, optionalParameters);

            Matrix[] skinTransforms = new Matrix[] { Matrix.Identity };
            if (instance is AnimateModelParameters)
            {
                skinTransforms = ((instance as AnimateModelParameters).SkinTransforms);
            }
            effect.SetBoneTransforms(skinTransforms);

            effect.CurrentTechnique = effect.Techniques["SkinnedNormalDepthShade"];
        }
Esempio n. 13
0
        public HighlightsView()
        {
            BindingContext = new HighlightsViewModel();
            InitializeComponent();

            _scrollView.SetBinding(View.MarginProperty, new Binding("Height", source: _nameStack, converter: new ThicknessConverter(),
                                                                    converterParameter: 1, mode: BindingMode.OneWay));

            _highlightsStack.SetBinding(View.MarginProperty, new Binding("Height", source: _backgroundImage, converter: new ThicknessConverter(),
                                                                         converterParameter: 1, mode: BindingMode.OneWay));

            _nameStack.SetBinding(HeightRequestProperty, new Binding("Height", source: _resumeViewFAB));

            AnimationUtilities.InitializeAppear(_title1, _body1, _title2, _body2);
        }
        private void AddTeamControls(List <PlayerViewModel> team, Dictionary <Position, Panel> teamColumnPositions)
        {
            var random = new Random();

            var homeTeamControls = team.Select(p => new PlayerUserControl(p)).ToList();

            homeTeamControls.ForEach(c =>
            {
                c.Click += (sender, e) => ShowPlayerOverviewControl(c);
                teamColumnPositions[c.Player.Position].Children.Add(c);
                AnimationUtilities.AnimateProperty(0, 1, c, OpacityProperty, random.Next(1, 3));
            });

            LoadingScreen.Visibility = Visibility.Collapsed;
        }
Esempio n. 15
0
        public BioView()
        {
            BindingContext = new BioViewModel();
            InitializeComponent();

            AnimationUtilities.InitializeAppear(_nameLabel, _bodyLabel, _hireButton);
            AnimationUtilities.IniitializeRollIn(_bryanImage);

            _scrollView.SetBinding(View.MarginProperty, new Binding("Height", source: _nameStack, converter: new ThicknessConverter(),
                                                                    converterParameter: 1, mode: BindingMode.OneWay));

            _descriptionStack.SetBinding(View.MarginProperty, new Binding("Height", source: _backgroundImage, converter: new ThicknessConverter(),
                                                                          converterParameter: 1, mode: BindingMode.OneWay));

            _nameStack.SetBinding(HeightRequestProperty, new Binding("Height", source: _codeViewFAB));
        }
Esempio n. 16
0
 public void SetDefaultAnimation()
 {
     if (myAnimator != null)
     {
         if (DefaultAnimationActionPrefab != null)
         {
             CharAction defaultAnimationAction = Instantiate(DefaultAnimationActionPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as CharAction;
             defaultAnimationAction.transform.SetParent(transform, false);
             defaultAnimationAction.MyAnimator = myAnimator;
             defaultAnimationAction.MakeAction();
         }
         else
         {
             AnimationUtilities.SetTriggerIfExists("Idle", myAnimator);
         }
     }
 }
Esempio n. 17
0
        public ActionsManager(string varFilePath, WatchVariableFlowLayoutPanel variableTable, Control actionsControl)
            : base(varFilePath, variableTable)
        {
            textBoxActionDescription    = actionsControl.Controls["textBoxActionDescription"] as BetterTextbox;
            textBoxAnimationDescription = actionsControl.Controls["textBoxAnimationDescription"] as BetterTextbox;

            textBoxActionDescription.DoubleClick    += (sender, e) => SelectionForm.ShowActionDescriptionSelectionForm();
            textBoxAnimationDescription.DoubleClick += (sender, e) => SelectionForm.ShowAnimationDescriptionSelectionForm();

            ControlUtilities.AddContextMenuStripFunctions(
                textBoxActionDescription,
                new List <string>()
            {
                "Select Action", "Free Movement Action", "Open Action Form"
            },
                new List <Action>()
            {
                () => SelectionForm.ShowActionDescriptionSelectionForm(),
                () => Config.Stream.SetValue(MarioConfig.FreeMovementAction, MarioConfig.StructAddress + MarioConfig.ActionOffset),
                () => new ActionForm().Show(),
            });

            ControlUtilities.AddContextMenuStripFunctions(
                textBoxAnimationDescription,
                new List <string>()
            {
                "Select Animation", "Replace Animation"
            },
                new List <Action>()
            {
                () => SelectionForm.ShowAnimationDescriptionSelectionForm(),
                () =>
                {
                    int?animationToBeReplaced = SelectionForm.GetAnimation("Choose Animation to Be Replaced", "Select Animation");
                    int?animationToReplaceIt  = SelectionForm.GetAnimation("Choose Animation to Replace It", "Select Animation");
                    if (animationToBeReplaced == null || animationToReplaceIt == null)
                    {
                        return;
                    }
                    AnimationUtilities.ReplaceAnimation(animationToBeReplaced.Value, animationToReplaceIt.Value);
                },
            });
        }
Esempio n. 18
0
        public void FadeIn()
        {
            Opacity    = 0;
            Visibility = Visibility.Visible;

            var s = AnimationUtilities.CreateFadeInStoryboard(this, 500);

            // Delay by half a second to decrease the overlap of two tooltips
            s.BeginTime = TimeSpan.FromSeconds(1);

            s.Completed += (sender, evt) =>
            {
                if (AfterFadeIn != null)
                {
                    AfterFadeIn(this, EventArgs.Empty);
                }
            };

            s.Begin();
        }
Esempio n. 19
0
        public override void InitializeTab()
        {
            base.InitializeTab();
            textBoxActionDescription.DoubleClick    += (sender, e) => SelectionForm.ShowActionDescriptionSelectionForm();
            textBoxAnimationDescription.DoubleClick += (sender, e) => SelectionForm.ShowAnimationDescriptionSelectionForm();

            ControlUtilities.AddContextMenuStripFunctions(
                textBoxActionDescription,
                new List <string>()
            {
                "Select Action", "Free Movement Action", "Open Action Form"
            },
                new List <Action>()
            {
                () => SelectionForm.ShowActionDescriptionSelectionForm(),
                () => Config.Stream.SetValue(MarioConfig.FreeMovementAction, MarioConfig.StructAddress + MarioConfig.ActionOffset),
                () => new ActionForm().Show(),
            });

            ControlUtilities.AddContextMenuStripFunctions(
                textBoxAnimationDescription,
                new List <string>()
            {
                "Select Animation", "Replace Animation"
            },
                new List <Action>()
            {
                () => SelectionForm.ShowAnimationDescriptionSelectionForm(),
                () =>
                {
                    int?animationToBeReplaced = SelectionForm.GetAnimation("Choose Animation to Be Replaced", "Select Animation");
                    int?animationToReplaceIt  = SelectionForm.GetAnimation("Choose Animation to Replace It", "Select Animation");
                    if (animationToBeReplaced == null || animationToReplaceIt == null)
                    {
                        return;
                    }
                    AnimationUtilities.ReplaceAnimation(animationToBeReplaced.Value, animationToReplaceIt.Value);
                },
            });
        }
Esempio n. 20
0
        protected override void PickingConfigurer(AnimationUtilities.SkinnedEffect effect, RendererBase.RendererParameters instance, object[] optionalParameters)
        {
            effect.CurrentTechnique = effect.Techniques["PickingShade"];

            Vector4 indexColor = new Vector4((float)(instance.ObjectID << 8 >> 24) / 255, (float)(instance.ObjectID << 16 >> 24) / 255, (float)(instance.ObjectID << 24 >> 24) / 255, 1f);
            effect.Parameters["xPickingIndex"].SetValue(indexColor);
        }
Esempio n. 21
0
        protected override void ShadowMapConfigurer(AnimationUtilities.SkinnedEffect effect, RendererBase.RendererParameters instance, object[] optionalParameters)
        {
            Matrix lightView = (optionalParameters[0] as Matrix?).Value;
            Matrix lightProjection = (optionalParameters[1] as Matrix?).Value;

            effect.CurrentTechnique = effect.Techniques["ShadowCast"];

            effect.Parameters["xLightView"].SetValue(lightView);
            effect.Parameters["xLightProjection"].SetValue(lightProjection);
        }
Esempio n. 22
0
 public override void MakeAction()
 {
     AnimationUtilities.SetTriggerIfExists("Idle", MyAnimator);
     Destroy(gameObject);
 }
Esempio n. 23
0
 protected override void NoShadeConfigurer(AnimationUtilities.SkinnedEffect effect, RendererBase.RendererParameters instance, object[] optionalParameters)
 {
     effect.CurrentTechnique = effect.Techniques["NoShade"];
 }
Esempio n. 24
0
    public FacialAnimationClip ConstructFacialAnimationClip(string type, string actionID, string stance, InteractionAnimationType interactionType = InteractionAnimationType.Null)
    {
        FacialAnimationData data = FacialAnimationDatabase.Instance.GetFacialAnimation(type, actionID, interactionType, AnimationUtilities.StanceStringToEnum(stance));

        if (data != null)
        {
            FacialAnimationClip clip = FillAnimationClip(data);

            return(clip);
        }

        return(null);
    }
Esempio n. 25
0
 protected virtual void WithShadowsConfigurer(AnimationUtilities.SkinnedEffect effect, RendererParameters instance, object[] optionalParameters)
 {
 }
Esempio n. 26
0
 public void FadeOut()
 {
     AnimationUtilities.FadeOutAndRemove(this, 500);
 }
Esempio n. 27
0
 protected override void WithShadowsConfigurer(AnimationUtilities.SkinnedEffect effect, RendererParameters instance, object[] optionalParameters)
 {
     WithoutShadowsConfigurer(effect, instance, optionalParameters);
 }
Esempio n. 28
0
        protected override void WithoutShadowsConfigurer(AnimationUtilities.SkinnedEffect effect, RendererParameters instance, object[] optionalParameters)
        {
            Light light = optionalParameters[0] as Light;

            effect.CurrentTechnique = effect.Techniques["CelShadeWithoutShadows"];

            effect.Parameters["xDirLightDirection"].SetValue(light.Direction);
            effect.Parameters["xDirLightDiffuseColor"].SetValue(light.DiffuseColor);
            effect.Parameters["xDirLightSpecularColor"].SetValue(light.SpecularColor);
            effect.Parameters["xDirLightAmbientColor"].SetValue(light.AmbientColor);

            effect.SpecularColor = new Vector3(0.25f);
            effect.SpecularPower = 16;
        }
Esempio n. 29
0
 protected override void UIConfigurer(AnimationUtilities.SkinnedEffect effect, RendererBase.RendererParameters instance, object[] optionalParameters)
 {
     NoShadeConfigurer(effect, instance, optionalParameters);
 }
Esempio n. 30
0
 private void SetCameraPositionRotation(Vector3 newCameraPosition, Quaternion newRotation)
 {
     StartCoroutine(AnimationUtilities.MoveTo3D(transform, newCameraPosition, cameraLockTime));
     StartCoroutine(AnimationUtilities.RotateTo3D(transform, newRotation, cameraLockTime));
 }
Esempio n. 31
0
        protected override void WithShadowsConfigurer(AnimationUtilities.SkinnedEffect effect, RendererParameters instance, object[] optionalParameters)
        {
            CascadedShadowMap shadowMap = optionalParameters[0] as CascadedShadowMap;
            Light light = optionalParameters[1] as Light;

            effect.CurrentTechnique = effect.Techniques["CelShadeWithShadows"];

            effect.Parameters["ShadowMap"].SetValue(shadowMap.Buffer);

            effect.Parameters["xLightView"].SetValue(shadowMap.LightView);
            effect.Parameters["xLightProjections"].SetValue(shadowMap.LightProjections);

            effect.Parameters["xVisualizeCascades"].SetValue(shadowMap.VisualizeCascades);
            effect.Parameters["xCascadeCount"].SetValue(shadowMap.CascadeCount);
            effect.Parameters["xCascadeBufferBounds"].SetValue(shadowMap.CascadeBounds);
            effect.Parameters["xCascadeColors"].SetValue(shadowMap.CascadeColors);

            effect.Parameters["xDirLightDirection"].SetValue(light.Direction);
            effect.Parameters["xDirLightDiffuseColor"].SetValue(light.DiffuseColor);
            effect.Parameters["xDirLightSpecularColor"].SetValue(light.SpecularColor);
            effect.Parameters["xDirLightAmbientColor"].SetValue(light.AmbientColor);

            effect.SpecularColor = new Vector3(0.25f);
            effect.SpecularPower = 16;
        }
Esempio n. 32
0
 public override void StopAction()
 {
     AnimationUtilities.SetParameterIfExists("isSitting", MyAnimator, false);
     Destroy(gameObject);
 }
Esempio n. 33
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var animation = AnimationUtilities.PrepareAnimation(10, Width, this, WidthProperty, 0.7f);

            this.BeginAnimation(WidthProperty, animation);
        }
Esempio n. 34
0
 public override void MakeAction()
 {
     AnimationUtilities.SetParameterIfExists("isSitting", MyAnimator, true);
 }
Esempio n. 35
0
        protected override void PickingConfigurer(AnimationUtilities.SkinnedEffect effect, RendererParameters instance, object[] optionalParameters)
        {
            effect.CurrentTechnique = effect.Techniques["PickingShade"];

            effect.Parameters["xPickingIndex"].SetValue(new Vector4(0, 0, 0, 0));
        }
Esempio n. 36
0
        protected override void NoShadeConfigurer(AnimationUtilities.SkinnedEffect effect, RendererParameters instance, object[] optionalParameters)
        {
            effect.Parameters["xTextureTransformation"].SetValue((instance as TransparentModelParameters).AnimationTransformation);

            effect.CurrentTechnique = effect.Techniques["NoShade"];
        }