IEnumerator InputGenerationCoroutine() { CodingMamaCharacter character = playerData.GetRandomCharacter(); bool shouldScopeUp = bobController.transform.position.y > 0; if (_random.Next(10) > 6) { // contradict sometimes shouldScopeUp = !shouldScopeUp; } character.SetScopePreference(shouldScopeUp); GameObject dialogItem = Instantiate(prefabDialogItem, dialogHolder.parent); ScopeDialogItem script = dialogItem.GetComponent <ScopeDialogItem>(); EnumScope.Dialog enumScopeDialog; float force; if (shouldScopeUp) { enumScopeDialog = enumScopeUp.GetDialog(); force = enumScopeDialog.value; } else { enumScopeDialog = enumScopeDown.GetDialog(); force = -enumScopeDialog.value; } script.SetData(character, enumScopeDialog.text); bobController.AddExternalForce(force); dialogItem.transform.SetParent(dialogHolder); _dialogList.Add(dialogItem); if (_dialogList.Count > dialogCountLimit) { Destroy(_dialogList[0]); _dialogList.RemoveAt(0); } float randomTime = _random.Next(minGenDuration, maxGenDuration); float elapsedTime = Time.time - _startTime; if (elapsedTime > (gameplayDuration * 0.8)) { randomTime /= 4; } else if (elapsedTime > gameplayDuration / 2) { randomTime /= 2; } yield return(new WaitForSeconds(randomTime)); _inputGenerationCoroutine = InputGenerationCoroutine(); StartCoroutine(_inputGenerationCoroutine); }
public void ApplyCharacter(CodingMamaCharacter characterData) { foreach (Dialog dialog in dialogList) { dialog.ApplyCharacter(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 void ApplyCharacter(CodingMamaCharacter characterData) { foreach (var VARIABLE in dialogGroupList) { VARIABLE.ApplyCharacter(characterData); } }
protected override Result BodyTryUsing(PlayerData playerData, CodingMamaCharacter characterData) { DialogGroup currentDialog = defaultLine; switch (state) { case State.Introduction: currentDialog = introduction; break; } Result result = currentDialog.Display(playerData, characterData); lastQuestion = result.yesOrNoQuestion; if (result.isDone) { playerData.dialogManager.Hide(); switch (state) { case State.Accepted: case State.Introduction: state = State.DefaultLine; break; default: defaultLine.RestartValue(); break; } } return(result); }
public override void Start() { base.Start(); _genDuration = maxGenDuration; _state = State.Beginning; _characterData = playerData.GetRandomCharacter(); _currentDialog = beginningDialog; _currentDialog.ApplyCharacter(_characterData); _currentDialog.Display(playerData, _characterData); }
public Result TryUsing(EnumStage ArgEnumStage, PlayerData playerData, CodingMamaCharacter characterData) { Result result = ResultFactory.CreateEndingResult(); if (enumStage == ArgEnumStage) { // do stuff with dialog result = BodyTryUsing(playerData, characterData); } return(result); }
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(); _state = State.Beginning; _invLerpValue = 1f; _lerpValue = 0f; _characterData = playerData.GetRandomCharacter(); _currentDialog = beginningDialog; _currentDialog.ApplyCharacter(_characterData); _currentDialog.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 Result Display(PlayerData playerData, CodingMamaCharacter characterData) { if (dialogIndex < dialogList.Count) { playerData.dialogManager.Show(); playerData.dialogManager.DisplayDialog(dialogList[dialogIndex]); Result result = ResultFactory.CreateChattingResult(); result.yesOrNoQuestion = dialogList[dialogIndex].yesOrNoResult; dialogIndex++; return(result); } else { playerData.dialogManager.Hide(); return(ResultFactory.CreateEndingResult()); } }
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); }
public void SetData(CodingMamaCharacter characterData, String dialog) { image.sprite = characterData.sprite; uiText.text = dialog; }
public bool Recruit(PlayerData playerData, CodingMamaCharacter characterData) { teamMemberList.Add(characterData); return(true); }
protected abstract Result BodyTryUsing(PlayerData playerData, CodingMamaCharacter characterData);
public override bool DoYes(PlayerData playerData, CodingMamaCharacter characterData) { return(playerData.Recruit(playerData, characterData)); }
public void SetData(CodingMamaCharacter characterData) { _characterData = characterData; UpdateDialog(); }
public abstract bool DoNo(PlayerData playerData, CodingMamaCharacter characterData);
public override bool DoNo(PlayerData playerData, CodingMamaCharacter characterData) { return(false); }
public void ApplyCharacter(CodingMamaCharacter characterData) { sprite = characterData.sprite; name = characterData.name; }
Result Evaluate(PlayerData playerData, CodingMamaCharacter characterData) { return(new Result()); }