示例#1
0
        public void DrawMinionRespawn(Vector2f[] points, bool isUnion)
        {
            WayPointInfo[][] respawnWayPoints;
            if (isUnion)
            {
                if (respawnUnionPoints == null)
                {
                    respawnUnionPoints = points;
                    respawnWayPoints   = respawnUnionWayPoints = GenerateWayPoints(points, 100);
                }
                else
                {
                    respawnWayPoints = respawnUnionWayPoints;
                }
            }
            else if (respawnEnemyPoints == null)
            {
                respawnEnemyPoints = points;
                respawnWayPoints   = respawnEnemyWayPoints = GenerateWayPoints(points, 100);
            }
            else
            {
                respawnWayPoints = respawnEnemyWayPoints;
            }

            for (int i = 0; i < respawnWayPoints.Length; i++)
            {
                var point          = points[i];
                var isVisiblePoint = visibleArea[(int)(point.X / visibleArea.Length)][(int)(point.Y / visibleArea.Length)] != 0;
                if (!isVisiblePoint)
                {
                    continue;
                }
                int n      = (index / 1) % respawnWayPoints[i].Length;
                var sprite = isUnion
                    ? Sprites.Critter_Union(respawnWayPoints[i][n].Angle)
                    : Sprites.Critter_Enemy(respawnWayPoints[i][n].Angle);
                DrawGameUnitSprite(sprite, respawnWayPoints[i][n].Point.X, respawnWayPoints[i][n].Point.Y);
            }
        }