예제 #1
0
    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;
    }
예제 #2
0
 private void OnConvertOutput(string output)
 {
     ConvertOutputText.Text += output + "\n";
     if (Math.Abs(TextScroll.ScrollableHeight - TextScroll.VerticalOffset) < 0.1)
     {
         TextScroll.ScrollToEnd();
     }
 }
예제 #3
0
 void Awake()
 {
     state        = -1;
     initialPos   = transform.position;
     cycles       = maxCycles;
     movingPlayer = false;
     textScroll   = FindObjectOfType <TextScroll>();
     tg           = GetComponent <TriggerGrab>();
     psol         = FindObjectOfType <PlaySoundOnLoad>();
 }
예제 #4
0
 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>();
 }
예제 #5
0
 public void AddText(TextScroll t)
 {
     if (t.interrupt)
     {
         texts.RemoveFirst();
         texts.AddFirst(t);
         Reset();
     }
     else
     {
         texts.AddLast(t);
     }
 }
예제 #6
0
        /// <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;
        }
예제 #7
0
 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);
     }
 }