public void RunGame() { EventIM e = events.ElementAt(eventIndex); if (e.name != "Trigger") { sm = e.agent.GetComponent <AgentStatusManager>(); } if ((sm.isInRange && sm.isLookedAt && !sm.isSpeaking) || e.name == "Trigger") { memories.Add(eventIndex); Debug.Log("Event index playing..." + eventIndex); switch (e.name) { case "Dialog": dm = e.agent.GetComponent <DialogManager>(); dm.Speak(e.GetComponent <Dialog>()); break; case "Animation": am = e.agent.GetComponent <AnimationManager>(); am.PlayAnimation(e.GetComponent <Animate>()); break; case "Response": rm.Respond(e.GetComponent <Response>()); break; case "Jump": eventIndex = e.GetComponent <Jump>().jumpID - 1; break; case "Wildcard": wm.Wildcard(e.GetComponent <Wildcard>()); break; case "Trigger": tm.Trigger(e.GetComponent <Trigger>()); break; case "Wait": wwm.Waiting(e.GetComponent <Wait>().waitTime); break; case "Move": mm = e.agent.GetComponent <MoveManager>(); mm.StartMoving(e.GetComponent <Move>()); break; case "StopMoving": mm = e.agent.GetComponent <MoveManager>(); mm.Stop(); break; case "Emote": em = e.agent.GetComponent <EmoteManager>(); em.EmotionBlendshape(e.GetComponent <Emote>()); break; case "MemoryCheck": mcm.CheckMemories(e.GetComponent <MemoryCheck>()); break; } eventIndex++; } }
/* Perform the unique actions for each event to run */ public void RunGame(Conversation c, EventIM e) { if (e.name != "Trigger") { //memories.Add(eventIndex); Debug.Log(TAG + "Playing Conversation/Event: " + c.name + "/" + e.name); switch (e.name) { case "Dialog": dm = e.agent.GetComponent <DialogManager>(); dm.Speak(e.GetComponent <Dialog>()); break; case "Animation": //Animation needs to be fixed... //dialog will not play if 105 conditions not met //but animation will play... am = e.agent.GetComponent <AnimationManager>(); am.PlayAnimation(e.GetComponent <Animate>()); break; case "Response": if (wm != null || wm.isRunning()) { wm.stop(); } rm.Respond(e.GetComponent <Response>()); break; case "Jump": //TODO jump between conversations? break; case "Wildcard": if (rm.isRunning()) { rm.stopKeywordRecognizer(); } if (wm != null || wm.isRunning()) { wm.stop(); } wm.Wildcard(e.GetComponent <Wildcard>()); break; case "Trigger": tm.Trigger(e.GetComponent <Trigger>()); break; case "Wait": wwm.Waiting(e.GetComponent <Wait>()); break; case "Move": mm = e.agent.GetComponent <MoveManager>(); mm.StartMoving(e.GetComponent <Move>()); break; case "StopMoving": mm = e.agent.GetComponent <MoveManager>(); mm.Stop(); break; case "Emote": em = e.agent.GetComponent <EmoteManager>(); em.EmotionBlendshape(e.GetComponent <Emote>()); break; case "MemoryCheck": mcm.CheckMemories(e.GetComponent <MemoryCheck>()); break; } } }