private void Update() { if (_state == State.Gameplay && _beatMap.IsReady()) { if (_beatMap.IsDone()) { _state = State.Result; playerData.SetMusicGrade(gradeList); _audioManager.TryPlay(); _currentDialog = resultDialog; _currentDialog.ApplyCharacter(_characterData); _currentDialog.Display(playerData, _characterData); return; } BeatObject beatObject = _beatMap.RequestDrawableBeat(); if (beatObject != null) { BeatRenderer beatRenderer = Instantiate(prefabBeat).GetComponent <BeatRenderer>(); beatRenderer.SetData(beatObject, _beatMap); beatRenderer.Init(); } BeatObjectGrade grade = _beatMap.React(false); if (grade == BeatObjectGrade.Miss) { gradeList.Add(grade); badAudio.Play(); Instantiate(prefabMiss); } } }
IEnumerator GameplayTimer() { _startTime = Time.time; yield return(new WaitForSeconds(gameplayDuration)); if (_inputGenerationCoroutine != null) { StopCoroutine(_inputGenerationCoroutine); } foreach (Transform child in transform) { CodingBug script = child.GetComponent <CodingBug>(); if (script != null) { script.enabled = false; } } _state = State.Result; playerAvatar.Freeze(); playerData.SetBugLeft(transform.childCount); _currentDialog = resultDialog; _currentDialog.ApplyCharacter(_characterData); _currentDialog.Display(playerData, _characterData); }
IEnumerator ShowDialogList() { for (var i = 0; i < _generatedList.Count; i++) { GameObject dialogItem = Instantiate(prefabDialogItem, dialogHolder.parent); dialogItem.transform.SetParent(dialogHolder); ScopeDialogItem script = dialogItem.GetComponent <ScopeDialogItem>(); script.SetData(playerData.GetRandomCharacter(), _generatedList[i].sentences); _dialogList.Add(dialogItem); if (_dialogList.Count > dialogCountLimit) { Destroy(_dialogList[0]); _dialogList.RemoveAt(0); } yield return(new WaitForSeconds(dialogListDelay)); } yield return(new WaitForSeconds(dialogListDelay * 2)); _state = State.Result; characterData = playerData.GetRandomCharacter(); _currentDialog = resultDialog; _currentDialog.ApplyCharacter(characterData); _currentDialog.Display(playerData, characterData); }
public override void Start() { base.Start(); playerData.Restart(); _state = State.Beginning; _currentDialog = beginningDialog; _currentDialog.ApplyCharacter(characterData); _currentDialog.Display(playerData, characterData); }
IEnumerator ShowPictureCoroutine() { GameObject theme = Instantiate(prefabTheme, canvas.transform, true); yield return(new WaitForSeconds(themeShowDuration)); _state = State.Result; _currentDialog = resultDialog; _currentDialog.ApplyCharacter(characterData); _currentDialog.Display(playerData, characterData); }
public override void Start() { base.Start(); _genDuration = maxGenDuration; _state = State.Beginning; _characterData = playerData.GetRandomCharacter(); _currentDialog = beginningDialog; _currentDialog.ApplyCharacter(_characterData); _currentDialog.Display(playerData, _characterData); }
public override void Start() { base.Start(); _state = State.Beginning; _dialogList = new List <GameObject>(); _characterData = playerData.GetRandomCharacter(); beginningDialog.ApplyCharacter(_characterData); beginningDialog.Display(playerData, _characterData); bobController.GetComponent <Rigidbody2D>().isKinematic = true; }
private void DisplayResult() { float scopeResult = bobController.transform.position.y; playerData.SetScopeResult(scopeResult); _resultDialog = scopeResult > 0 ? overScopeDialog : underScopeDialog; _characterData = playerData.GetRandomCharacter(); _resultDialog.ApplyCharacter(_characterData); _resultDialog.Display(playerData, _characterData); }
public override void Start() { base.Start(); StartCoroutine(GenerateDialogList()); _dialogList = new List <GameObject>(); _state = State.Beginning; characterData = playerData.GetRandomCharacter(); _currentDialog = beginningDialog; _currentDialog.ApplyCharacter(characterData); _currentDialog.Display(playerData, characterData); }
public override void Start() { base.Start(); _state = State.Beginning; _invLerpValue = 1f; _lerpValue = 0f; _characterData = playerData.GetRandomCharacter(); _currentDialog = beginningDialog; _currentDialog.ApplyCharacter(_characterData); _currentDialog.Display(playerData, _characterData); }
IEnumerator GameplayTimer() { _startTime = Time.time; yield return(new WaitForSeconds(gameplayDuration)); _state = State.Result; playerAvatar.Freeze(); playerData.SetArtScore(_goodScore, _badScore); _currentDialog = resultDialog; _currentDialog.ApplyCharacter(_characterData); _currentDialog.Display(playerData, _characterData); }
public override void Start() { base.Start(); gradeList = new List <BeatObjectGrade>(); _audioManager = AudioManager.GetInstance(); _beatMap = beatMapData.GenerateBeatMap(); _state = State.Beginning; _audioSource = GetComponent <AudioSource>(); _audioSource.clip = beatMapData.GetAudioClip(); _characterData = playerData.GetRandomCharacter(); _currentDialog = beginningDialog; _currentDialog.ApplyCharacter(_characterData); _currentDialog.Display(playerData, _characterData); }