Beispiel #1
0
        public async void ClickAnimation()
        {
            Color originalColor = Color.Cyan;
            Color clickColor    = Color.Yellow;

            CursorModelNode.RemoveAllActions();

            var staticModel = CursorModelNode.GetComponent <StaticModel>();

            if (staticModel != null)
            {
                var specColorAnimation = new ValueAnimation();
                specColorAnimation.SetKeyFrame(0.0f, originalColor);
                specColorAnimation.SetKeyFrame(0.2f, clickColor);
                specColorAnimation.SetKeyFrame(0.4f, originalColor);
                var mat = staticModel.GetMaterial(0);
                mat?.SetShaderParameterAnimation("MatDiffColor", specColorAnimation, WrapMode.Once, 1.0f);
            }
            await CursorModelNode.RunActionsAsync(new ScaleTo(0.2f, 0.07f), new ScaleTo(0.4f, 0.04f));

            RunIdleAnimation();
        }
Beispiel #2
0
 public void RunIdleAnimation()
 {
     CursorModelNode.RemoveAllActions();
     CursorModelNode.RunActions(new RepeatForever(new ScaleTo(0.3f, 0.05f), new ScaleTo(0.3f, 0.03f)));
 }