Пример #1
0
        public void MovebyPath(Vector3[] controls, int path_offset = 0)
        {
            args.path_Idx_offset = path_offset;
            args.path            = new Vector3[controls.Length];
            TransportPathTransform transform = new TransportPathTransform(unit, args.TransformForTransport);

            for (var i = 0; i < controls.Length; i++)
            {
                args.path[i] = transform.Calc(controls[i]);
            }
        }
Пример #2
0
        public void MoveTo(Vector3 dest, bool generatePath = true, bool forceDestination = false)
        {
            if (generatePath)
            {
                PathGenerator path   = new PathGenerator(unit);
                bool          result = path.CalculatePath(dest.X, dest.Y, dest.Z, forceDestination);
                if (result && !Convert.ToBoolean(path.GetPathType() & PathType.NoPath))
                {
                    MovebyPath(path.GetPath());
                    return;
                }
            }

            args.path_Idx_offset = 0;
            args.path            = new Vector3[2];
            TransportPathTransform transform = new TransportPathTransform(unit, args.TransformForTransport);

            args.path[1] = transform.Calc(dest);
        }