예제 #1
0
 /// <summary>
 /// Sets the current variant index for this controller
 /// </summary>
 /// <param name="variantIdx">The index to set to</param>
 public void SetVariant(int variantIdx)
 {
     if (variantController == null)
     {
         return;
     }
     variantController.SetPositionPercent((float)Math.Max(0, Math.Min(totalVariants, variantIdx) / (float)totalVariants));
 }
    private void UpdateDoorSpeed(bool powered)
    {
        on = powered;
        UpdateAnimAndSoundParams(powered);
        float positionPercent = animController.GetPositionPercent();

        animController.Play(animController.CurrentAnim.hash, animController.PlayMode, 1f, 0f);
        animController.SetPositionPercent(positionPercent);
    }
예제 #3
0
    private void RefreshReleaseTimes()
    {
        TimeSpan timeSpan  = nextReleaseDate - currentReleaseDate;
        TimeSpan timeSpan2 = nextReleaseDate - System.DateTime.UtcNow;
        TimeSpan timeSpan3 = System.DateTime.UtcNow - currentReleaseDate;
        string   empty     = string.Empty;
        string   s         = "4";

        if (!string.IsNullOrEmpty(m_releaseTextOverride))
        {
            empty = m_releaseTextOverride;
        }
        else if (timeSpan2.TotalHours < 8.0)
        {
            empty = UI.DEVELOPMENTBUILDS.UPDATES.TWENTY_FOUR_HOURS;
            s     = "4";
        }
        else if (timeSpan2.TotalDays < 1.0)
        {
            empty = string.Format(UI.DEVELOPMENTBUILDS.UPDATES.FINAL_WEEK, 1);
            s     = "3";
        }
        else
        {
            int num  = timeSpan2.Days % 7;
            int num2 = (timeSpan2.Days - num) / 7;
            if (num2 <= 0)
            {
                empty = string.Format(UI.DEVELOPMENTBUILDS.UPDATES.FINAL_WEEK, num);
                s     = "2";
            }
            else
            {
                empty = string.Format(UI.DEVELOPMENTBUILDS.UPDATES.BIGGER_TIMES, num, num2);
                s     = "1";
            }
        }
        TimerText.text = empty;
        UpdateAnimController.Play(s, KAnim.PlayMode.Loop, 1f, 0f);
        double num3            = timeSpan3.TotalSeconds / timeSpan.TotalSeconds;
        float  positionPercent = Mathf.Clamp01((float)num3);

        UpdateAnimMeterController.SetPositionPercent(positionPercent);
    }
 private void Update()
 {
     if (!loadTriggered && currentConvertedCurrentStage.String != null)
     {
         errorMutex.WaitOne();
         int count = errors.Count;
         errorMutex.ReleaseMutex();
         if (count > 0)
         {
             DoExitFlow();
         }
         else
         {
             updateText.text = Strings.Get(currentConvertedCurrentStage.String);
             if (!debug)
             {
                 int       hash = currentConvertedCurrentStage.Hash;
                 StringKey key  = UI.WORLDGEN.COMPLETE.key;
                 if (hash == key.Hash && currentPercent >= 100f)
                 {
                     if (!KCrashReporter.terminateOnError || !ReportErrorDialog.hasCrash)
                     {
                         percentText.text = string.Empty;
                         loadTriggered    = true;
                         App.LoadScene(mainGameLevel);
                     }
                     return;
                 }
             }
             if (currentPercent < 0f)
             {
                 DoExitFlow();
             }
             else
             {
                 if (currentPercent > 0f && !percentText.gameObject.activeSelf)
                 {
                     percentText.gameObject.SetActive(false);
                 }
                 percentText.text = GameUtil.GetFormattedPercent(currentPercent, GameUtil.TimeSlice.None);
                 meterAnim.SetPositionPercent(currentPercent / 100f);
                 if (firstPassGeneration)
                 {
                     generateThreadComplete = worldGen.IsGenerateComplete();
                     if (!generateThreadComplete)
                     {
                         renderThreadComplete = false;
                     }
                 }
                 if (secondPassGeneration)
                 {
                     renderThreadComplete = worldGen.IsRenderComplete();
                 }
                 if (!shownStartingLocations && firstPassGeneration && generateThreadComplete)
                 {
                     shownStartingLocations = true;
                     ShowStartingLocationChoices();
                 }
                 if (renderThreadComplete)
                 {
                     int num = 0;
                     num++;
                 }
             }
         }
     }
 }