コード例 #1
0
 public void OnEnable()
 {
     if (!string.IsNullOrEmpty(this._key) && (!UiTranslationDatabase.OriginalVersion || this._enableForOriginalVersion))
     {
         UiTranslationOverlaySystem.RegisterLabel(base.transform, this._key, this._textColor, this._backgroundColor, this._alignment, this._currentViewOption);
         if (this._overrideDepth || this._overrideHeight || this._currentViewOption == UiTranslationOverlaySystem.CurrentViewOptions.AllowInBook || this._currentViewOption == UiTranslationOverlaySystem.CurrentViewOptions.AllowInInventory)
         {
             UiTranslationOverlayLabel overlayLabel = UiTranslationOverlaySystem.GetOverlayLabel(base.transform);
             if (overlayLabel)
             {
                 this._ol = overlayLabel;
                 if (this._overrideDepth)
                 {
                     if (this._currentViewOption != UiTranslationOverlaySystem.CurrentViewOptions.AllowInBook)
                     {
                         this._oldDepth = overlayLabel._follow._minDepth;
                         overlayLabel._follow._minDepth = this._depth;
                     }
                 }
                 if (this._overrideHeight)
                 {
                     if (this._currentViewOption != UiTranslationOverlaySystem.CurrentViewOptions.AllowInBook)
                     {
                         this._oldHeight = overlayLabel._follow._worldOffset.y;
                         overlayLabel._follow._worldOffset.y = this._height;
                     }
                 }
                 if (this._currentViewOption == UiTranslationOverlaySystem.CurrentViewOptions.AllowInBook || this._currentViewOption == UiTranslationOverlaySystem.CurrentViewOptions.AllowInInventory)
                 {
                     overlayLabel._follow._viewportOffsetBook = this._viewportOffset;
                 }
             }
         }
     }
 }
コード例 #2
0
 private void DisableOverlayLabel(UiTranslationOverlayLabel overlayLabel)
 {
     UiTranslationOverlaySystem.Instance._labelPool.Enqueue(overlayLabel);
     overlayLabel.gameObject.SetActive(false);
 }