Exemple #1
0
        public ShaderPropertiesCommand(List <object> list, ShaderCommand parent)
        {
            _propList = new List <ShaderProperty>();

            foreach (TreeDict d in list)
            {
                string property = "" + Trees.At(d, "_prop");

                float duration;

                dynamic value = Trees.At(d, "_value");

                dynamic tmp = Trees.At(d, "_duration");

                try
                {
                    duration = (float)tmp;
                }
                catch (Exception)
                {
                    duration = -1;
                }


                Functions easing = Functions.easeLinear;

                string easingString = Trees.At(d, "_easing");
                if (easingString != null)
                {
                    easing = (Functions)Enum.Parse(typeof(Functions), easingString);
                }

                //Logger.log.Debug("ShaderPropertiesCommand: p:" + property + " d: " + duration + " e: " + easing + " v:" + value);

                _propList.Add(new ShaderProperty(property, duration, value, easing, parent));
            }
        }
Exemple #2
0
 public ShaderProperty(string property, float duration, dynamic value, Functions easing, ShaderCommand parent) : base(PropertyType.Linear)
 {
     this.Property      = property;
     this.Duration      = duration;
     this.Easing        = easing;
     this.ParentCommand = parent;
     if (value is string)
     {
         this.Value = value;
     }
     Points = PointDefinition.DynamicToPointData(value);
     //Logger.log.Debug("ShaderProperty: Points: " + Points);
 }