// Use this for initialization void Start() { //var master = FindObjectOfType<MasterMindTranslate>(); var master = FindObjectOfType<SynchronizeORCA>(); _playersCitadel = Controller.MyCitadel; _enemyCitadel = Controller.EnemyCitadel; XMLWorker.LoadSC(_enemyCitadel); PlayersCitadel = SteamCitadelMeshConstrutor.BuildCitadelMesh(_playersCitadel); EnemyCitadel = SteamCitadelMeshConstrutor.BuildCitadelMesh(_enemyCitadel); PlayersCitadel.transform.position = PlayerSpawn.transform.position; PlayersCitadel.transform.localScale = PlayerSpawn.transform.localScale; PlayersCitadel.transform.rotation = PlayerSpawn.transform.rotation; EnemyCitadel.transform.position = EnemySpawn.transform.position; EnemyCitadel.transform.localScale = EnemySpawn.transform.localScale; EnemyCitadel.transform.rotation = EnemySpawn.transform.rotation; /* var playerUnitGOs = new List<GameObject>(); foreach (var unit in _playersCitadel.Units) { unit.BuildMesh(); playerUnitGOs.Add(unit.GO); } var enemyUnitGOs = new List<GameObject>(); foreach (var unit in _enemyCitadel.Units) { unit.BuildMesh(); enemyUnitGOs.Add(unit.GO); }*/ var playerSpawnUnit = PlayersCitadel.AddComponent<SpawnUnit>(); playerSpawnUnit.Units = _playersCitadel.Units.ToArray (); playerSpawnUnit.SpawnPoint = _playersCitadel.Modules.FirstOrDefault(x => x.Type == GameModelsAndEnums.EnumModuleType.Constructor).GO.transform.FindChild("SpawnPoint"); playerSpawnUnit.Master = master; playerSpawnUnit.PointDown = _playersCitadel.Modules.FirstOrDefault(x => x.Type == GameModelsAndEnums.EnumModuleType.Constructor).GO.transform.FindChild("DownPoint"); playerSpawnUnit.PointMarch = EnemySpawn.transform; playerSpawnUnit.EnemySF = EnemyCitadel; playerSpawnUnit.SpawnArea = PlayerSpawnArea; playerSpawnUnit.Team = 0; var enemySpawnUnit = EnemyCitadel.AddComponent<SpawnUnit>(); enemySpawnUnit.Units = _enemyCitadel.Units.ToArray (); enemySpawnUnit.SpawnPoint = _enemyCitadel.Modules.FirstOrDefault(x => x.Type == GameModelsAndEnums.EnumModuleType.Constructor).GO.transform.FindChild("SpawnPoint"); enemySpawnUnit.Master = master; enemySpawnUnit.PointDown = _enemyCitadel.Modules.FirstOrDefault(x => x.Type == GameModelsAndEnums.EnumModuleType.Constructor).GO.transform.FindChild("DownPoint"); enemySpawnUnit.PointMarch = PlayerSpawn.transform; enemySpawnUnit.EnemySF = PlayersCitadel; enemySpawnUnit.SpawnArea = EnemySpawnArea; enemySpawnUnit.Team = 1; }
public void ShowUnitScreen() { var citadel = MyCitadel; CurrentCitadel = MyCitadel; if (!citadelToogle) { citadel = EnemyCitadel; CurrentCitadel = EnemyCitadel; } //var moduleScreen = FindObjectOfType<MangeSteamCitadelScreenController>(); var unitScreen = FindObjectOfType<ManageUnitsScreenController>(); //moduleScreen.gameObject.SetActive(false); unitScreen.ShowUnit(citadel.Units[0]); citadelToogle = !citadelToogle; }
public void NewCitadel() { MyCitadel = new SteamCitadel("PlayersSC"); MyCitadel.Modules.Add(new Module(MyCitadel.Name, "Platform1", "")); MyCitadel.Modules.Add(new Module(MyCitadel.Name, "Constructor1", "Constructor_Site")); MyCitadel.Modules.Add(new Module(MyCitadel.Name, "Engine1", "Engine_Site")); MyCitadel.Modules.Add(new Module(MyCitadel.Name, "Bridge1", "Bridge_Site")); MyCitadel.Modules.Add(new Module(MyCitadel.Name, "Storage1", "Storage_Site")); MyCitadel.Modules.Add(new Module(MyCitadel.Name, "Radar1", "Hypo_Site1")); MyCitadel.Modules.Add(new Module(MyCitadel.Name, "Weapon1", "Weapon_Site1")); MyCitadel.Modules.FirstOrDefault(x=>x.Workname == "Engine1").Subs.Add(new Subsystem(MyCitadel.Name, "Engine1", "Tube1", "Sub_Slot_A1 2")); MyCitadel.Units.Add(new Unit("Unit1")); MyCitadel.Units[0].Upgrades.Add(new UnitUpgrade(MyCitadel.Name, "Unit1","Upg1")); //XMLWorker.SaveUnit(MyCitadel.Name, "Unit1", new List<string>(1) { "Upg1" }); }
// Use this for initialization void Start() { _camera = FindObjectOfType<Camera>(); var citadel = new SteamCitadel("PlayersSC"); XMLWorker.LoadSC(citadel); CurrentCitadel = citadel; CurrentCitadel.BuildCitadelMesh(); CurrentCitadel.GO.transform.SetParent(MapTransform); CurrentCitadel.GO.transform.localPosition = Vector3.zero; CurrentCitadel.GO.AddComponent<BoxCollider>(); CurrentCitadel.GO.AddComponent<Rigidbody>().isKinematic = true; _agent = CurrentCitadel.GO.AddComponent<NavMeshAgent>(); _target = CurrentCitadel.GO.transform.position; //var controls = CurrentCitadel.GO.AddComponent<SimpleAgentScript>(); //controls.Target = CurrentCitadel.GO.transform; }
// Use this for initialization public void ShowCitadel(SteamCitadel citadel) { ManagementScreenGameObject.SetActive(true); SteamCitadelMeshConstrutor.BuildCitadelMesh(citadel); var citadelGO = citadel.GO; Camera cam = FindObjectOfType<Camera>(); var Center = new Vector3(0.056f,0.838f,-1.792f); CurrentManagingGameObject = citadelGO; CurrentManagingGameObject.transform.position = Center; CurrentManagingGameObject.transform.eulerAngles = new Vector3(0,150,0); _moduleButtons = new List<GameObject>(); _subButtons = new List<GameObject>(); AddModuleButtonByMesh(); foreach (var module in citadel.Modules) { FillButtonsWithModules(module); //FillButtonsWithModules(module); //var moduleButton = ModuleButtons[0]; //switch (module.Type) //{ // case GameModelsAndEnums.EnumModuleType.Engine: // moduleButton = ModuleButtons[0]; // break; // case GameModelsAndEnums.EnumModuleType.Bridge: // moduleButton = ModuleButtons[1]; // break; // case GameModelsAndEnums.EnumModuleType.Storage: // moduleButton = ModuleButtons[2]; // break; // case GameModelsAndEnums.EnumModuleType.Hypo: // moduleButton = ModuleButtons[3]; // break; // case GameModelsAndEnums.EnumModuleType.Constructor: // moduleButton = ModuleButtons[4]; // break; // case GameModelsAndEnums.EnumModuleType.Platform: // moduleButton = ModuleButtons[5]; // break; // case GameModelsAndEnums.EnumModuleType.Weapon: // moduleButton = ModuleButtons[6]; // break; //} //Debug.Log("Module - "+module.GO.name+"; Button - "+moduleButton); } }
// Use this for initialization void Start() { //NewCitadel(); Player = new Player(); Player.Subsystems.Add(new Subsystem("Box1")); Player.Subsystems.Add(new Subsystem("Tube1")); var citadel = new SteamCitadel("PlayersSC"); Player.Citadel = citadel; XMLWorker.LoadSC(citadel); EnemyCitadel = new SteamCitadel("EnemySC1"); XMLWorker.LoadSC(EnemyCitadel); CurrentCitadel = EnemyCitadel; MyCitadel = citadel; // CurrentCitadel.Inventory.Items.Add(new InventoryItem("Item1")); if (Application.loadedLevelName == "ModulesSetupScreen") { //ShowModulesScreen(CurrentCitadel); ShowUnitScreen(); } }
public void ShowModulesScreen(SteamCitadel citadel) { var moduleScreen = FindObjectOfType<ManageModulesScreen>(); moduleScreen.ShowCitadel(citadel); }