void CheckBroadcasts() { if (ConversationScript.FindAndRemoveBroadcast("test")) { currentHealth = maxHealth / 2.0f; } }
void Start() //used onStart of the level. Grabs the components in scene { convoScriptText = GameObject.FindGameObjectWithTag("ConvoUIText").GetComponent <ConversationScript>(); if (convoScriptText == null) { Debug.LogError("UI Text for conversation isn't tagged correctly."); } player = GameObject.FindGameObjectWithTag("Player"); goal = GameObject.FindGameObjectWithTag("Goal"); if (goal == null) { Debug.LogError("Goal is not tagged correctly."); } convoScriptText.GetComponent <ConversationScript>().enabled = false; //makes sure the conversation doesn't start on start player.GetComponent <Movement>().enabled = true; //makes sure that the player can move if (GlobalVars.isTutorial || SceneManager.GetActiveScene().name == "Tutorial") //if it tutorial, bring it up at the beguinning { SwitchingState(); this.gameObject.GetComponent <Image>().enabled = false; this.gameObject.GetComponent <Button>().enabled = false; this.gameObject.GetComponentInChildren <Image>().enabled = false; } else { this.gameObject.GetComponent <Image>().enabled = true; this.gameObject.GetComponent <Button>().enabled = true; this.gameObject.GetComponentInChildren <Image>().enabled = true; } }
// Use this for initialization void Start() { convoScriptText = GameObject.FindGameObjectWithTag("ConvoUIText").GetComponent <ConversationScript>(); if (convoScriptText == null) { Debug.LogError("The text for the Conversation has been tagged incorrectly."); } if (!GlobalVars.isTutorial) //don't scamble it if we're in the tutorial { string[] scrambledDialogue = new string[dialogue.Length]; for (int index = 0; index < dialogue.Length; index++) //filter each piece of dialogue into the scamblers { scrambledDialogue[index] = ScrambleText.ScramblingText(dialogue[index]); } dialogue = scrambledDialogue; //set dialogue equal to the scrambled text } //set the components in convoScript to the ones in this dialogue handler convoScriptText.conversation = dialogue; convoScriptText.faceArray = faceArray; }
void CheckBroadcasts() { //Debug.Log (ConversationScript.broadcasts); if (ConversationScript.FindAndRemoveBroadcast("GoToBox1")) { CreateBoxLights(platforms[0]); ShowStats.addMessage("-----------------------"); ShowStats.addMessage("Use A and D keys to move left and right."); ShowStats.addMessage("Press space key to jump."); } if (ConversationScript.FindAndRemoveBroadcast("Run1")) { ConversationScript con = GameObject.Find("TutorialGuide").GetComponent <ConversationScript>(); //con.CameraOn(); ShowStats.StartConversation(con, 4); CreateBoxLights(platforms[1]); HorizontalFlashingRedArrow.start = true; ShowStats.addMessage("-----------------------"); ShowStats.addMessage("Hold shift key to sprint."); } if (ConversationScript.FindAndRemoveBroadcast("ShiftJump")) { ShowStats.StartConversation(GameObject.Find("TutorialGuide").GetComponent <ConversationScript>(), 5); CreateBoxLights(platforms[2]); ShowStats.addMessage("-----------------------"); ShowStats.addMessage("Hold shift and space to long jump."); HorizontalFlashingRedArrow.start = false; } if (ConversationScript.FindAndRemoveBroadcast("Fight")) { ShowStats.StartConversation(GameObject.Find("TutorialGuide").GetComponent <ConversationScript>(), 6); ShowStats.addMessage("-----------------------"); ShowStats.addMessage("Press I to open inventory."); } if (ConversationScript.FindAndRemoveBroadcast("ReadyToFight")) { ShowStats.addMessage("-----------------------"); ShowStats.addMessage("Left click to attack."); } }
void Start() { panel = GameObject.FindGameObjectWithTag("ConvoPanel"); if (panel == null) { Debug.LogError("Convoseration Panel isn't tagged correctly"); } text = panel.transform.Find("ConvoText").GetComponent <Text>(); if (text != null) { convoScript = text.GetComponent <ConversationScript>(); } diaButton = panel.transform.Find("Button").GetComponent <DialogueButton>(); if (GlobalVars.isTutorial) { index = 2; } }
public static void EndConversation() { convo.CameraOff(); convo = null; }
public static void StartConversation(ConversationScript conv, int frame) { convo = conv; convo.currentFrame = frame; convo.CameraOn(); }
public static void StartConversation(ConversationScript conv) { convo = conv; convo.currentFrame = 0; }