public void GetConnectID() { metaDataNode = curStory.GetNodeByName("MetaData"); foreach (SilkTagBase tag in metaDataNode.executionQueue) { if (tag.TagName == "connect") { tag.TagExecute(); } } }
public void FindNextNode(string response) { //Debug.Log (response); SilkNode nextNode; //GetNextStory ("5M"); //GetRootNode (); foreach (SilkLink link in curNode.silkLinks) { if (response == link.LinkText) { nextNode = link.LinkedNode; nodeCleanup(); curNode = nextNode; ExecuteNode(); break; } } }
public RunAction(string name, List <string> args) { //Debug.Log ("HMMMMMMMMMMMMM???"); ActionName = name; Args = args; //dm = GameObject.FindObjectOfType<DialogueManager>(); Direction dir; //Debug.Log ("ACT ARG >>" + args [0]); //Debug.Log ("ARGH " + args[0]); destination = Silky.Instance.mother.GetNodeByName(DialogueManager.instance.CurStory.StoryName, args[0]); /* * switch (args[0]) { * case "north": * dir = Direction.NORTH; * break; * case "south": * dir = Direction.SOUTH; * break; * case "east": * dir = Direction.EAST; * break; * case "west": * dir = Direction.WEST; * break; * default: * dir = Direction.NONE; * break; * * } * * if(dir != Direction.NONE) { * destination = Silky.Instance.mother.GetNodeByName(dm.CurStory.StoryName,args[1]); * } * else { * destination = Silky.Instance.mother.GetNodeByName(dm.CurStory.StoryName, args[0]); * } */ }
public void GetRootNode() { //if (curStory.GetNodeName ("Start") != null) { rootNode = curStory.GetNodeByName("Start"); curNode = rootNode; foreach (Silk.SilkTagBase tag in curNode.executionQueue) { // //Debug.Log(tag); if (tag != null) { if (tag.IsComplete == true) { //Debug.Log("TRUE"); continue; } else if (tag.IsComplete == false) { //Debug.Log("FALSE"); if (curNode.executionQueue.Count >= 1) { //if(tag.TagName == "connect") { // Debug.Log("boop"); // connectID = tag.Value; //} //Debug.Log(tag.TagName); tag.TagExecute(); } //break; } } //else?? } //} else { //Debug.LogError ("No root node found"); //} //newNodeStart (); }
public void FindNextNodeByName(string nodeName) { SilkNode nextNode; nextNode = curStory.GetNodeByKey(nodeName); //Debug.Log ("HI NAT " + nextNode); curNode = nextNode; nodeCleanup(); ExecuteNode(); //RunNodeData (); /*foreach (Silk.SilkTagBase tag in curNode.executionQueue) { * * // * //Debug.Log(tag); * if (tag != null) { * * if (tag.IsComplete == true) { * //Debug.Log("TRUE"); * continue; * } else if (tag.IsComplete == false) { * //Debug.Log("FALSE"); * if (curNode.executionQueue.Count >= 1) { * //if(tag.TagName == "connect") { * // Debug.Log("boop"); * // connectID = tag.Value; * //} * //Debug.Log(tag.TagName); * tag.TagExecute (); * * } * //break; * } * } * } * RunNodeData (); */ }
void GetNextNode(string nextNodeName) { curNode = curStory.GetNodeByName(nextNodeName); }
void GetRootNode() { rootNode = curStory.GetNodeByName("Start"); curNode = rootNode; }
void PopulateResponseUI() { //Debug.Log("gogogogo"); //SilkNode node = Silky.Instance.mother.GetNodeByName("TRANSUBSTANCE", "Start"); SilkNode node = DialogueManager.instance.CurNode; if (node != null) { Debug.LogError(node); } else { Debug.LogError("NO NODE FOUND"); } //Debug.Log(node.silkLinks.Count); if (node.silkLinks.Count > 0) { for (int i = 0; i < node.silkLinks.Count; i++) { GameObject newresponse = Instantiate(responsePrefab); Button b = newresponse.GetComponent <Button> (); if (i == 0 && node.silkLinks.Count == 1) { newresponse.GetComponent <Image> ().sprite = midImage; } else if (i == 0 && node.silkLinks.Count > 1) { newresponse.GetComponent <Image> ().sprite = topImage; } else if (i == node.silkLinks.Count - 1) { newresponse.GetComponent <Image> ().sprite = botImage; } else { newresponse.GetComponent <Image> ().sprite = midImage; } //////////////////////////////////////////////////////////////// //this script must be attached to the parent of all responses/// //////////////////////////////////////////////////////////////// newresponse.transform.SetParent(this.gameObject.transform); newresponse.transform.localScale = new Vector3(1, 1, 1); b.onClick.AddListener(() => OnButtonClick(newresponse.GetComponent <Response> ())); curDisplayResponses.Add(newresponse); newresponse.transform.localPosition = new Vector3(newresponse.transform.position.x, newresponse.transform.position.y, 0); newresponse.GetComponent <Response> ().responseText = node.silkLinks [i].LinkText; if (i == 0) { newresponse.GetComponent <Selectable> ().Select(); newresponse.GetComponent <Response> ().navPos = Response.NavPosition.TOP; } else if (i == node.silkLinks.Count - 1) { newresponse.GetComponent <Response> ().navPos = Response.NavPosition.BOTTOM; } else { newresponse.GetComponent <Response> ().navPos = Response.NavPosition.MIDDLE; } } } if (actionController.activeActions.Count > 0) { //Debug.Log("ACTION COUNT " + actionController.activeActions.Count); for (int j = 0; j < actionController.activeActions.Count; j++) { GameObject newAction = Instantiate(actionPrefab); newAction.transform.SetParent(this.gameObject.transform); newAction.transform.localScale = new Vector3(1, 1, 1); newAction.transform.localPosition = new Vector3(newAction.transform.position.x, newAction.transform.position.y, 0); newAction.GetComponent <ActionLabel> ().actionText = actionController.activeActions [j].ActionName; //newAction.GetComponent<Image>().color = Color.white; } } this.gameObject.GetComponent <ResponseNavHandler>().SetCustomNavigation(curDisplayResponses); }