示例#1
0
        public void AddPoint(Vector2 vector, EaseFunction function)
        {
            if (vector.X < 0f)
            {
                throw new ArgumentException("X value of point is not in valid range!");
            }

            EasePoint newPoint = new EasePoint(vector, function);

            if (_points.Count == 0)
            {
                _points.Add(newPoint);
                return;
            }

            EasePoint last = _points[_points.Count - 1];

            if (last.Point.X > vector.X)
            {
                throw new ArgumentException("New point has an x value less than the previous point when it should be greater or equal");
            }

            _points.Add(newPoint);
        }
示例#2
0
 public void AddPoint(float x, float y, EaseFunction function) => AddPoint(new Vector2(x, y), function);
示例#3
0
 public EasePoint(Vector2 p, EaseFunction func)
 {
     Point    = p;
     Function = func;
 }