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; }
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)); } }