public Node NPCBehavior_CasualConversation(NPCBehavior agentA, NPCBehavior agentB) { return(new Sequence( agentB.NPCBehavior_GoToAtDistance(agentA.transform, 1.5f, false), agentB.NPCBehavior_OrientTowards(agentA.transform), agentB.NPCBehavior_LookAt(agentA.transform, true), agentB.NPCBehavior_DoGesture(GESTURE_CODE.WAVE_HELLO), agentA.NPCBehavior_OrientTowards(agentB.transform), agentA.NPCBehavior_LookAt(agentB.transform, true), new DecoratorLoop( new SelectorParallel( new SequenceShuffle( agentA.NPCBehavior_DoGesture(GESTURE_CODE.TALK_SHORT), agentB.NPCBehavior_DoGesture(GESTURE_CODE.TALK_LONG), agentA.NPCBehavior_DoGesture(GESTURE_CODE.ACKNOWLEDGE), agentA.NPCBehavior_DoGesture(GESTURE_CODE.HURRAY), agentA.NPCBehavior_DoGesture(GESTURE_CODE.DRUNK) ), new SequenceShuffle( agentA.NPCBehavior_DoGesture(GESTURE_CODE.PHONEME_A), agentB.NPCBehavior_DoGesture(GESTURE_CODE.PHONEME_E), agentA.NPCBehavior_DoGesture(GESTURE_CODE.PHONEME_O), agentA.NPCBehavior_DoGesture(GESTURE_CODE.PHONEME_U), agentA.NPCBehavior_DoGesture(GESTURE_CODE.PHONEME_P) ) ) ), agentB.NPCBehavior_LookAt(null, false), agentA.NPCBehavior_LookAt(null, false), agentB.NPCBehavior_DoGesture(GESTURE_CODE.WAVE_HELLO) )); }
protected Node ChoosePartner() { if (UnityEngine.Random.Range(-1f, 1f) > 0) { AgentCUpset = true; return(new Sequence( AgentA.NPCBehavior_OrientTowards(AgentB.transform), AgentA.NPCBehavior_Talk("Hi Danny Bones! I like you better than Steve!", bubbleA), AgentB.NPCBehavior_Talk("Thanks Manny Bones!", bubbleB), AgentC.NPCBehavior_DoGesture(GESTURE_CODE.DISSAPOINTMENT) )); } else { AgentBUpset = true; return(new Sequence( AgentA.NPCBehavior_OrientTowards(AgentC.transform), AgentA.NPCBehavior_Talk("Hi Steve! I like you better than Danny Bones!", bubbleA), AgentC.NPCBehavior_Talk("Thanks Manny Bones!", bubbleC), AgentB.NPCBehavior_DoGesture(GESTURE_CODE.DISSAPOINTMENT) )); } }
private Node die(string agent) { if (agent.Equals("c")) { //AgentC.StopAllCoroutines(); is there a way to stop all behaviors for this agent? return(AgentC.NPCBehavior_DoGesture(GESTURE_CODE.DIE)); } else if (agent.Equals("b")) { //AgentB.StopAllCoroutines(); return(AgentB.NPCBehavior_DoGesture(GESTURE_CODE.DIE)); } else { //AgentA.StopAllCoroutines(); return(AgentA.NPCBehavior_DoGesture(GESTURE_CODE.DIE)); } }