public virtual void SetMessage(DialogueActor speakerActor, string _msg) { msg.text = _msg; }
//Function with same name as the event is called when the event is dispatched by the Dialogue Tree void OnActorSpeaking(DialogueSpeechInfo speech) { enabled = true; talkingActor = speech.actor; StartCoroutine(talkingActor.ProcessStatement(speech.statement, speech.Continue)); }
public override void SetOption(DialogueActor speakerActor, string[] msges, Action <int> _onOptionSelected) { base.SetOption(speakerActor, msges, _onOptionSelected); speakerIcon.sprite = speakerActor.icon; speakerName.text = speakerActor.name; }
// Token: 0x06000006 RID: 6 RVA: 0x000022B4 File Offset: 0x000004B4 public static void SetupTrainerClientSide(GameObject juggernautGameObject, int trainerViewID) { GameObject gameObject = new GameObject("UNPC_The Juggernaut"); gameObject.transform.position = JuggernautTrainer.TrainerLocation; juggernautGameObject.transform.parent = gameObject.transform; juggernautGameObject.transform.position = gameObject.transform.position; juggernautGameObject.transform.rotation = Quaternion.Euler(0f, 220.5518f, 0f); juggernautGameObject.transform.localScale = new Vector3(1.15f, 1.15f, 1.15f); UnityEngine.Object.DestroyImmediate(juggernautGameObject.GetComponent <StartingEquipment>()); Character component = juggernautGameObject.GetComponent <Character>(); component.Stats.enabled = false; Weapon currentWeapon = component.CurrentWeapon; bool flag = currentWeapon != null && currentWeapon.TwoHanded; if (flag) { component.LeftHandEquipment = component.CurrentWeapon; component.LeftHandChanged(); } component.Sheathed = false; GameObject gameObject2 = UnityEngine.Object.Instantiate(Resources.Load("editor/templates/TrainerTemplate")) as GameObject; gameObject2.transform.parent = juggernautGameObject.transform; gameObject2.transform.position = juggernautGameObject.transform.position; gameObject2.transform.rotation = juggernautGameObject.transform.rotation; DialogueActor componentInChildren = gameObject2.GetComponentInChildren <DialogueActor>(); componentInChildren.SetName("The Juggernaut"); Trainer componentInChildren2 = gameObject2.GetComponentInChildren <Trainer>(); At.SetValue <UID>(JuggernautMod.juggernautTreeInstance.UID, typeof(Trainer), componentInChildren2, "m_skillTreeUID"); DialogueTreeController componentInChildren3 = gameObject2.GetComponentInChildren <DialogueTreeController>(); Graph graph = componentInChildren3.graph; List <DialogueTree.ActorParameter> list = At.GetValue(typeof(DialogueTree), graph as DialogueTree, "_actorParameters") as List <DialogueTree.ActorParameter>; list[0].actor = componentInChildren; list[0].name = componentInChildren.name; List <Node> list2 = At.GetValue(typeof(Graph), graph, "_nodes") as List <Node>; StatementNodeExt statementNodeExt = graph.AddNode <StatementNodeExt>(); statementNodeExt.statement = new Statement("What do you want, peasant?"); statementNodeExt.SetActorName(componentInChildren.name); MultipleChoiceNodeExt multipleChoiceNodeExt = graph.AddNode <MultipleChoiceNodeExt>(); multipleChoiceNodeExt.availableChoices.Add(new MultipleChoiceNodeExt.Choice { statement = new Statement { text = "I wish to become a legend like you!" } }); multipleChoiceNodeExt.availableChoices.Add(new MultipleChoiceNodeExt.Choice { statement = new Statement { text = "Who are you?" } }); ActionNode actionNode = list2[1] as ActionNode; (actionNode.action as TrainDialogueAction).Trainer = new BBParameter <Trainer>(componentInChildren2); StatementNodeExt statementNodeExt2 = graph.AddNode <StatementNodeExt>(); statementNodeExt2.statement = new Statement("Hah! Like you don't know... Everyone knows me, I'm a living legend known as \"The Juggernaut\"!"); statementNodeExt2.SetActorName(componentInChildren.name); list2.Clear(); list2.Add(statementNodeExt); list2.Add(multipleChoiceNodeExt); list2.Add(actionNode); list2.Add(statementNodeExt2); graph.primeNode = statementNodeExt; graph.ConnectNodes(statementNodeExt, multipleChoiceNodeExt, -1, -1); graph.ConnectNodes(multipleChoiceNodeExt, actionNode, 0, -1); graph.ConnectNodes(multipleChoiceNodeExt, statementNodeExt2, 1, -1); graph.ConnectNodes(statementNodeExt2, statementNodeExt, -1, -1); gameObject.SetActive(true); }
// Use this for initialization void Start() { PlayerController = GameObject.FindObjectOfType <FirstPersonController>(); Camera = GameObject.FindObjectOfType <ThirdPersonCamera>(); actor = gameObject.GetComponent <DialogueActor>(); }