예제 #1
0
        } // makeScrollbar

        private MeasureMaster MakeMeasureMaster(RectTransform parent)
        {
            GameObject go = new GameObject();

            go.name = "MeasureMaster";
            go.AddComponent <RectTransform>();
#if !TMP_PRESENT
            go.SetActive(false);
#endif
            MeasureMaster mm = go.AddComponent <MeasureMaster>();
            go.transform.SetParent(parent, false);
#if TMP_PRESENT
            TextMeshProUGUI text = go.AddComponent <TextMeshProUGUI>();
#else
            Text text = go.AddComponent <Text>();
            text.material = this.table.fontMaterial;
#endif
            text.raycastTarget = false;
            text.font          = this.table.font;
            text.fontStyle     = this.table.fontStyle;
            CanvasGroup cg = go.AddComponent <CanvasGroup>();
            cg.alpha          = 0f;
            cg.blocksRaycasts = false;
            mm.Initialize(this.table, text, this.control);
            return(mm);
        }
예제 #2
0
 public bool Initialize(Table table, RectTransform rt, RectTransform cgrt,
                        CanvasGroup cg, Image background, MeasureMaster mm,
                        bool isHeader = false, bool isFooter = false)
 {
     this._cgrt      = cgrt;
     this._cg        = cg;
     this.table      = table;
     this.background = background;
     if (!isHeader && !isFooter)
     {
         this.table.rows.Add(this);
     }
     this.isHeader = isHeader;
     this.isFooter = isFooter;
     this.cells    = new List <Cell>();
     this._rt      = rt;
     this.mm       = mm;
     return(true);
 }
예제 #3
0
        } // makeScrollbar

        private MeasureMaster MakeMeasureMaster(RectTransform parent)
        {
            GameObject go = new GameObject();

            go.name = "MeasureMaster";
            go.AddComponent <RectTransform>();
            go.SetActive(false);
            MeasureMaster mm = go.AddComponent <MeasureMaster>();

            go.transform.SetParent(parent, false);
            Text text = go.AddComponent <Text>();

            text.font      = this.table.font;
            text.fontStyle = this.table.fontStyle;
            CanvasGroup cg = go.AddComponent <CanvasGroup>();

            cg.alpha          = 0f;
            cg.blocksRaycasts = false;
            mm.Initialize(this.table, text, this.control);
            return(mm);
        }