void Awake() { lc = GameObject.Find("LevelController").GetComponent <LevelController>(); var parent = transform.parent.gameObject; door = parent.GetComponentInChildren <Door>(); text = GetComponentInChildren <TextTrigger>(); }
// Start is called before the first frame update void Start() { text = GetComponent <TextTrigger>(); if (messageNumber == 0) { text.txt.text = "I think I broke my game! I need you to help me repair it! Go to Documents/LostGame and view the Broken Bridge.txt document!\nBTW, that purple square is a checkpoint."; } if (messageNumber == 1) { text.txt.text = "This door leads to the first level! But it's corrupted! Go to Documents/LostGame and right click on door.json and uncorrupt the door with notepad or notepad++!!! Make sure to save! Press F in the game to refresh then Touch the door!"; } }
/// <summary> /// Initializes a new instance of the <see cref="TriggerViewModel"/> class. /// </summary> /// <param name="allGroups">All groups.</param> /// <param name="triggersGroup">The triggers group.</param> /// <param name="trigger">The trigger.</param> /// <param name="actionDescriptions">The action descriptions.</param> public TriggerViewModel([NotNull] IEnumerable <GroupViewModel> allGroups, [NotNull] GroupViewModel triggersGroup, [NotNull] TextTrigger trigger, [NotNull] IEnumerable <ActionDescription> actionDescriptions) { Assert.ArgumentNotNull(allGroups, "allGroups"); Assert.ArgumentNotNull(triggersGroup, "triggersGroup"); Assert.ArgumentNotNull(trigger, "trigger"); Assert.ArgumentNotNull(actionDescriptions, "actionDescriptions"); AllGroups = allGroups; _triggersGroup = triggersGroup; _actionDescriptions = actionDescriptions; Trigger = trigger; ActionsViewModel = new ActionsViewModel(trigger.Actions, _actionDescriptions); }
/** * Destroy previous text and get next text mesh to be loaded. * Destroy this script if no more text meshes to be loaded. */ private void SwitchText() { if (textIdx + 1 >= sharpTexts.Length) { Destroy(currText); Destroy(this); return; } Destroy(currText); currText = GameObject.Instantiate(sharpTexts[textIdx + 1]); textIdx += 1; trigger = currText.GetComponent <TextTrigger>(); }
private Queue <string> sentences = null; //텍스트들를 먼저 저장된 순서로 빼기 위해 Queue형 사용 private void Start() { textTrigger = this.gameObject.GetComponent <TextTrigger>(); if (textTrigger == null) { Debug.LogError("TutorialTextMng의 texitTrigger 값이 없음"); } sentences = new Queue <string>(); if (sentences == null) { Debug.LogError("TutorialTextMng의 sentences is missing."); } TypingDutorialText(textTrigger.texts); }
private void Start() { textTrigger = this.gameObject.GetComponent <TextTrigger>(); if (textTrigger == null) { Debug.LogError("엔딩텍스트매니져의 텍스트 트리거에 값이 없음"); } sentences = new Queue <string>(); if (sentences == null) { Debug.LogError("엔딩텍스트매니져의 센텐스 is missing."); } TypingEndingText(textTrigger.texts); }
public TriggerViewModel Clone() { var textTrigger = new TextTrigger(); return(new TriggerViewModel(AllGroups, TriggersGroup, textTrigger, _actionDescriptions) { IsRegExp = IsRegExp, Priority = Priority, DoNotDisplayOriginalMessage = DoNotDisplayOriginalMessage, MatchingPattern = MatchingPattern, StopProcessingTriggersForMessage = StopProcessingTriggersForMessage, TriggersGroup = TriggersGroup, ActionsViewModel = ActionsViewModel.Clone(textTrigger.Actions) }); }
void OnTriggerEnter(Collider other) { if (other.tag == "Player") { if (PlaySong) { GetComponent <AudioSource> ().Play(); } activeTrigger = this; actSecond = Time.time; isTextActive = true; text.gameObject.SetActive(true); text.text = textToDisplay; text.color = colorText; } }
void TurnOn() { greenLight.enabled = true; redLight.enabled = false; GameObject[] sockets = GameObject.FindGameObjectsWithTag("Socket"); foreach (GameObject socketObject in sockets) { Socket socket = socketObject.GetComponent <Socket>(); if (socket == null) { continue; } socket.enabled = true; TextTrigger textTrigger = socket.GetComponent <TextTrigger>(); textTrigger.messages = new string[] { "message:PlayPlug", "........", ".........", "message:TurnOn", "IT WORKS!!!", "message:Call911", "......." }; textTrigger.sender = GameObject.FindWithTag("Phone"); textTrigger.onlyOnce = true; } foreach (GameObject obj in otherSetActive) { obj.SetActive(true); } otherSetActive = GameObject.FindGameObjectsWithTag("Lamp"); foreach (GameObject obj in otherSetActive) { foreach (Light light in obj.GetComponentsInChildren <Light>()) { light.enabled = true; } } GameObject.FindWithTag("Whispers").GetComponent <AudioSource>().Play(); GetComponent <AudioSource>().PlayOneShot(turnOnSound); Invoke("TurnOnGeneratorSound", 1); }
private void AddTriggerCommandExecute([NotNull] object obj) { Assert.ArgumentNotNull(obj, "obj"); var textTrigger = new TextTrigger() { IsRegExp = false }; textTrigger.Actions.Add(new SendTextAction()); var triggerToAdd = new TriggerViewModel(Groups, Groups.First(g => g.IsBuildIn), textTrigger, _actionDescriptions); var trigerEditDialog = new TriggerEditDialog { DataContext = triggerToAdd, Owner = (Window)obj }; trigerEditDialog.Show(); trigerEditDialog.Closed += (s, e) => { if (trigerEditDialog.Save) { triggerToAdd.TriggersGroup.AddTrigger(triggerToAdd); } }; }
public void deleteTextTrigger(TextTrigger textTrigger) { screenShotActions.deleteTextTrigger(textTrigger.id); }
private void Start() { portal = GetComponent <Portal>(); textTrigger = GetComponent <TextTrigger>(); index = 0; }
private void TriggerTextEvent(TextTrigger trigger) { _uiController.ShowPopupDialog(trigger.Text); }
private ScreenWatchData.TextTrigger textTriggerMapper(TextTrigger textTrigger) { ScreenWatchData.TextTrigger sTextTrigger = new ScreenWatchData.TextTrigger(); sTextTrigger.id = textTrigger.id; sTextTrigger.userName = textTrigger.userName; sTextTrigger.userEmail = textTrigger.userEmail; sTextTrigger.triggerString = textTrigger.triggerString; return sTextTrigger; }
public void save(TextTrigger textTrigger) { screenShotActions.updateTextTrigger(textTriggerMapper(textTrigger)); }
void Start() { textObj = GameObject.Find("FamilyTrigger").GetComponent <TextTrigger>(); }
public Guid addTextTrigger(TextTrigger textTrigger) { return screenShotActions.insertTextTrigger(textTriggerMapper(textTrigger)); }