示例#1
0
        public void PushToEnd()
        {
            path.PushToEnd(1);
            Assert.AreEqual(1, path[0]);
            Assert.AreEqual(1, path.Size);
            Assert.AreEqual(0, path.Length);
            Assert.AreEqual(0, path.stepsPassed);
            Assert.AreEqual(0, path.Mileage);

            path.PushToEnd(2);
            Assert.AreEqual(2, path[1]);
            Assert.AreEqual(2, path.Size);
            Assert.AreEqual(kInterval, path.Length);
            Assert.AreEqual(0, path.stepsPassed);
            Assert.AreEqual(0, path.Mileage);
        }
示例#2
0
        public void Grow(ValueTransform value, bool force = false)
        {
            // TEST; TODO: remove

            float distance = 0;

            if (intPath.Size == 0)
            {
                force = true;
            }
            else
            {
                distance = (value.position - intPath.Last.position).magnitude;
            }

            if (force || distance >= interval)
            {
                intPath.PushToEnd(value);
            }
        }