Beispiel #1
0
        public void ShowResult(SW_Search_Result result)
        {
            if (!rectTransform)
            {
                rectTransform = GetComponent <RectTransform>();
            }

            Result    = result;
            Name.text = Result.Name;
            Type.text = Result.Type.ToString();

            float sizeMulti = 0;

            rectTransform.ForceUpdateRectTransforms();
            Name.rectTransform.ForceUpdateRectTransforms();
            Name.ForceMeshUpdate();
            int lines = Name.textInfo.lineCount;

            if (lines > 1)
            {
                sizeMulti = lines;
            }
            if (sizeMulti > 0)
            {
                float wantedSize = 0;
                wantedSize = 38 + (19 * sizeMulti - 1);
                rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, wantedSize);
            }
        }
Beispiel #2
0
 public void OpenItem(SW_Search_Result result)
 {
     if (!Overlord)
     {
         Overlord = FindObjectOfType <SW_Table_Overlord>();
     }
     Overlord.OpenItemDisplay(result.Type, result.Name, result.Subtitle, result.SearchObject);
     CloseSearch(true);
 }