void Awake() { playerInstance = GameObject.Find("Player").GetComponent <Player>(); gameControlInstance = gc.GetComponent <GameControl> (); gameControlGUIInstance = gc.GetComponent <GameControlGUI> (); shopControlInstance = gc.GetComponent <ShopControl> (); shopControlGUIInstance = gc.GetComponent <ShopControlGUI> (); clickControlInstance = gc.GetComponent <ClickControl> (); gridControlInstance = gc.GetComponent <GridControl>(); optionControlInstance = gc.GetComponent <OptionControl>(); dragControlInstance = gc.GetComponent <DragControl>(); eventGUIInstance = gc.GetComponent <EventGUI>(); enemyLibraryInstance = gc.GetComponent <EnemyLibrary>(); cardLibraryInstance = gc.GetComponent <CardLibrary>(); goalLibraryInstance = gc.GetComponent <GoalLibrary>(); guiStyleLibraryInstance = gc.GetComponent <GUIStyleLibrary>(); mainMenuInstance = gc.GetComponent <MainMenu>(); encyclopediaMenuInstance = gc.GetComponent <EncyclopediaMenu>(); godChoiceMenuInstance = gc.GetComponent <GodChoiceMenu>(); customizeMenuInstance = gc.GetComponent <CustomizeMenu>(); gridCursorControlInstance = gc.GetComponent <GridCursorControl>(); menuControlInstance = gc.GetComponent <MenuControl>(); tutorialInstance = gc.GetComponent <Tutorial>(); deckAnimateInstance = deck.GetComponent <DeckAnimate>(); shopAndGoalParentCanvasInstance = goalandshopparent .GetComponent <ShopAndGoalParentCanvas>(); shopGridCanvasInstance = shopgrid .GetComponent <ShopGridCanvas>(); gridCursorControlGUIInstance = gridcursorcontrolgui .GetComponent <GridCursorControlGUI>(); }
public Goal[] InitializeGoals(int numberOfGods) { unusedGoals = new List <Goal> (); GodChoiceMenu menu = gameObject.GetComponent <GodChoiceMenu> (); //If godchoicemenu is unlocked, pick from the selected gods' goals; otherwise, pick from all goals if (SaveDataControl.UnlockedGods.Count == 7) { for (int i = 0; i < allGoals.Count; i++) { for (int j = 0; j < menu.GodChoiceSelection.Length; j++) { if (menu.GodChoiceSelection[j] && allGoals[i].God == ShopControl.AllGods[j]) { unusedGoals.Add(allGoals[i]); } } } } else { for (int i = 0; i < allGoals.Count; i++) { unusedGoals.Add(allGoals[i]); } } Goal[] Goals = new Goal[numberOfGods]; for (int i = 0; i < numberOfGods; i++) { Goals[i] = new Goal(); int randomNumber = Random.Range(0, unusedGoals.Count); Goals[i] = unusedGoals[randomNumber]; unusedGoals.RemoveAt(randomNumber); } return(Goals); }
void Awake() { playerInstance = GameObject.Find("Player").GetComponent<Player>(); gameControlInstance = gc.GetComponent<GameControl> (); gameControlGUIInstance = gc.GetComponent<GameControlGUI> (); shopControlInstance = gc.GetComponent<ShopControl> (); shopControlGUIInstance = gc.GetComponent<ShopControlGUI> (); clickControlInstance = gc.GetComponent<ClickControl> (); gridControlInstance = gc.GetComponent<GridControl>(); optionControlInstance = gc.GetComponent<OptionControl>(); dragControlInstance = gc.GetComponent<DragControl>(); eventGUIInstance = gc.GetComponent<EventGUI>(); enemyLibraryInstance = gc.GetComponent<EnemyLibrary>(); cardLibraryInstance = gc.GetComponent<CardLibrary>(); goalLibraryInstance = gc.GetComponent<GoalLibrary>(); guiStyleLibraryInstance = gc.GetComponent<GUIStyleLibrary>(); mainMenuInstance = gc.GetComponent<MainMenu>(); encyclopediaMenuInstance = gc.GetComponent<EncyclopediaMenu>(); godChoiceMenuInstance = gc.GetComponent<GodChoiceMenu>(); customizeMenuInstance = gc.GetComponent<CustomizeMenu>(); gridCursorControlInstance = gc.GetComponent<GridCursorControl>(); menuControlInstance = gc.GetComponent<MenuControl>(); tutorialInstance = gc.GetComponent<Tutorial>(); deckAnimateInstance = deck.GetComponent<DeckAnimate>(); shopAndGoalParentCanvasInstance = goalandshopparent .GetComponent<ShopAndGoalParentCanvas>(); shopGridCanvasInstance = shopgrid .GetComponent<ShopGridCanvas>(); gridCursorControlGUIInstance = gridcursorcontrolgui .GetComponent<GridCursorControlGUI>(); }