public void ShowFor(File file) { GetComponent <UnityEngine.UI.Text>().text = ""; revealedLines = UnityEngine.Random.Range(0, codeLines.Length); hackedFile = file; sinceStartedHacking = 0; st.Begin(Vector3.zero, Vector3.one, transform.parent, () => Visible = true); if (!shownOnce) { var ct = PlayerControl.Instance.SelectedFile.gameObject.AddComponent <ClickyTrigger>(); ct.DialogueSequence = new[] { "ClickyGuideHack04", "ClickyGuideHack07" }; ct.SayOnce = true; shownOnce = true; StartCoroutine(WaitThenTogglePlay(SoundRegistry.Instance.HackSource, 0.25f)); } else { SoundRegistry.Instance.HackSource.Play(); } StartCoroutine(WaitThenTogglePlay(SoundRegistry.Instance.NormalSource, 0.25f)); SoundRegistry.Instance.Hack.TransitionTo(0.25f); StartCoroutine(DelayShow()); }
public void Popup(string text, float length = 0.25f) { //Debug.Log("Popup : " + text); st.TransitionOver = length; st.Begin(Vector3.zero, BaseScale, AssociatedWindow.transform, () => { //Debug.Log("Visible!"); Visible = true; GetComponent <AudioSource>().PlayOneShot(SoundRegistry.Instance.ClickyTalk[UnityEngine.Random.Range(0, SoundRegistry.Instance.ClickyTalk.Length)]); }); var textNode = AssociatedWindow.GetComponentInChildren <Text>(); textNode.text = Dialogue[text]; var rt = AssociatedWindow.GetComponent <RectTransform>(); rt.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 700 + textNode.preferredHeight * 1.911035f); iconTimer = 0; ReturnIcon.color = new Color(1.0f, 1.0f, 1.0f, 0.0f); }
IEnumerator DelayShow() { yield return(new WaitForSeconds(0.25f)); adminSt.Begin(Vector3.zero, Vector3.one / 2, adminWindow.transform, () => { }); }