public void OnButtonClick(string ButtonName) { SoundController.Static.PlayClickSound(); switch (ButtonName) { case "Back": ControlSelection.SetActive(false); LevelSelection.SetActive(true); break; case "Accel": selectedMode = controls.tilt; LoadingMenu.SetActive(true); ControlSelection.SetActive(false); break; case "Button": selectedMode = controls.buttons; LoadingMenu.SetActive(true); ControlSelection.SetActive(false); break; } }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Space)) { this.CompleteLevel(); } if (Input.GetKeyDown(KeyCode.Return)) { this.hero.Caffeinate(5f); this.autoplay = true; } if (Input.GetKeyDown(KeyCode.A)) { this.autoplay = !this.autoplay; } if (Input.GetKeyDown(KeyCode.C)) { this.hero.Caffeinate(); } if (this.autoplay || Input.GetKeyDown(KeyCode.M)) { this.AutoMatch(); } this.autoplay = this.autoplay || LevelSelection.IsAutoplaying(); }
public void OnButtonClick(string ButtonName) { SoundController.Static.PlayClickSound(); switch (ButtonName) { case "Back": carSelectionParent.SetActive(true); LevelSelection.SetActive(false); CarMeshparent.SetActive(true); break; case "highway": levelName = "highWayGameplay"; ControlSelection.SetActive(true); LevelSelection.SetActive(false); break; case "city": levelName = "cityGameplay"; ControlSelection.SetActive(true); LevelSelection.SetActive(false); break; } }
public void OnStateChange() { var currentState = GameController.GetInstance().GetGameState(); ResetMenue(); switch (currentState) { case GameController.GAME_STATE.GAME_GAMEPLAY: { HUDMenue.SetActive(true); mainScoreText.text = GameController.GetInstance().GetScore().ToString(); currentTouchCount.text = GameController.GetInstance().GetTouchCount().ToString(); } break; case GameController.GAME_STATE.GAME_LEVEL_SELECT: { levelSelectMenu.SetActive(true); LevelSelection.GetInstance().UnlockLevel(GameController.GetInstance().GetScore()); } break; case GameController.GAME_STATE.GAME_RESULTS: { popUpMenu.SetActive(true); } break; case GameController.GAME_STATE.Game_PAUSE: { HUDMenue.SetActive(true); mainScoreText.text = GameController.GetInstance().GetScore().ToString(); currentTouchCount.text = GameController.GetInstance().GetTouchCount().ToString(); } break; } }
private void ConfigureFirstStep() { CurrentStepObject = Instantiate(LevelSteps[0]); CurrentStep = CurrentStepObject.GetComponent <AddressingStep>(); CurrentStepObject.transform.parent = this.transform; PlaceInBox(CurrentStepObject); IncorrectCircles = LoadGrayNotes(CurrentStepObject, CurrentStep, out CorrectCircle); firstNoteHeight = CurrentStep.FirstNoteCollider.bounds.center.y; //if (((levelNumber == 3) || (levelNumber == 4)) || // ((levelNumber == 5 || levelNumber == 6) && (Random.value < 0.5f))) //{ // SuperdogText.text = "Swing to the note " + // GetDifferential(CurrentStep.StartNote, CurrentStep.Notes[CurrentStep.CorrectIndex]) + // " the note you're hanging from!"; //} //else //{ // SuperdogText.text = "Swing to the " + CurrentStep.Notes[CurrentStep.CorrectIndex] + "!"; //} if (!IsFirstLevel && LevelSelection.IsAutoplaying()) { CorrectCircleClicked(CorrectCircle); } }
public LevelData(LevelSelection ls) { levelAccessible = ls.getLevelAccessible(); levelPassed = ls.getLevelPassed(); score = ls.getScore(); index = ls.getIndex(); }
private void Start() { instance = this; if (PlayerPrefs.GetInt("Level60") == 1) { Panel(4); } else if (PlayerPrefs.GetInt("Level45") == 1) { Panel(3); } else if (PlayerPrefs.GetInt("Level30") == 1) { Panel(2); } else if (PlayerPrefs.GetInt("Level15") == 1) { Panel(1); } else { Panel(0); } Invoke("GetTotalStars", 0.01f); }
// Use this for initialization void Start () { mLevelSelectionController = LevelSelection.Instance; if (LevelScene == "level1") { SelectLevelObject(); } }
public void Init(LevelSelection levelSelection, int startIndex, string name) { this.levelSelection = levelSelection; textMesh.text = name; CalculatePositionAndRotationFromIndex(startIndex); PortToTarget(); }
private IEnumerator Tutorial() { if (TutorialIndex == TutorialMessages.Length) { SuperdogButton.gameObject.SetActive(false); StartCoroutine(Transition.TransitionBrightness(gameObject, Superdog, tutorialFadeTime, Dark, Bright)); yield return(Transition.FadeOut(SuperdogText.gameObject, tutorialFadeTime, false)); SuperdogText.text = "Swing to the " + CurrentStep.Notes[CurrentStep.CorrectIndex] + "!"; yield return(Transition.FadeIn(SuperdogText.gameObject, tutorialFadeTime, false)); if (LevelSelection.IsAutoplaying()) { CorrectCircleClicked(CorrectCircle); } } else if (TutorialIndex == 0) { SuperdogDialogue.SetActive(true); SuperdogButton.gameObject.SetActive(true); SuperdogText.text = TutorialMessages[TutorialIndex++]; InTutorial = true; StartCoroutine(Transition.FadeIn(SuperdogDialogue, tutorialFadeTime, false)); yield return(Transition.TransitionBrightness(gameObject, Superdog, tutorialFadeTime, Bright, Dark)); if (LevelSelection.IsAutoplaying()) { TutorialNextButtonPressed(); } } else { SuperdogButton.gameObject.SetActive(false); yield return(Transition.FadeOut(SuperdogText.gameObject, tutorialFadeTime, false)); SuperdogText.text = TutorialMessages[TutorialIndex++]; if (TutorialIndex == 3) { StartCoroutine(Transition.TransitionBrightness(CurrentStepObject, null, tutorialFadeTime, Dark, Bright)); } else if (TutorialIndex == 4) { StartCoroutine(Transition.TransitionBrightness(CurrentStepObject, null, tutorialFadeTime, Bright, Dark)); } yield return(Transition.FadeIn(SuperdogText.gameObject, tutorialFadeTime, false)); yield return(new WaitForSeconds(tutorialFadeTime)); if (TutorialIndex == TutorialMessages.Length) { SuperdogButton.GetComponentInChildren <Text>().text = "Let's go!"; } SuperdogButton.gameObject.SetActive(true); if (LevelSelection.IsAutoplaying()) { TutorialNextButtonPressed(); } } }
public GameSettings() { _gameMode = GameMode.Adventure; _numberOfPlayers = NumberOfPlayersSelected.OnePlayer; _levelSelected = LevelSelection.Tropical; _adventureMode = AdventureMode.Continue; _gameSave = GameSave.SaveFile1; }
public void Begin() { string name = NameInputField.text.ToLower(); Logger.Instance.UserID = name; LevelSelection.SetVersion(GameVersion.GetVersion(name)); Session.LoadLevel("IntroCutscene1"); }
public GameSettings() { _gameMode = GameMode.Adventure; _numberOfPlayers = NumberOfPlayersSelected.OnePlayer; _levelSelected = LevelSelection.Tropical; _adventureMode = AdventureMode.Continue; _gameSave = GameSave.SaveFile1; }
public void AllWavesFinished() { if (_gameState == GameState.Running) { _gameState = GameState.Won; LevelSelection.UnlockNextLevel(); } }
void Start() { CurrentLevel = LiftLevel.Level_00; CurrentLiftState = LiftState.notMoving; CurrentLiftSelection = LevelSelection.LvlUnselected; LiftAnim = Lift.GetComponent <Animator>(); }
// Use this for initialization void OnEnable() { //mngr = FindObjectOfType<AudioManager> (); matchEnded = false; // default value, stays at 42 if nobody won // 0, 1, 2 and 3 are reserved to players winner = 42; lvlSelect = FindObjectOfType <LevelSelection> (); }
void Awake() { GetComponentInChildren <Text> ().text = level.ToString(); if (!LevelSelection.IsLevelUnlocked(level)) { GetComponent <Button> ().interactable = false; GetComponentInChildren <Text> ().color = Color.gray; } }
public IEnumerator BonusLevel(uint bonusIndex) { Logger.Instance.LogAction("BonusLevel", "Start", bonusIndex.ToString()); LoadOptions(BonusLevels[bonusIndex]); ShowObject(this.gameObject); HearBox1Initial = HearBox1.transform.localPosition; HearBox2Initial = HearBox2.transform.localPosition; SeeBox1Initial = SeeBox1.transform.localPosition; SeeBox2Initial = SeeBox2.transform.localPosition; bool showLowerUI = (TutorialOverlay == null); HearBox1.SetActive(showLowerUI); HearBox2.SetActive(showLowerUI); SeeBox1.SetActive(showLowerUI); SeeBox2.SetActive(showLowerUI); Captions.SetActive(showLowerUI); HideObject(HearBubbles); HideObject(SeeBubbles); HideObject(SelectionPane); HideObject(GlowCloud); SeeBox1.GetComponentInChildren <SpriteRenderer>().enabled = false; SeeBox2.GetComponentInChildren <SpriteRenderer>().enabled = false; HearBox1.GetComponentInChildren <SpriteRenderer>().enabled = false; HearBox2.GetComponentInChildren <SpriteRenderer>().enabled = false; Selection.MusicSelectionMade = false; Selection.StorySelectionMade = false; yield return(Show()); if (LevelSelection.IsAutoplaying()) { yield return(new WaitForSeconds(0.4f)); DismissTutorialOverlay(); yield return(new WaitForSeconds(0.4f)); SelectMusic(1 + (int)(2 * Random.value)); yield return(new WaitForSeconds(0.4f)); SelectStory(1 + (int)(2 * Random.value)); } yield return(new WaitUntil(SelectionMade)); Captions.SetActive(false); yield return(ShowSelection()); yield return(Hide()); }
private void Start() { theLM = FindObjectOfType <LevelManager>(); levelSelect = FindObjectOfType <LevelSelection>(); theUnlockableCrate = FindObjectOfType <UnlockCrate>(); if (!theUnlockableCrate) { Debug.LogWarning("The UnlockCrate object is not found on this level."); } }
public void BeginNonIntegrated() { string name = NameInputField.text.ToLower(); Logger.Instance.UserID = name; GameVersion.T version = GameVersion.T.NotIntegrated; Logger.Instance.LogAction("Version", "Non-Integrated", name); LevelSelection.SetVersion(version); Commands.AutoplayReady = true; Session.LoadLevel("IntroCutscene1"); }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } }
public void SetUp(LevelSelection master, float scale, float visible, LevelPosition pos = LevelPosition.CENTER, bool hideAll = false) { defaultScale = scale; levelPos = pos; tempColor = image.color; levelMaster = master; tempColor.a = visible; image.color = tempColor; levelTransform.localScale = new Vector3(scale, scale, scale); SetItemsVisibility(hideAll); }
void Start() { SceneTransitionValues.lastMenuName = SceneManager.GetActiveScene().name; SaveLoadManager.Load(); if (SceneTransitionValues.gameLoadedForTheFirstTime) { LevelSelection.ManageLevels(); SceneTransitionValues.gameLoadedForTheFirstTime = false; } }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
//level Selection button click events public void LevelOnClick(int selectedLevel) { if (selectedLevel > LevelSelection.GetInstance().GetMaxLevel()) { Debug.Log("Max Level" + selectedLevel + ">" + LevelSelection.GetInstance().GetMaxLevel()); } else { LevelSelection.GetInstance().LoadLevel(selectedLevel); levelSelectMenu.SetActive(false); GameController.GetInstance().ChangeGameState(GameController.GAME_STATE.GAME_GAMEPLAY); } }
private IEnumerator CompleteLevel() { GameObject measureObject = CurrentStepObject.GetComponentInChildren <SpriteRenderer>().gameObject; StartCoroutine(Transition.Translate(measureObject.transform, 6f * Vector3.back, 0.6f)); yield return(Transition.TransitionBrightness(gameObject, measureObject, 0.6f, Bright, Dark)); LastMeasureSource.time = 0f; LastMeasureSource.loop = false; LastMeasureSource.Play(); LevelSelection.AddressingLevelCompleted(this.levelNumber, measureObject.transform, this); }
private void Awake() { if (instance != null && instance != this.gameObject) { Destroy(this.gameObject); return; } else { instance = this; DontDestroyOnLoad(this.gameObject); } }
private IEnumerator CompleteLevelAsync() { GameManager.currentLevel = (int)(this.levelNumber + 1); // Move the measure to the center of the screen float moveTime = LevelManager.Constants.measureCenterTime; float currentTime = 0f; Vector3 measureStart = this.measureTransform.position; Vector3 measureEnd = new Vector3(0, 0, -9); Vector3 measureScaleStart = this.measureTransform.localScale; Vector3 measureScaleEnd = measureScaleStart * 1.5f; this.DimChildren(this.gameObject); float t; while (currentTime <= moveTime) { t = currentTime / moveTime; t = t * t * t * (t * (6f * t - 15f) + 10f); this.measureTransform.position = Vector3.Lerp(measureStart, measureEnd, t); this.measureTransform.localScale = Vector3.Lerp(measureScaleStart, measureScaleEnd, t); yield return(new WaitForEndOfFrame()); currentTime += Time.deltaTime; } this.measureTransform.position = measureEnd; // Play the final measure AudioClip clip = this.measureClip; this.backgroundAudioSource.clip = clip; this.backgroundAudioSource.volume = 1f; this.backgroundAudioSource.Play(); yield return(new WaitForSeconds(clip.length + 0.2f)); this.SuperdimChildren(this.gameObject); // @DEPRECATED //DontDestroyOnLoad (this.measureTransform.gameObject); //GameManager.SetMeasure (this.measureTransform.gameObject, this.measureTransform); //SceneManager.LoadScene("LevelSelection"); LevelSelection.LevelCompleted(this.levelNumber, this.measureTransform, this); }
/// <summary> /// Initializes a new instance of the <see cref="Project2Game" /> class. /// </summary> public Project2Game(LevelSelection levelSelection) { // Creates a graphics manager. This is mandatory. graphicsDeviceManager = new GraphicsDeviceManager(this); // Setup the relative directory to the executable directory // for loading contents with the ContentManager Content.RootDirectory = "Content"; this.levelSelection = levelSelection; models = new Dictionary<string, Model>(); Score = 0; this.IsFixedTimeStep = !PersistentStateManager.dynamicTimestep; // note the NOT }
private IEnumerator CompleteLevel() { print("entered"); StartCoroutine(FadeInLevelComplete(flytime * 1.4f)); yield return(superdogController.FlySuperdogAway(flytime)); GameObject measureObject = CurrentStepObject.GetComponentInChildren <SpriteRenderer>().gameObject; StartCoroutine(Transition.Translate(measureObject.transform, 6f * Vector3.back, 0.6f)); yield return(Transition.TransitionBrightness(gameObject, measureObject, 0.6f, Bright, Dark)); yield return(Audio.PlayMeasure()); LevelSelection.LevelCompleted(this.levelNumber, measureObject.transform); }
// Update is called once per frame void Update() { // Handle left click if (Input.GetMouseButton(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit, 1000, ClickableLayer)) { var selectedGameObject = hit.collider.gameObject.transform; var levelName = selectedGameObject.name; LevelSelection.LoadLevel(levelName); } } }
public void SetLevelSelectButtonTo(float levelNumber) { Button startButtonComponent = levelSelectButton.GetComponent <Button>(); startButtonComponent.interactable = levelIsUnlocked; LevelSelection levelSelectButtonScript = levelSelectButton.GetComponent <LevelSelection>(); levelSelectButtonScript.currentlySelectedLevelNumber = levelNumber; foreach (CompletedLevels level in levelManager.completedLevelList) { if (level.levelUnlocked == levelNumber) { bestTime.StringToImages(level.bestTime); } } }
void OnMouseUpAsButton() { if (Level.level < LevelSelection.numLevel) { Level.level += 1; Application.LoadLevel("Level"); } else { if (LevelSelection.hasNextWorld()) { LevelSelection.worldComplete = true; } Application.LoadLevel("LevelSelection"); } }
void FlickDown() { if (currentSelectedLevel == LevelSelection.NULL) { if (hoveredOverLevel == LevelSelection.LEVEL1) { hoveredOverLevel = LevelSelection.LEVEL2; LevelBackLight.transform.localPosition = levelPanelPositions[2]; } else if (hoveredOverLevel == LevelSelection.LEVEL2) { hoveredOverLevel = LevelSelection.LEVEL3; LevelBackLight.transform.localPosition = levelPanelPositions[4]; } else if (hoveredOverLevel == LevelSelection.LEVEL3) { hoveredOverLevel = LevelSelection.LEVEL1; LevelBackLight.transform.localPosition = levelPanelPositions[0]; } } else { if (hoveredOverDifficulty == DifficultySelection.EASY) { hoveredOverDifficulty = DifficultySelection.MEDIUM; LevelBackLight.transform.localPosition = levelPanelPositions[3]; } else if (hoveredOverDifficulty == DifficultySelection.MEDIUM) { hoveredOverDifficulty = DifficultySelection.HARD; LevelBackLight.transform.localPosition = levelPanelPositions[5]; } else if (hoveredOverDifficulty == DifficultySelection.HARD) { hoveredOverDifficulty = DifficultySelection.EASY; LevelBackLight.transform.localPosition = levelPanelPositions[1]; } } }
// Use this for initialization void Start() { manager = GameObject.Find("CanvasManager").GetComponent<MenuScript>(); hoveredOverLevel = LevelSelection.LEVEL1; hoveredOverDifficulty = DifficultySelection.EASY; currentSelectedLevel = LevelSelection.NULL; currentSelectedDifficulty = DifficultySelection.NULL; levelPanelPositions = new Vector3[6]; levelPanelPositions[0] = new Vector3(-270, 250, 0); levelPanelPositions[1] = new Vector3(270, 250, 0); levelPanelPositions[2] = new Vector3(-430, 0, 0); levelPanelPositions[3] = new Vector3(430, 0, 0); levelPanelPositions[4] = new Vector3(-270, -250, 0); levelPanelPositions[5] = new Vector3(270, -250, 0); LevelBackLight = GameObject.Find ("LevelBackLight"); }
// Update is called once per frame void Update() { selectionCooldown -= Time.deltaTime; Vector2 stickPos; stickPos.x = Input.GetAxis("LeftStickX"); stickPos.y = -Input.GetAxis("LeftStickY"); if ((stickPos.y > 0.1f || Input.GetKey(KeyCode.W)) && selectionCooldown <= 0.0f) { Instantiate(switchSound); FlickUp(); selectionCooldown = 0.2f; } if ((stickPos.y < -0.1f || Input.GetKey(KeyCode.S)) && selectionCooldown <= 0.0f) { Instantiate(switchSound); FlickDown(); selectionCooldown = 0.2f; } if (Input.GetButtonDown("A") || Input.GetKeyDown(KeyCode.Space)) { Instantiate(acceptSound); if (currentSelectedLevel == LevelSelection.NULL) { switch (hoveredOverLevel) { case LevelSelection.LEVEL1: currentSelectedLevel = LevelSelection.LEVEL1; break; case LevelSelection.LEVEL2: currentSelectedLevel = LevelSelection.LEVEL2; break; case LevelSelection.LEVEL3: currentSelectedLevel = LevelSelection.LEVEL3; break; case LevelSelection.NULL: break; default: break; } if (hoveredOverDifficulty == DifficultySelection.EASY) { LevelBackLight.transform.localPosition = levelPanelPositions[1]; } else if (hoveredOverDifficulty == DifficultySelection.MEDIUM) { LevelBackLight.transform.localPosition = levelPanelPositions[3]; } else { LevelBackLight.transform.localPosition = levelPanelPositions[5]; } } else if (currentSelectedLevel != LevelSelection.NULL) { switch (hoveredOverDifficulty) { case DifficultySelection.EASY: currentSelectedDifficulty = DifficultySelection.EASY; break; case DifficultySelection.MEDIUM: currentSelectedDifficulty = DifficultySelection.MEDIUM; break; case DifficultySelection.HARD: currentSelectedDifficulty = DifficultySelection.HARD; break; case DifficultySelection.NULL: break; default: break; } } if (currentSelectedDifficulty != DifficultySelection.NULL) { //start level with chosen attributes GameObject persistentObject = (GameObject)Instantiate(levelData); PersistentData data = persistentObject.GetComponent<PersistentData>(); data.level = currentSelectedLevel; data.difficulty = currentSelectedDifficulty; if (currentSelectedLevel == LevelSelection.LEVEL1) Application.LoadLevel("TestScene"); else if (currentSelectedLevel == LevelSelection.LEVEL2) Application.LoadLevel("Level 1"); else if (currentSelectedLevel == LevelSelection.LEVEL3) Application.LoadLevel("Level 2"); } } if (Input.GetButtonDown("B") || Input.GetKeyDown(KeyCode.Backspace)) { Instantiate(backSound); if (currentSelectedLevel == LevelSelection.NULL) { manager.Load("MainMenu"); gameObject.SetActive(false); } else { currentSelectedLevel = LevelSelection.NULL; if (hoveredOverLevel == LevelSelection.LEVEL1) { LevelBackLight.transform.localPosition = levelPanelPositions[0]; } else if (hoveredOverLevel == LevelSelection.LEVEL2) { LevelBackLight.transform.localPosition = levelPanelPositions[2]; } else { LevelBackLight.transform.localPosition = levelPanelPositions[4]; } } } }
void Start() { if (Instance == null) { ScrollBarInitial = ScrollBar.transform.position; Instance = this; DontDestroyOnLoad(this); DontDestroyOnLoad(this.gameObject); LevelsCompleted = 0; //Version = GameVersion.T.NotIntegrated; SetDerivedParameters(); Objects = new LLIObject[Instance.LevelList.Length]; StartCoroutine(LoadLevelList()); } else { Debug.LogError("Duplicate LevelSelection created"); } }