private void Start() { eventHandler = GameObject.Find("GameEventSystem").GetComponent <EventHandler>(); eventObject = GameObject.Find("Event"); eventTitle = GameObject.Find("Title").GetComponent <Text>(); eventDescription = GameObject.Find("Description").GetComponent <Text>(); eventOptions = GameObject.Find("Options").GetComponent <Text>(); textScrollScript = GameObject.Find("ResourceGain").GetComponent <TextScroll>(); finalSpeechScript = GameObject.Find("Player Colony Ship").GetComponent <FinalSpeech>(); fSpeechUI = GameObject.Find("FinalSpeechUI"); winText = GameObject.Find("WinText"); winText.SetActive(false); gameOverScript = gameObject.GetComponent <GameOver>(); warpScript = gameObject.GetComponent <Warp>(); hudScript = gameObject.GetComponent <HUD>(); startTime = Time.time; secBetweenEventsStore = secBetweenEvents; secBetweenRGainStore = secBetweenRGain; costPerJump *= -1; fSpeechUI.SetActive(false); eventObject.SetActive(false); eventIsOpen = false; isDoingFinalSpeech = false; shownFirstEvent = false; }
private void OnConvertOutput(string output) { ConvertOutputText.Text += output + "\n"; if (Math.Abs(TextScroll.ScrollableHeight - TextScroll.VerticalOffset) < 0.1) { TextScroll.ScrollToEnd(); } }
void Awake() { state = -1; initialPos = transform.position; cycles = maxCycles; movingPlayer = false; textScroll = FindObjectOfType <TextScroll>(); tg = GetComponent <TriggerGrab>(); psol = FindObjectOfType <PlaySoundOnLoad>(); }
void Awake() { renderer = GetComponent <MeshRenderer>(); triggered = false; active = false; frameTurn = Quaternion.AngleAxis(turn * Time.fixedDeltaTime / openTime, Vector3.forward); collider = GetComponent <Collider>(); textScroller = FindObjectOfType <TextScroll>(); audio = GetComponent <AudioSource>(); }
public void AddText(TextScroll t) { if (t.interrupt) { texts.RemoveFirst(); texts.AddFirst(t); Reset(); } else { texts.AddLast(t); } }
/// <summary> /// Event handler for clock ticks and related work. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The event arguments</param> private void Clock_Tick(object sender, EventArgs e) { string title = this.FindCurrentWindow(); if (title == this.lastWindow) { return; } DateTime now = DateTime.Now; TimeSpan duration = now - this.since; string log = now.ToString("u") + "," + this.lastWindow + "," + duration.ToString() + "\n"; bool isAtBottom = false; if (Math.Abs(TextScroll.VerticalOffset - TextScroll.ScrollableHeight) < this.epsilon) { isAtBottom = true; } WindowLog.Text += log; this.logLength += 1; textLogLength.Text = this.logLength.ToString(); this.since = now; this.lastWindow = title; uint idle = this.GetIdleTime(); if (idle > this.minIdle) { TimeSpan idleTime = new TimeSpan(0, 0, (int)idle); log = "Also idle for approximately " + idleTime.ToString() + "\n"; } if (isAtBottom) { TextScroll.ScrollToEnd(); } this.isDirty = true; }
public void ShowScroll(string actualString, float forSeconds, bool onTop) { if (this.ActiveScroll != null) { TextScroll textScroll1 = this.ActiveScroll; while (textScroll1.NextScroll != null) { textScroll1 = textScroll1.NextScroll; } if (textScroll1.Key == actualString && !textScroll1.Closing) { return; } textScroll1.Closing = true; textScroll1.Timeout = new float?(); TextScroll textScroll2 = new TextScroll(ServiceHelper.Game, actualString, onTop) { Key = actualString }; if ((double)forSeconds > 0.0) { textScroll2.Timeout = new float?(forSeconds); } this.ActiveScroll.NextScroll = textScroll2; } else { ServiceHelper.AddComponent((IGameComponent)(this.ActiveScroll = new TextScroll(ServiceHelper.Game, actualString, onTop) { Key = actualString })); if ((double)forSeconds <= 0.0) { return; } this.ActiveScroll.Timeout = new float?(forSeconds); } }