本文整理匯總了C#中OpenRA.Graphics.WorldRenderer.DrawTargetMarker方法的典型用法代碼示例。如果您正苦於以下問題:C# WorldRenderer.DrawTargetMarker方法的具體用法?C# WorldRenderer.DrawTargetMarker怎麽用?C# WorldRenderer.DrawTargetMarker使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenRA.Graphics.WorldRenderer
的用法示例。
在下文中一共展示了WorldRenderer.DrawTargetMarker方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: RenderAfterWorld
public void RenderAfterWorld(WorldRenderer wr, Actor self)
{
if (devMode == null || !devMode.ShowMuzzles)
return;
if (health.Value != null)
wr.DrawRangeCircle(Color.Red, wr.ScreenPxPosition(self.CenterPosition), health.Value.Info.Radius / Game.CellSize);
var wlr = Game.Renderer.WorldLineRenderer;
var c = Color.White;
foreach (var a in armaments.Value)
{
foreach (var b in a.Barrels)
{
var muzzle = self.CenterPosition + a.MuzzleOffset(self, b);
var dirOffset = new WVec(0, -224, 0).Rotate(a.MuzzleOrientation(self, b));
var sm = wr.ScreenPosition(muzzle);
var sd = wr.ScreenPosition(muzzle + dirOffset);
wlr.DrawLine(sm, sd, c, c);
wr.DrawTargetMarker(c, sm);
}
}
}
示例2: RenderAfterWorld
public void RenderAfterWorld(WorldRenderer wr)
{
var force = Game.GetModifierKeys().HasModifier(Modifiers.Alt);
if ((lifetime <= 0 || --lifetime <= 0) && !force)
return;
if (targets == null || targets.Count == 0)
return;
var from = wr.ScreenPxPosition(self.CenterPosition);
foreach (var target in targets)
{
if (target.Type == TargetType.Invalid)
continue;
var to = wr.ScreenPxPosition(target.CenterPosition);
Game.Renderer.WorldLineRenderer.DrawLine(from, to, c, c);
wr.DrawTargetMarker(c, from);
wr.DrawTargetMarker(c, to);
}
}
示例3: RenderAfterWorld
public void RenderAfterWorld(WorldRenderer wr, Actor self)
{
if (devMode == null || !devMode.ShowCombatGeometry)
return;
if (health.Value != null)
wr.DrawRangeCircle(self.CenterPosition, health.Value.Info.Radius, Color.Red);
// No armaments to draw
if (attack.Value == null)
return;
var wlr = Game.Renderer.WorldLineRenderer;
var c = Color.White;
// Fire ports on garrisonable structures
var garrison = attack.Value as AttackGarrisoned;
if (garrison != null)
{
var bodyOrientation = coords.Value.QuantizeOrientation(self, self.Orientation);
foreach (var p in garrison.Ports)
{
var pos = self.CenterPosition + coords.Value.LocalToWorld(p.Offset.Rotate(bodyOrientation));
var da = coords.Value.LocalToWorld(new WVec(224, 0, 0).Rotate(WRot.FromYaw(p.Yaw + p.Cone)).Rotate(bodyOrientation));
var db = coords.Value.LocalToWorld(new WVec(224, 0, 0).Rotate(WRot.FromYaw(p.Yaw - p.Cone)).Rotate(bodyOrientation));
var o = wr.ScreenPosition(pos);
var a = wr.ScreenPosition(pos + da * 224 / da.Length);
var b = wr.ScreenPosition(pos + db * 224 / db.Length);
wlr.DrawLine(o, a, c, c);
wlr.DrawLine(o, b, c, c);
}
return;
}
foreach (var a in attack.Value.Armaments)
{
foreach (var b in a.Barrels)
{
var muzzle = self.CenterPosition + a.MuzzleOffset(self, b);
var dirOffset = new WVec(0, -224, 0).Rotate(a.MuzzleOrientation(self, b));
var sm = wr.ScreenPosition(muzzle);
var sd = wr.ScreenPosition(muzzle + dirOffset);
wlr.DrawLine(sm, sd, c, c);
wr.DrawTargetMarker(c, sm);
}
}
}
示例4: Render
public void Render(WorldRenderer wr)
{
if (!waypoints.Any())
return;
var first = wr.ScreenPxPosition(waypoints.First());
var a = first;
foreach (var b in waypoints.Skip(1).Select(pos => wr.ScreenPxPosition(pos)))
{
Game.Renderer.WorldLineRenderer.DrawLine(a, b, color, color);
wr.DrawTargetMarker(color, b);
a = b;
}
wr.DrawTargetMarker(color, first);
}
示例5: DrawUnitPath
void DrawUnitPath(WorldRenderer wr)
{
if (self.World.LocalPlayer == null || !self.World.LocalPlayer.PlayerActor.Trait<DeveloperMode>().PathDebug)
return;
var activity = self.GetCurrentActivity();
if (activity != null)
{
var targets = activity.GetTargets(self);
var start = wr.ScreenPxPosition(self.CenterPosition);
var c = Color.Green;
foreach (var stp in targets.Where(t => t.Type != TargetType.Invalid).Select(pos => wr.ScreenPxPosition(pos.CenterPosition)))
{
Game.Renderer.WorldLineRenderer.DrawLine(start, stp, c, c);
wr.DrawTargetMarker(c, stp);
start = stp;
}
}
}