コード例 #1
0
ファイル: Factory.cs プロジェクト: jackmurray50/Wargame
        } // 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
ファイル: Factory.cs プロジェクト: YummyChiu/ModelView
        } // 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);
        }