本文整理匯總了C#中Actor.Add方法的典型用法代碼示例。如果您正苦於以下問題:C# Actor.Add方法的具體用法?C# Actor.Add怎麽用?C# Actor.Add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Actor
的用法示例。
在下文中一共展示了Actor.Add方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Main
static int Main(string[] args)
{
DynamicsSystem.SetGravity(0.0f, -9.81f, 0.0f);
GraphicsWindow wnd = new GraphicsWindow("Test Window", 640, 480);
/* Create an actor at the origin to contain the camera */
Actor camera = new Actor();
camera.Add(wnd.Camera);
wnd.Camera.BackgroundColor = System.Drawing.Color.SkyBlue;
wnd.Camera.Position.Z = 3.0;
/* Create an actor to hold a box */
Actor box = new Actor();
box.Add(new BoxShape(1.0f, 1.0f, 1.0f));
box.Add(new RigidBody());
_scene.Add(camera);
_scene.Add(box);
/* Enable visualization of collision shapes */
Visualization.Add("FlatFour.Collision.BoxVisualizer");
/* Run the event loop */
PlatformSystem.Tick += new TickHandler(OnTick);
PlatformSystem.EventLoop();
Framework.Disconnect();
return 0;
}
示例2: SetsPoseShortcut
public void SetsPoseShortcut()
{
Actor a = new Actor();
Pose p = new Pose();
a.Add(p);
Assert.AreSame(p, a.Pose);
}
示例3: SetsPoseShutcutFromSubclass
public void SetsPoseShutcutFromSubclass()
{
Actor a = new Actor();
MyPose p = new MyPose();
a.Add(p);
Assert.AreSame(p, a.Pose);
}
示例4: SetsActorRef
public void SetsActorRef()
{
Actor a = new Actor();
MyBehavior b = new MyBehavior();
a.Add(b);
Assert.AreSame(a, b.Actor);
}