本文整理汇总了C#中Scene.AddEntityToScene方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.AddEntityToScene方法的具体用法?C# Scene.AddEntityToScene怎么用?C# Scene.AddEntityToScene使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scene
的用法示例。
在下文中一共展示了Scene.AddEntityToScene方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartTest
void StartTest()
{
GameObject sceneRoot = new GameObject("SceneRoot");
scene = sceneRoot.AddComponent<Scene>();
scene.Init();
scene.Load("Settings/test.map");
scene.StartScene();
SceneManager.Init();
SceneManager.Instance.SwitchTo(scene);
float mapWidth = scene.Map.Width;
float mapHeight = scene.Map.Height;
for (int i = 0; i < 100; ++i)
{
MonsterEntity monsterEntity = scene.CreateMonsterEntity(0);
scene.AddEntityToScene(monsterEntity, new Vector3(Random.value * mapWidth, Random.value * mapHeight, 0));
}
tower = scene.CreateTowerEntity(0);
tower.ShowDebugDraw = true;
scene.AddEntityToScene(tower, new Vector3(mapWidth / 2, mapHeight / 2, 0));
towerAtk = tower.AttrComp.AtkBase;
towerAtkSpeed = tower.AttrComp.AtkSpeedBase;
towerAtkRange = tower.AttrComp.AtkRangeBase;
}
示例2: StartTest
void StartTest()
{
GameObject sceneRoot = new GameObject("SceneRoot");
scene = sceneRoot.AddComponent<Scene>();
scene.Init();
//SceneSetting sceneSetting = new SceneSetting(true);
//sceneSetting.Map.CellCountX = 10;
//sceneSetting.Map.CellCountY = 10;
//scene.Load(sceneSetting);
scene.Load("Settings/test.map");
float mapWidth = scene.Map.Width;
float mapHeight = scene.Map.Height;
position = new Vector3(mapWidth / 2, mapHeight / 2, 0);
for (int i = 0; i < 100; ++i)
{
MonsterEntity monsterEntity = scene.CreateMonsterEntity(0);
scene.AddEntityToScene(monsterEntity, new Vector3(Random.value * mapWidth, Random.value * mapHeight, 0));
}
}