当前位置: 首页>>代码示例>>C#>>正文


C# Vector2.IsDangerousPosition方法代码示例

本文整理汇总了C#中System.Vector2.IsDangerousPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Vector2.IsDangerousPosition方法的具体用法?C# Vector2.IsDangerousPosition怎么用?C# Vector2.IsDangerousPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Vector2的用法示例。


在下文中一共展示了Vector2.IsDangerousPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetTumblePos

        public static Vector3 GetTumblePos(this Obj_AI_Base target)
        {
            //if the target is not a melee and he's alone he's not really a danger to us, proceed to 1v1 him :^ )
            if (!target.IsMelee && Heroes.Player.CountEnemiesInRange(800) == 1) return Game.CursorPos;

            var aRC = new Geometry.Circle(Heroes.Player.ServerPosition.To2D(), 300).ToPolygon().ToClipperPath();
            var cursorPos = Game.CursorPos;
            var targetPosition = target.ServerPosition;
            var pList = new List<Vector3>();
            var additionalDistance = (0.106 + Game.Ping / 2000f) * target.MoveSpeed;

            if (!cursorPos.IsDangerousPosition()) return cursorPos;

            foreach (var p in aRC)
            {
                var v3 = new Vector2(p.X, p.Y).To3D();

                if (target.IsFacing(Heroes.Player))
                {
                    if (!v3.IsDangerousPosition() && v3.Distance(targetPosition) < 550) pList.Add(v3);
                }
                else
                {
                    if (!v3.IsDangerousPosition() && v3.Distance(targetPosition) < 550 - additionalDistance) pList.Add(v3);
                }
            }
            if (Heroes.Player.UnderTurret() || Heroes.Player.CountEnemiesInRange(800) == 1)
            {
                return pList.Count > 1 ? pList.OrderBy(el => el.Distance(cursorPos)).FirstOrDefault() : Vector3.Zero;
            }
            return pList.Count > 1 ? pList.OrderBy(el => el.Distance(cursorPos)).FirstOrDefault() : Vector3.Zero;
        }
开发者ID:q51251,项目名称:LeagueSharp-1,代码行数:32,代码来源:MyExtensions.cs

示例2: GetPositioning

        public static Vector3 GetPositioning(this Obj_AI_Base target)
        {
            var cursorPos = Game.CursorPos;
            //if the target is not a melee and he's alone he's not really a danger to us, proceed to 1v1 him :^ )
            if (!target.IsMelee && Heroes.Player.CountEnemiesInRange(800) == 1) return cursorPos;
            if (!cursorPos.IsDangerousPosition()) return cursorPos;

            var aRC = new Geometry.Circle(Heroes.Player.ServerPosition.To2D(), 575).ToPolygon().ToClipperPath();
            var targetPosition = Prediction.GetPrediction(target, 1800f).UnitPosition;
            var pList = new List<Vector3>();

            if (!cursorPos.IsDangerousPosition() || Player.UnderTurret() || Game.CursorPos.UnderTurret(true) || Player.CountEnemiesInRange(1400) == 1) return cursorPos;

            foreach (var p in aRC)
            {
                var v3 = new Vector2(p.X, p.Y).To3D();

                if (!v3.IsDangerousPosition() && v3.Distance(targetPosition) > 375 && v3.Distance(targetPosition) < 600) pList.Add(v3);
            }
            return pList.Count > 1 ? pList.OrderBy(el => el.Distance(cursorPos)).FirstOrDefault() : Vector3.Zero;
        }
开发者ID:q51251,项目名称:LeagueSharp-1,代码行数:21,代码来源:MyExtensions.cs


注:本文中的System.Vector2.IsDangerousPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。