本文整理汇总了C#中Urho.Node.Translate方法的典型用法代码示例。如果您正苦于以下问题:C# Node.Translate方法的具体用法?C# Node.Translate怎么用?C# Node.Translate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Urho.Node
的用法示例。
在下文中一共展示了Node.Translate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
protected override async void Start()
{
base.Start();
environmentNode = Scene.CreateChild();
// Allow tap gesture
EnableGestureTapped = true;
// Create a bucket
bucketNode = Scene.CreateChild();
bucketNode.SetScale(0.1f);
// Create instructions
textNode = bucketNode.CreateChild();
var text3D = textNode.CreateComponent<Text3D>();
text3D.HorizontalAlignment = HorizontalAlignment.Center;
text3D.VerticalAlignment = VerticalAlignment.Top;
text3D.ViewMask = 0x80000000; //hide from raycasts
text3D.Text = "Place on a horizontal\n surface and click";
text3D.SetFont(CoreAssets.Fonts.AnonymousPro, 26);
text3D.SetColor(Color.White);
textNode.Translate(new Vector3(0, 3f, -0.5f));
// Model and Physics for the bucket
var bucketModel = bucketNode.CreateComponent<StaticModel>();
bucketMaterial = Material.FromColor(validPositionColor);
bucketModel.Model = ResourceCache.GetModel("Models/bucket.mdl");
bucketModel.SetMaterial(bucketMaterial);
bucketModel.ViewMask = 0x80000000; //hide from raycasts
bucketNode.CreateComponent<RigidBody>();
var shape = bucketNode.CreateComponent<CollisionShape>();
shape.SetTriangleMesh(bucketModel.Model, 0, Vector3.One, Vector3.Zero, Quaternion.Identity);
// Material for spatial surfaces
spatialMaterial = new Material();
spatialMaterial.SetTechnique(0, CoreAssets.Techniques.NoTextureUnlitVCol, 1, 1);
// make sure 'spatialMapping' capabilaty is enabled in the app manifest.
var spatialMappingAllowed = await StartSpatialMapping(new Vector3(50, 50, 10), 1200);
}