public ScanningScreen init(ExploreScreen exploreScreen, StatusScreen statusScreen, ItemDescriptor itemDescriptor) { this.exploreScreen = exploreScreen; fightScreen = GameObject.Find("Fight Screen").GetComponent <FightScreen>().init(this, statusScreen, itemDescriptor); scanningDetails = transform.Find("Scanning Details").GetComponent <ScanningDetails>().init(this); statusScreen.cabin.scanningScreen = this; cursor = transform.Find("Cursor").transform; cursor.gameObject.SetActive(true); closeBtn = transform.Find("Close Button").GetComponent <Button>().init(); transform.Find("Background").gameObject.SetActive(true); markersHolder = transform.Find("Markers Holder"); holderCenter = markersHolder.localPosition; Transform barsHolder = transform.Find("Bars Holder"); barBlocks = new GameObject[barsHolder.childCount]; char[] separ = new char[] { ' ' }; int pos; for (int i = 0; i < barsHolder.childCount; i++) { pos = int.Parse(barsHolder.GetChild(i).name.Split(separ, int.MaxValue)[2]); barBlocks[i] = barsHolder.GetChild(i).gameObject; } barsHolder.gameObject.SetActive(true); // Transform blockHolder = transform.Find("Enemy Blocks"); // enemyBlocks = new EnemyBlock[blockHolder.childCount]; // EnemyBlock block; // for (int i = 0; i < blockHolder.childCount; i++) { // block = blockHolder.GetChild(i).GetComponent<EnemyBlock>().init(this); // enemyBlocks[block.index] = block; // } // blockHolder.gameObject.SetActive(true); markersHolder.gameObject.SetActive(true); foreach (EnemyType eType in Enum.GetValues(typeof(EnemyType))) { if (eType.planet() == Vars.planetType) { enemyTypes.Add(eType); } } isActive = true; close(); return(this); }
// private AnnouncementScreen announcementScreen; void Awake() { Vars.initVars(); Vars.inSpace = false; ItemFactory.itemPrefab = itemPrefab; Imager.initialize(); Player.init(); GameObject.Find("Images Provider").GetComponent <ImagesProvider>().init(); background = transform.Find("Background").GetComponent <Background>().init(); // announcementsBtn = transform.Find("Announcements Button").GetComponent<Button>().init(); marketBtn = transform.Find("Market Button").GetComponent <Button>().init(); hangarBtn = transform.Find("Hangar Button").GetComponent <Button>().init(); // industrialBtn = transform.Find("Industrial Button").GetComponent<Button>().init(); leaveBtn = transform.Find("Leave Button").GetComponent <Button>().init(); btns = new Button[] { marketBtn, hangarBtn, leaveBtn }; //announcementsBtn, industrialBtn, PlanetSurface.topHideable = this; ItemDescriptor descriptor = GameObject.Find("Item Descriptor").GetComponent <ItemDescriptor>().init(); statusScreen = GameObject.Find("Status Screen").GetComponent <StatusScreen>().init(null, descriptor); descriptor.playerData = statusScreen.playerData; Vars.userInterface = GameObject.FindGameObjectWithTag("UserInterface").GetComponent <UserInterface>().init(statusScreen); // messageBox = GameObject.Find("Message Box").GetComponent<MessageBox>(); story = GameObject.Find("Story Teller").GetComponent <Story>().init(this); // announcementScreen = GameObject.Find("Announcement Screen").GetComponent<AnnouncementScreen>().init(this, statusScreen.cabin); exploreScreen = GameObject.Find("Explore Screen").GetComponent <ExploreScreen>().init(this, statusScreen, descriptor); market = GameObject.Find("Equipments Market").GetComponent <EquipmentsMarket> ().init(this, statusScreen.inventory, descriptor); hangarScreen = GameObject.Find("Hangar Screen").GetComponent <HangarScreen>().init(this, statusScreen.inventory, statusScreen.shipData); // industrialScreen = GameObject.Find("Industrial Screen").GetComponent<IndustrialScreen>().init(this); // messageBox.init(this); if (Vars.shipCurrentHealth == -1) { startNewGame(); } landPlanet(); }
public ExplorerPresenter(ExploreScreen screen) { this.screen = screen; searchBar = screen.SearchBar; }