public void ConfirmEnd(CarryableObject co) { if (co == null) { return; } AudioManager.PlayConfirmedObjectSound(); Destroy(co.gameObject); finishedObjects++; if (finishedObjects == currentGoal) { if (DayTimer.Instance.DayNewTasksEnd > DayTimer.Instance.elapsedTime) { currentGoal += levelData.AdditionalObjects; AudioManager.Instance.SwitchMusic(AudioManager.MusicMode.Heavy); } else { DayTimer.Instance.DayHasEnded(); dialogReader.Read(winDialog, ActionsRunner.RunFunctionAsEnumerator(GameManager.GoToNextScene), false); } } GoalInformations.UpdateAll(); }
public virtual void OnCacheConversations() { //HELPER VARABLES string file = Server.SecurePath("~/dialogtemplates/{0}.xml", this.ModelId); if (File.Exists(file)) { using (DialogReader reader = DialogReader.Open(file)) { while (reader.Read()) { if (reader.HasInformation) { //Always uppercase (invariant for globalisation issues) string name = reader.Name.ToUpperInvariant(); if (name == "GOSSIP") { //Gossip is a base function of ours _Gossip = reader.Value; } else { //Parse to all child registered functions for (int i = 0; i < state.RegisteredNpcFunctions.Count; i++) { state.RegisteredNpcFunctions[i].OnCacheDialogInfo(this, reader.Name, reader.Value); } } } } } } }
public void InteractWith() { if (ringingRoutine == null) { return; } source.Stop(); StopCoroutine(ringingRoutine); ringingRoutine = null; dialogsReader.Read(answerDialogs[Random.Range(0, answerDialogs.Count)], isInTutorialMode ? TutorialManager.SetGoalAfterCall() : null); }
private void Start() { DayTimer.Instance.SetTimeScale(0); dialogReader.Read(startingDialog, WaitUntilTimeGetsTo(9.25f)); }