Example #1
0
 /// <summary>
 /// Initialize a new instance of the <see cref="CatlikeCoding.NumberFlow.Value"/> class.
 /// </summary>
 /// <param name="value">Value to create a deep copy of.</param>
 public Value(Value value)
 {
     this.Bool           = value.Bool;
     this.Color          = value.Color;
     this.Float          = value.Float;
     this.Int            = value.Int;
     this.String         = value.String;
     this.Vector2        = value.Vector2;
     this.Vector3        = value.Vector3;
     this.AnimationCurve = value.AnimationCurve;
     if (value.AnimationCurve == null)
     {
         this.AnimationCurve = new AnimationCurve();
     }
     else
     {
         this.AnimationCurve              = new AnimationCurve(value.AnimationCurve.keys);
         this.AnimationCurve.preWrapMode  = value.AnimationCurve.preWrapMode;
         this.AnimationCurve.postWrapMode = value.AnimationCurve.postWrapMode;
     }
     this.Gradient = new Gradient();
     if (value.Gradient != null)
     {
         this.Gradient.SetKeys(value.Gradient.colorKeys, value.Gradient.alphaKeys);
     }
     this.Pixels = new DiagramPixels(value.Pixels);
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance as a copy of another. There is no reason to do this yourself.
 /// </summary>
 /// <param name='pixels'>
 /// DiagramPixels instance to copy.
 /// </param>
 public DiagramPixels(DiagramPixels pixels)
 {
     this.texture = pixels.texture;
 }