本文整理汇总了C#中Cube.SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Cube.SetPosition方法的具体用法?C# Cube.SetPosition怎么用?C# Cube.SetPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cube
的用法示例。
在下文中一共展示了Cube.SetPosition方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Incinerator
public Incinerator(Vector2 position)
{
this.Position = position;
cube = new Cube(new Vector3(position.X, 0, position.Y), RM.GetTexture("incinerator"));
cube.ScaleVector = new Vector3(24, 64, 24);
cube.SetPosition(position.ToVector3() + new Vector3(0, -56, 0));
}
示例2: AlarmPanel
public AlarmPanel(Vector2 pos)
: base(pos)
{
workTime = 0;
cube = new Cube(new Vector3(pos.X, 0, pos.Y), RM.GetTexture("work"));
cube.ScaleVector = new Vector3(8, 1, 8);
cube.SetPosition(Position.ToVector3());
}
示例3: Crate
public Crate(Vector2 position)
{
this.Position = position;
cube = new Cube(new Vector3(position.X, 0, position.Y), RM.GetTexture("crate"));
cube.ScaleVector = new Vector3(8, 8, 8);
cube.SetPosition(Position.ToVector3());
CanRun = true;
WantsToRun = true;
}
示例4: Bullet
public Bullet(Vector2 pos, Vector2 dir)
: base(pos)
{
cube = new Cube(new Vector3(pos.X, 0, pos.Y), RM.GetTexture("white"));
cube.ScaleVector = new Vector3(2, 2, 2);
cube.SetPosition(Position.ToVector3());
this.Direction = dir;
this.score = 50;
}
示例5: Door
public Door(Vector2 position)
{
Position = position;
cube = new Cube(Position.ToVector3(), RM.GetTexture("door"));
cube.SetPosition(new Vector3(Position.X, Y, Position.Y));
HudIcons.Add(new HudIcon() { text = "Open door", texture = RM.GetTexture("opendooricon"), Action = (() => state = DoorState.Opening) });
HudIcons.Add(new HudIcon() { text = "Close door", texture = RM.GetTexture("closedooricon"), Action = (() => state = DoorState.Closing) });
HudIcons.Add(new HudIcon() { text = "Lock/unlock", texture = RM.GetTexture("lockicon"), Action = (() => Locked = !Locked) });
HudIcons.Add(new HudIcon() { text = "Toggle AI", texture = RM.GetTexture("dooraiicon"), Action = (() => ai = !ai) });
}
示例6: SentryGun
public SentryGun(Vector2 position)
{
this.Position = position;
cube = new Cube(new Vector3(position.X, 0, position.Y), RM.GetTexture("sentry"));
cube.ScaleVector = new Vector3(8, 12, 8);
cube.SetPosition(Position.ToVector3());
supportsCamera = true;
HudIcons.Add(new HudIcon() { text = "Sentrycam", texture = RM.GetTexture("camera"), Action = (() => World.ToggleCamera(this)) });
HudIcons.Add(new HudIcon()
{
text = "Turn left",
texture = RM.GetTexture("arrowlefticon"),
Action = (() =>
{
Matrix cameraRotation = Matrix.CreateRotationY(0.05f);
Vector3 rotTarget = LookDir.ToVector3();
var result = Vector3.Transform(rotTarget, cameraRotation);
LookDir = result.ToVector2();
LookDir.Normalize();
}),
OnDown = true
});
HudIcons.Add(new HudIcon()
{
text = "Turn right",
texture = RM.GetTexture("arrowrighticon"),
Action = (() =>
{
Matrix cameraRotation = Matrix.CreateRotationY(-0.05f);
Vector3 rotTarget = LookDir.ToVector3();
var result = Vector3.Transform(rotTarget, cameraRotation);
LookDir = result.ToVector2();
LookDir.Normalize();
}),
OnDown = true
});
HudIcons.Add(new HudIcon() { texture = RM.GetTexture("shooticon"), text = "Shoot", Action = () => fire = true, OnDown = true });
HudIcons.Add(new HudIcon() { texture = RM.GetTexture("sentryaiicon"), text = "Toggle AI", Action = () => ai = !ai });
}
示例7: ExplosiveCrate
public ExplosiveCrate(Vector2 position)
: base(position)
{
cube = new Cube(new Vector3(position.X, 0, position.Y), RM.GetTexture("explosivecrate"));
cube.ScaleVector = new Vector3(8, 8, 8);
cube.SetPosition(Position.ToVector3());
}