本文整理汇总了C#中System.Vector3.IsGround方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.IsGround方法的具体用法?C# Vector3.IsGround怎么用?C# Vector3.IsGround使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Vector3
的用法示例。
在下文中一共展示了Vector3.IsGround方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveTo
public static async Task<bool> MoveTo(Vector3 destination, bool useMesh = true, uint mountId = 0, float radius = 2.0f, string name = null, Func<float, float, bool> stopCallback = null, bool dismountAtDestination = false)
{
// ReSharper disable once InconsistentNaming
var distance3d = Core.Player.Location.Distance3D(destination);
if (Actionmanager.CanMount == 0 && ((!Core.Player.IsMounted && distance3d >= CharacterSettings.Instance.MountDistance && CharacterSettings.Instance.UseMount) || !destination.IsGround()))
{
var ticks = 0;
while (!Core.Player.IsMounted && ticks++ < 10 && ShouldContinue)
{
if (mountId > 0)
{
if (!await CommonTasks.MountUp(mountId))
{
if (!await CommonTasks.MountUp(1))
{
await CommonTasks.MountUp(45);
}
}
}
else
{
await CommonTasks.MountUp();
}
await Coroutine.Yield();
}
}
await MoveToNoMount(destination, useMesh, radius, name, stopCallback);
var dismountTicks = 0;
while (dismountAtDestination && dismountTicks++ < 10 && Core.Player.IsMounted && ShouldContinue)
{
if (MovementManager.IsFlying)
{
if (Navigator.PlayerMover is FlightEnabledSlideMover)
{
Navigator.Stop();
}
else
{
MovementManager.StartDescending();
}
}
else
{
Actionmanager.Dismount();
}
await Coroutine.Wait(1000, () => !Core.Player.IsMounted);
}
if (dismountTicks >= 10)
{
Logging.Write(Colors.Red, "Failed to dismount after MoveTo task.");
return false;
}
return true;
}
示例2: MoveTo
public static async Task<bool> MoveTo(
Vector3 destination,
bool useMesh = true,
uint mountId = 0,
float radius = 2.0f,
string name = null,
Func<float, float, bool> stopCallback = null,
bool dismountAtDestination = false)
{
// ReSharper disable once InconsistentNaming
var distance3d = Core.Player.Location.Distance3D(destination);
if (Actionmanager.CanMount == 0
&& ((!Core.Player.IsMounted && distance3d >= CharacterSettings.Instance.MountDistance
&& CharacterSettings.Instance.UseMount) || !destination.IsGround()))
{
uint flightSpecificMountId = 0;
if (mountId == 0)
{
mountId = CharacterSettings.Instance.MountId;
if (mountId == uint.MaxValue)
{
var mount = Actionmanager.AvailableMounts.Shuffle().FirstOrDefault();
if (mount != null)
{
mountId = mount.Id;
}
}
var playerMover = Navigator.PlayerMover as IFlightEnabledPlayerMover;
if (playerMover != null)
{
flightSpecificMountId = (uint)playerMover.FlightMovementArgs.MountId;
}
}
var ticks = 0;
while (!Core.Player.IsMounted && ticks++ < 10 && ShouldContinue)
{
if (WorldManager.CanFly && flightSpecificMountId > 0)
{
await CommonTasks.MountUp(flightSpecificMountId);
await Coroutine.Yield();
if (Core.Player.IsMounted)
{
break;
}
}
if (mountId > 0)
{
if (!await CommonTasks.MountUp(mountId))
{
if (!await CommonTasks.MountUp(1))
{
await CommonTasks.MountUp(45);
}
}
}
else
{
await CommonTasks.MountUp();
}
await Coroutine.Yield();
}
}
await MoveToNoMount(destination, useMesh, radius, name, stopCallback);
var dismountTicks = 0;
while (dismountAtDestination && dismountTicks++ < 100 && Core.Player.IsMounted && ShouldContinue)
{
if (MovementManager.IsFlying)
{
if (Navigator.PlayerMover is FlightEnabledSlideMover)
{
Navigator.Stop();
}
else
{
MovementManager.StartDescending();
}
}
else
{
Actionmanager.Dismount();
}
await Coroutine.Wait(100, () => !Core.Player.IsMounted);
}
if (dismountTicks > 100)
{
Logger.Instance.Error("Failed to dismount after MoveTo task.");
return false;
}
return true;
}
示例3: ShouldFlyInternal
internal static bool ShouldFlyInternal(Vector3 destination)
{
return MovementManager.IsFlying
|| (Actionmanager.CanMount == 0
&&
((destination.Distance3D(GameObjectManager.LocalPlayer.Location) >=
CharacterSettings.Instance.MountDistance)
|| !destination.IsGround()));
}