示例#1
0
 public ProceduralTextWindow(GameObject parent, string textToDisplay, ProceduralTextWindowDefinition ProceduralTextWindowDefinition, ProceduralTextParametersV2 ProceduralTextParametersV2 = null)
 {
     this.ProceduralTextWindowDefinition = ProceduralTextWindowDefinition;
     this.ProceduralTextWindowGameObject = new ProceduralTextWindowGameObject(parent, ProceduralTextWindowDefinition);
     this.ProceduralText = new ProceduralText(textToDisplay, ProceduralTextWindowDefinition.GeneratedTextDimensionsComponent, this.ProceduralTextWindowGameObject.TextComponent, ProceduralTextParametersV2);
     this.ElapsedTime    = 0f;
 }
示例#2
0
        public void Tick()
        {
            if (TriggerLevelSuccessEvent)
            {
                LevelAvailabilityTimelineEventManager.Get().OnLevelCompleted();
                TriggerLevelSuccessEvent = false;
            }

            if (ShowDiscussionWindow)
            {
                ShowDiscussionWindow = false;
                this.ProceduralText  = new ProceduralText(this.TextDisplayed, this.GeneratedTextDimensionsComponent, this.TextObject);
                this.ProceduralText.CalculateCurrentPage();
            }

            if (this.ProceduralText != null)
            {
                this.ProceduralText.Increment();
            }
        }
示例#3
0
        public void OnIncrement(ProceduralText ProceduralText)
        {
            (this.TextGameObject.transform as RectTransform).sizeDelta = new Vector2(ProceduralText.GetWindowWidth(), ProceduralText.GetWindowHeight());


            var TextParentObjectTransform = this.TextParentObject.transform as RectTransform;

            var oldAnchorMax = TextParentObjectTransform.anchorMax;
            var oldAnchorMin = TextParentObjectTransform.anchorMin;

            TextParentObjectTransform.anchorMax = new Vector2(0, 1);
            TextParentObjectTransform.anchorMin = new Vector2(0, 1);

            TextParentObjectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, ProceduralText.GetWindowWidth());
            TextParentObjectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, ProceduralText.GetWindowHeight());

            TextParentObjectTransform.anchorMax = oldAnchorMax;
            TextParentObjectTransform.anchorMin = oldAnchorMin;

            this.ContentSizeFitter.enabled = false;
            this.ContentSizeFitter.enabled = true;
        }