本文整理汇总了C#中Point3D.ScanRange方法的典型用法代码示例。如果您正苦于以下问题:C# Point3D.ScanRange方法的具体用法?C# Point3D.ScanRange怎么用?C# Point3D.ScanRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point3D
的用法示例。
在下文中一共展示了Point3D.ScanRange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EndGoldExplosion
public static void EndGoldExplosion(
ExplodeFX fx, Point3D center, Map map, int range, int minGold, int maxGold, int[] dropSounds = null)
{
BaseExplodeEffect efx = fx.CreateInstance(center, map, range);
if (efx == null)
{
return;
}
efx.AverageZ = false;
efx.Callback = () =>
{
var points = new List<Point3D>();
center.ScanRange(
map,
range,
r =>
{
if (!r.Excluded)
{
if (r.QueryMap.CanFit(r.Current, 1, false, false) || r.QueryMap.HasWater(r.Current))
{
points.Add(r.Current);
}
else
{
r.Exclude();
}
}
return false;
});
if (points.Count == 0)
{
return;
}
dropSounds = dropSounds ?? new[] {553, 554};
Timer goldTimer = null;
goldTimer = Timer.DelayCall(
TimeSpan.FromSeconds(1),
TimeSpan.FromMilliseconds(100),
points.Count,
() =>
{
if (points.Count == 0)
{
if (goldTimer != null)
{
goldTimer.Running = false;
goldTimer = null;
}
return;
}
Point3D p = points.GetRandom();
points.Remove(p);
Effects.PlaySound(p, map, dropSounds.GetRandom());
new MovingEffectInfo(p.Clone3D(0, 0, Utility.RandomMinMax(30, 50)), p, map, 3823, 0, 10,
EffectRender.Lighten)
.MovingImpact(
e =>
{
int amount = Utility.RandomMinMax(minGold, maxGold);
if (amount <= 0)
{
return;
}
var g = new Gold(amount);
g.MoveToWorld(e.Target.Location, e.Map);
new EffectInfo(e.Target, e.Map, 14202, 51, 10, 40, EffectRender.Lighten).Send();
Effects.PlaySound(e.Target, e.Map, g.GetDropSound());
});
});
};
efx.Send();
}