void OnGUI() { GUI.depth = -10; if (GUI.Button(new Rect(25, 25, 125, 30), "Unity GUI")) { Dialoguer.events.ClearAll(); unityDialogue.addDialoguerEvents(); Dialoguer.StartDialogue(0); // Generic } if (GUI.Button(new Rect(25, 25 + 30 + 10, 125, 30), "Old School RPG")) { Dialoguer.events.ClearAll(); oldRpgDialogue.addDialoguerEvents(); Dialoguer.StartDialogue(DialoguerDialogues.OldSchoolRPG); // Old SchoolRPG } if (GUI.Button(new Rect(25, 25 + 60 + 20, 125, 30), "NextGen RPG")) { Dialoguer.events.ClearAll(); nextGenRpgDialogue.addDialoguerEvents(); Dialoguer.StartDialogue(2); // Old SchoolRPG } }
void onClick(GameObject button) { if (button == choice1) { Debug.Log("Choice1"); Dialoguer.ContinueDialogue(0); } if (button == choice2) { Debug.Log("Choice2"); Dialoguer.ContinueDialogue(1); } if (button == choice3) { Debug.Log("Choice3"); Dialoguer.ContinueDialogue(2); } if (button == choice4) { Debug.Log("Choice4"); Dialoguer.ContinueDialogue(3); } if (button == choice5) { Debug.Log("Choice5"); Dialoguer.ContinueDialogue(4); } if (button == choice6) { Debug.Log("Choice6"); Dialoguer.ContinueDialogue(5); } }
private bool gotThem() { //Check the journal inventory for these things for (int i = 0; i < getTheseToProceed.Length; i++) { GameObject current = getTheseToProceed[i]; if (!journal.Instance.isItemInInventory(current)) { return(false); } } for (int i = 0; i < getTheseGlobalBools.Length; i++) { bool current = Dialoguer.GetGlobalBoolean(getTheseGlobalBools[i]); if (!current) { return(false); } } return(true); }
void OnGUI() { if (!_showing) { return; } if (!_windowShowing) { return; } GUI.depth = 10; Rect dialogueBoxRect = new Rect((Screen.width * 0.5f) - (WIDTH * 0.5f), Screen.height - HEIGHT - 100, WIDTH, HEIGHT); Rect dialogueBackBoxRect = new Rect(dialogueBoxRect.x, dialogueBoxRect.y, dialogueBoxRect.width, dialogueBoxRect.height - (45 * _choices.Length)); GUI.Box(dialogueBackBoxRect, string.Empty); GUI.Label(new Rect(dialogueBackBoxRect.x + 10, dialogueBackBoxRect.y + 10, dialogueBackBoxRect.width - 20, dialogueBackBoxRect.height - 20), _windowText); if (_selectionClicked) { return; } for (int i = 0; i < _choices.Length; i += 1) { Rect buttonRect = new Rect(dialogueBoxRect.x, dialogueBoxRect.yMax - (45 * (_choices.Length - i)) + 5, dialogueBoxRect.width, 40); if (GUI.Button(buttonRect, _choices[i])) { _selectionClicked = true; Dialoguer.ContinueDialogue(i); } } }
void Update() { if (player == null) { player = (playerScript)FindObjectOfType(typeof(playerScript)); } if (clickedOnSomething) { onMouseMiss(); } if (clickedOnSomething) { if (pDist.isCloseEnough(player.transform.position)) { pickUpItem(); } } if (autoPickupPostConvo && GameManager.dialogueJustFinished && checkCondis() && !clickedOnSomething) { if (pDist.isCloseEnough(player.transform.position) && !player.talking && tookItem) { handleAssociated(); collectItems(); player.stopMove(); player.talking = true; Dialoguer.StartDialogue(pickUpConvo); autoPickupPostConvo = false; } } }
// Use this for initialization void Start() { player = (playerScript)FindObjectOfType(typeof(playerScript)); sceneInit(); if (loadNewXML || !Dialoguer.isInitialized()) { Dialoguer.Initialize(dialoguer); GameManager.offset = 0; if (GameManager.offset == 0) { GameManager.offset = setOffset; } setOffset = 0; } GameManager.dialogueJustFinished = false; if (autoPlay) { playDialogue(); } }
// Update is called once per frame void Update() { if (Dialoguer.GetGlobalBoolean(9) == true) { Application.LoadLevel("Facility1-1"); } }
// Update is called once per frame void Update() { if (Dialoguer.GetGlobalBoolean(3) == true) { g.SetActive(true); } }
// Update is called once per frame void Update() { if (Dialoguer.GetGlobalBoolean(14) == true) { bigSword.SetActive(true); } } //end of update
void Awake() { Dialoguer.Initialize(); startTime = Time.time; startPosition = transform.position; destination = new Vector3(startPosition.x + 2, startPosition.y, startPosition.z); }
public void Speak(int npcID, int index) { if (_showing) { return; } JSONNode npcDialogue = RetrieveDialogueFromJSON(); if (npcDialogue [npcID.ToString()] == null) { Debug.Log("NPC ID: " + npcID + " doesn't exist, check dialogue list json file!"); return; } if (npcDialogue [npcID.ToString()] [index] == null) { Debug.Log("Index: " + index + " on NPC ID: " + npcID + " doesn't exist, check dialogue list json file!"); return; } Dialoguer.StartDialogue(npcDialogue [npcID.ToString()] [index].AsInt); return; }
void Update() { Debug.LogWarning("Just Finished: " + GameManager.dialogueJustFinished); if (GameManager.dialogueJustFinished) { started = true; GameManager.dialogueJustFinished = false; } if (started) { if (progress <= 0f) { failure = true; } else if (progress < progressNeeded && !success) { if (Input.GetMouseButtonDown(0)) { progress++; } progress -= Time.deltaTime * 2; } else if (progress >= progressNeeded && !success) { success = true; } } if (success && !playingConv) { if (waitThisLong <= 0) { playingConv = true; Debug.LogWarning("YAY"); if (nextScene != "") { Application.LoadLevel(nextScene); } } else { waitThisLong -= Time.deltaTime; } } else if (failure && !playingConv) { playingConv = true; Debug.LogWarning("AWW"); if (failConversation != Convo.ch0none) { Dialoguer.StartDialogue((int)failConversation); } } else if (playingConv && GameManager.dialogueJustFinished) { Application.LoadLevel(Application.loadedLevelName); } }
void OnMouseDown() { if (((int)dontGotIt) != -1 && !gotThem()) { GameManager.dialogueJustFinished = false; Dialoguer.StartDialogue((int)dontGotIt); } }
public static void startDialog(string s, Dialoguer d) { pendingDialog = s; currentDialog = d; advanceDialog = true; requestDialog = false; setTalkMode(); }
void onClick(GameObject button) { if (button == exitButton && Input.GetMouseButtonUp(0)) { Debug.Log("Exit Dialogue"); Dialoguer.EndDialogue(); } }
public static void endDialog() { pendingDialog = ""; currentDialog = null; advanceDialog = false; requestDialog = false; setMoveMode(); }
void Update() { Dialoguer.SetGlobalFloat(0, PlayerInfo.Instance.Data.Gold.Value); Dialoguer.SetGlobalFloat(1, PlayerInfo.Instance.Data.Experience.Value); Dialoguer.SetGlobalFloat(2, PlayerInfo.Instance.Data.KeyYellow.Value); Dialoguer.SetGlobalFloat(3, PlayerInfo.Instance.Data.KeyBlue.Value); Dialoguer.SetGlobalFloat(4, PlayerInfo.Instance.Data.KeyRed.Value); }
// Use this for initialization void Start() { //turn on certain abilities so I don't have to keep doing it over and over again if (isDoubleJump) { Dialoguer.SetGlobalBoolean(2, true); } }
// Update is called once per frame void Update() { Dialoguer.SetGlobalFloat(0, _PA._jinbi); Dialoguer.SetGlobalFloat(1, _PA._jingyan); Dialoguer.SetGlobalFloat(2, _PA._key_yellow); Dialoguer.SetGlobalFloat(3, _PA._key_blue); Dialoguer.SetGlobalFloat(4, _PA._key_red); }
void ContinueDialogue(int option) { if (isTextNode) { OnTextPhaseEnd(); } Dialoguer.ContinueDialogue(option); }
void ContinueDialogue() { if (isTextNode) { OnTextPhaseEnd(); } Dialoguer.ContinueDialogue(); }
void OnGUI() { wait -= Time.deltaTime; if (wait < 0 && !init) { init = true; Dialoguer.StartDialogue(4); } }
public void startDialogue() { if (!wall) { GameManager.dialogueJustFinished = false; StartCoroutine("DialogueDone"); Dialoguer.StartDialogue((int)dialogueEnum); } }
// Update is called once per frame void Update() { //This should turn the boss object on after the dialogue is complete. if (Dialoguer.GetGlobalBoolean(11) == true) { BoozyBot.SetActive(true); DramCam.SetActive(true); } }
public void talk(Talk talk) { AuM.playAudio("talk"); Dialoguer.StartDialogue(0); UM.state = "dialog"; if (talk.destroyOnFinish) { } }
void checkFix() { if (Dialoguer.GetGlobalBoolean(1))// && _GDM.sceneData[2][6, 1] == 0 { clear2Door(); _DM.tipContent = "已帮你打开2楼的门,修正错误,非常抱歉!"; _DM.tipTime = 6; } }
public void OpenStuff(InteractableObject iO, GameObject gObj) { //open stuff PlaySound(GameController.instance.gameSettings.clickSound4); DialoguerDialogues diag = DialoguerDialogues.None; try{ diag = (DialoguerDialogues)System.Enum.Parse(typeof(DialoguerDialogues), gObj.name + "_Open_True"); } catch { Debug.Log("Dialogue needs to be set!"); } if (diag != DialoguerDialogues.None) { Dialoguer.StartDialogue(diag); GameController.instance.dCon.obsTextObj.SetActive(true); } CloseInteractiveMenu(); // if (iO.spriteToActivate != null) { iO.spriteToActivate.gameObject.SetActive(true); } if (iO.spriteRendererToUpdate != null) { SpriteRenderer r = iO.spriteRendererToUpdate; if (r.sprite == iO.spriteToUpdateFrom) { r.sprite = iO.spriteToUpdateTo; } else { r.sprite = iO.spriteToUpdateFrom; } } if (iO.objsToEnable.Length > 0) { for (int i = 0; i < iO.objsToEnable.Length; i++) { iO.objsToEnable[i].SetActive(true); } } if (gObj.GetComponent <InteractableObject>().disableOnOpen) { gObj.SetActive(false); } if (iO.clipPlay != null) { GameController.instance.audioClipSource.GetComponent <AudioSource>().clip = iO.clipPlay; GameController.instance.audioClipSource.GetComponent <AudioSource>().Play(); } }
void Start() { inputMgr = GameManager.Inst().InputManager(); dialogueMgr = GameManager.Inst().DialogueManager(); Dialoguer.Initialize(); SetupDialogueEvents(); origContinuePosX = continuePrompt.position.x; audioSrc = gameObject.AddComponent <AudioSource>(); audioSrc.clip = textSound; }
// Use this for initialization void Start() { Dialoguer.events.onStarted += onStarted; Dialoguer.events.onEnded += onEnded; Dialoguer.events.onTextPhase += onTextPhase; continueButton.GetComponent <Button>().onClick.AddListener(() => Dialoguer.ContinueDialogue()); choiceOne.GetComponent <Button>().onClick.AddListener(() => Dialoguer.ContinueDialogue(0)); choiceTwo.GetComponent <Button>().onClick.AddListener(() => Dialoguer.ContinueDialogue(1)); }
public override bool Trigger(Game game) { Dialoguer.events.onEnded += OnDialoguerEnd; Dialoguer.events.onMessageEvent += OnDialoguerEvent; Dialoguer.events.onCondition += OnDialoguerCondition; ResveredGame = game; Dialoguer.StartDialogue(Dialog); return(!StayAfterTalk); }