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


C# Vector3.To2D方法代码示例

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


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

示例1: ExtendVector3

        //Copied from Fluxy's YasouBuddy - He is a god and so is his yasou addon.
        public static Vector3 ExtendVector3(this Vector3 vector, Vector3 direction, float distance)
        {
            if (vector.To2D().Distance(direction.To2D()) == 0)
            {
                return vector;
            }

            var edge = direction.To2D() - vector.To2D();
            edge.Normalize();

            var v = vector.To2D() + edge * distance;
            return new Vector3(v.X, v.Y, vector.Z);
        }
开发者ID:Wiezerzz,项目名称:EloBuddy-Addons,代码行数:14,代码来源:Utils.cs

示例2: IsSafe

        public static bool IsSafe(Vector3 Position)
        {
            if((Position.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true)) || (PositioningVariables.EnemiesClose.Count() > 1 && iSRGeometry.GetEnemyPoints().Contains(Position.To2D())))
            {
                return false;
            }

            return true;
        }
开发者ID:luizssn,项目名称:LeagueSharp,代码行数:9,代码来源:VayneQ.cs

示例3: GetMinionsPredictedPositions

        public static List<Vector2> GetMinionsPredictedPositions(List<Obj_AI_Base> minions,
            float delay,
            float width,
            float speed,
            Vector3 from,
            float range,
            bool collision,
            SkillshotType stype,
            Vector3 rangeCheckFrom = new Vector3())
        {
            from = from.To2D().IsValid() ? from : ObjectManager.Player.ServerPosition;

            return (from minion in minions
                select
                    Prediction.GetPrediction(
                        new PredictionInput
                        {
                            Unit = minion,
                            Delay = delay,
                            Radius = width,
                            Speed = speed,
                            From = @from,
                            Range = range,
                            Collision = collision,
                            Type = stype,
                            RangeCheckFrom = rangeCheckFrom
                        })
                into pos
                where pos.Hitchance >= HitChance.High
                select pos.UnitPosition.To2D()).ToList();
        }
开发者ID:juan2202,项目名称:LeagueSharp-Standalones,代码行数:31,代码来源:MinionManager.cs

示例4: Distance

 internal static float Distance(this Obj_AI_Base unit, Vector3 point, bool squared = false)
 {
     return unit.ServerPosition.To2D().Distance(point.To2D(), squared);
 }
开发者ID:hypnotik60fps,项目名称:LeagueSharp,代码行数:4,代码来源:Extensions.cs

示例5: CheckQCollision

        private static bool CheckQCollision(Obj_AI_Base target, Vector3 targetPosition, Vector3 castPosition)
        {
            var direction = (castPosition.To2D() - ObjectManager.Player.ServerPosition.To2D()).Normalized();
            var firstBouncePosition = castPosition.To2D();
            var secondBouncePosition = firstBouncePosition +
                                       direction * 0.4f *
                                       ObjectManager.Player.ServerPosition.To2D().Distance(firstBouncePosition);
            var thirdBouncePosition = secondBouncePosition +
                                      direction * 0.6f * firstBouncePosition.Distance(secondBouncePosition);

            //TODO: WALL COLL

            if (thirdBouncePosition.Distance(targetPosition.To2D()) < SpellManager.Q1.Width + target.BoundingRadius)
            {
                var minion = EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault(m => m.IsValidTarget(2000));
                if (minion != null)
                {
                    var predictedPos = SpellManager.Q2.GetPrediction(minion);
                    if (predictedPos.UnitPosition.To2D().Distance(secondBouncePosition) <
                        SpellManager.Q2.Width + minion.BoundingRadius)
                    {
                        return true;
                    }
                }
            }

            if (!(secondBouncePosition.Distance(targetPosition.To2D()) < SpellManager.Q1.Width + target.BoundingRadius) &&
                !(thirdBouncePosition.Distance(targetPosition.To2D()) < SpellManager.Q1.Width + target.BoundingRadius)) return true;
            {
                //Check the first one
                var minion = EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault(m => m.IsValidTarget(2000));
                if (minion == null) return false;

                var predictedPos = SpellManager.Q1.GetPrediction(minion);
                if (predictedPos.UnitPosition.To2D().Distance(firstBouncePosition) <
                    SpellManager.Q1.Width + minion.BoundingRadius)
                {
                    return true;
                }
            }

            return false;
        }
开发者ID:hao1630,项目名称:KickAss,代码行数:43,代码来源:Functions.cs

示例6: GetMinionsPredictedPositions

        public static List<Vector2> GetMinionsPredictedPositions(List<Obj_AI_Base> minions,
            float delay,
            float width,
            float speed,
            Vector3 from,
            float range,
            bool collision,
            SkillshotType stype,
            Vector3 rangeCheckFrom = new Vector3())
        {
            var result = new List<Vector2>();
            from = from.To2D().IsValid() ? from : ObjectManager.Player.ServerPosition;
            foreach (var minion in minions)
            {
                var pos = Prediction.GetPrediction(new PredictionInput
                {
                    Unit = minion,
                    Delay = delay,
                    Radius = width,
                    Speed = speed,
                    From = from,
                    Range = range,
                    Collision = collision,
                    Type = stype,
                    RangeCheckFrom = rangeCheckFrom
                });
                 
                if (pos.Hitchance >= HitChance.High)
                {
                    result.Add(pos.UnitPosition.To2D());
                }
            }

            return result;
        }
开发者ID:ramboozer,项目名称:LeagueSharpCommon,代码行数:35,代码来源:MinionManager.cs

示例7: WallQpos

        public static Vector3 WallQpos(AIHeroClient target)
        {
            if (target == null)
            {
                return new Vector3();
            }

            for (var i = 100; i < 900; i += 100)
            {
                var qPos = new Vector3(
                    Prediction.Position.PredictUnitPosition(target, 250).To3D().X + i,
                    Prediction.Position.PredictUnitPosition(target, 250).To3D().Y + i,
                    Prediction.Position.PredictUnitPosition(target, 250).To3D().Z);
                if (
                    NavMesh.GetCollisionFlags(qPos.To2D()
                        .RotateAroundPoint((Vector2) qPos, 20)).HasFlag(CollisionFlags.Building) ||
                    NavMesh.GetCollisionFlags(qPos.To2D()
                        .RotateAroundPoint((Vector2) qPos, 20)).HasFlag(CollisionFlags.Wall))
                    return qPos;
            }
            return new Vector3();
        }
开发者ID:KoalaHuman,项目名称:EloBuddy-4,代码行数:22,代码来源:Helpers.cs

示例8: MoveTo

 static void MoveTo(Vector3 position)
 {
     var pointToMoveTo = Player.ServerPosition + 250 * (position.To2D() - Player.ServerPosition.To2D()).Normalized().To3D();
     Player.IssueOrder(GameObjectOrder.MoveTo, pointToMoveTo);
 }
开发者ID:zjian1013,项目名称:LeagueSharpFlapperDoodlez,代码行数:5,代码来源:Program.cs

示例9: Cast_Inverted_E

        private void Cast_Inverted_E(Vector3 position)
        {
            if (!E.IsReady())
                return;

            var pos = ObjectManager.Player.ServerPosition.To2D().Extend(position.To2D(), -300).To3D();

            E.Cast(pos, UsePackets());
        }
开发者ID:InjectionDev,项目名称:LeagueSharp-xSLx,代码行数:9,代码来源:Caitlyn.cs

示例10: GetFirstWallPoint

 public static Vector2? GetFirstWallPoint(Vector3 from, Vector3 to, float step = 25)
 {
     return GetFirstWallPoint(from.To2D(), to.To2D(), step);
 }
开发者ID:uio25371555,项目名称:ChewyMoonScripts,代码行数:4,代码来源:WallJumper.cs


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