public virtual void NextPage() { if (next) { menuManager.ActivateMenu(next); } }
/* select a star/planet/moon */ private void SelectObject() { selectedObject = interactingHand.Select(); if (selectedObject) { if (selectedObject.CompareTag("InitialStar")) { menuManager.ActivateMenu(MenuManager.MenuType.PrimeStar); } else if (selectedObject.CompareTag("RegularStar")) { menuManager.ActivateMenu(MenuManager.MenuType.RegularStar); } else if (selectedObject.CompareTag("Planet")) { menuManager.ActivateMenu(MenuManager.MenuType.Planet); } else if (selectedObject.CompareTag("Moon")) { menuManager.ActivateMenu(MenuManager.MenuType.Moon); } } else { menuManager.ActivateMenu(MenuManager.MenuType.Edit); sceneManager.SetEditMode(); } }
// Update is called once per frame void Update() { if (Input.GetButtonDown("Start")) { if (PlayerMovement.instance.canMove && !paused && !VD.isActive) { Pause(); } else if (paused && menuManager.menuObjects[0].activeSelf) { Unpause(); } } if (Input.GetButtonDown("Cancel")) { if (paused) { if (currentlyInMapSelection) { ExitMapSelection(); } else { menuManager.ActivateMenu(0); Unpause(); } } } }
public void Update() { if (gameObject.activeSelf && Input.GetKeyDown(KeyCode.Space)) { _menuManager.ActivateMenu(MenuManager.Menu.Hud); } }
public void Update() { if (enemyManager.EnemyAmt == 0 && menuManager.ActiveMenu == MenuManager.Menu.Hud) { menuManager.ActivateMenu(MenuManager.Menu.Resolution); } }
public void Update() { if (gameObject.activeSelf && Input.GetKeyDown(KeyCode.U)) { _lastTimeStamp = Time.time; _menuManager.ActivateMenu(MenuManager.Menu.Hud); //Reload level and spawn everything print("Reenter playmode to restart please!!"); } }
public void Update() { if (gameObject.activeSelf) { AnimateInsertCoin(); } if (Input.GetKeyDown(KeyCode.W)) { _menuManager.ActivateMenu(MenuManager.Menu.Hud); } }
/* */ private void Start() { menuManager = GetComponent <MenuManager>(); //menuManager.InitMenus(); templates = new Dictionary <CelestialType, OrbitingBody> { { CelestialType.Star, starTemplate }, { CelestialType.Planet, planetTemplate }, { CelestialType.Moon, moonTemplate } }; /* user stars in edit mode */ menuManager.ActivateMenu(MenuManager.MenuType.Edit); this.SetEditMode(); // for testing //user.SelectInitStar(initialStar); if (debugMode) { UpdateDisplayInfo(); } }
public void HandleGameEvent(int id) { switch (id) { case 0: GeorgeFlurPicture.SetActive(true); GeorgeFlur = GameObject.FindGameObjectWithTag("GeorgeFlur"); MenuManager.ActivateMenu(); goalManager.ProgressGoal("George"); gameState.georgerFlowId++; cutscene.PlayWalkCutscene(GeorgeFlur, new Vector3(-4.07f, 0.13f, 3.1f), new Vector3(-5.05f, 0.13f, 1f)); break; case 2: eventManager.InvokeInteract(2); Boxes = GameObject.FindGameObjectWithTag("Boxes").GetComponent <InteractObject>(); Boxes.hasItem = true; Boxes.inspectText = new List <string>() { "Leckerlies!", "Ich hab viel zu kurze Arme" }; break; case 3: FredKitchenPicture.SetActive(true); MenuManager.ActivateMenu(); FredKitchen = GameObject.FindGameObjectWithTag("FredKitchen"); goalManager.ProgressGoal("Fred"); gameState.fredFlowId++; cutscene.PlayWalkCutscene(FredKitchen, new Vector3(-6, 0.5f, -5.5f), new Vector3(-5.5f, 0.5f, -0.5f)); break; case 4: GeorgeFlur = GameObject.FindGameObjectWithTag("GeorgeFlur"); goalManager.ProgressGoal("George"); gameState.georgerFlowId++; cutscene.PlayWalkCutscene(GeorgeFlur, new Vector3(-9.71f, 3.42f, 1f), new Vector3(-9.18f, 3.42f, 4.31f)); break; case 5: FredMama = GameObject.FindGameObjectWithTag("FredMama"); FredMamaPicture.SetActive(true); MenuManager.ActivateMenu(); goalManager.ProgressGoal("Fred"); gameState.fredFlowId++; cutscene.PlayWalkCutscene(FredMama, new Vector3(-6.48f, 3.26f, -5.5f), new Vector3(-8.5f, 3.15f, -1.3f)); break; case 6: eventManager.InvokeInteract(3); break; case 7: //cutscene var GeorgeMama = GameObject.FindGameObjectsWithTag("GeorgeFlur").First(); goalManager.ProgressGoal("George"); gameState.georgerFlowId++; MenuManager.ActivateMenu(); GeorgeMamaPicture.SetActive(true); cutscene.PlayWalkCutscene(GeorgeMama, new Vector3(-12.28f, 3.15f, -5.41f), new Vector3(-8.5f, 3.15f, -1.3f)); if (gameState.fredFlowId == 2) { MenuManager.ActivateMenu(); WinPicture.SetActive(true); } break; case 8: FredKitchen = GameObject.FindGameObjectWithTag("FredKitchen"); goalManager.ProgressGoal("Fred"); gameState.fredFlowId++; cutscene.PlayWalkCutscene(FredKitchen, new Vector3(-13.81f, 3.3f, 11.3f), new Vector3(-12.35f, 1.99f, 6.83f)); if (gameState.georgerFlowId == 2) { MenuManager.ActivateMenu(); WinPicture.SetActive(true); } break; default: break; } }
public GameStates CheckCurrentGameState() { switch (gameStateCurrent) { case GameStates.BeginState: Level++; LevelUpdated?.Invoke(); menuManager.DeactivateMenu(); DAObjects(true); //Close the doors fast openLevelDoors.CloseDoors(1000f); //Spawn an Entity when the game begins GameObject _inst = spawnEntities.SpawnEntity(enemyObjects[0], enemySpawnPoints[0].position); //Add the instance as an child to this object for now (Make an pool object) //_inst.transform.parent = transform; entityAliveObjects.Add(_inst); //Add a target to the Entity _inst.GetComponent <EntityBehaviour>().targetObject = player; _inst.GetComponent <AITurnTo>().target = player.transform; //Start the game SetCurrentGameState(GameStates.InGameState); break; case GameStates.InGameState: openLevelDoors.CloseDoors(1000f); //Check if there are any Enemy Entities alive if (checkEntitiesAlive.CheckAmountEntitiesAlive(entityAliveObjects, TeamTypes.Enemy) == 0) { //If there arent any, The player has won this round SetCurrentGameState(GameStates.WinState); } if (checkEntitiesAlive.CheckAmountEntitiesAlive(entityAliveObjects, TeamTypes.Friendly) == 0) { //If there arent any, The player has won this round SetCurrentGameState(GameStates.LoseState); } break; case GameStates.WinState: openLevelDoors.OpenDoors(2f); break; case GameStates.LoseState: menuManager.ActivateMenu(); DAObjects(false); break; } return(gameStateCurrent); }