Exemplo n.º 1
0
        public override GameObject CreateObject(Transform parent)
        {
            TextSegmentedControl prefab = Resources.FindObjectsOfTypeAll <TextSegmentedControl>().First(x => x.transform.parent.name == "PlayerStatisticsViewController" && x.GetPrivateField <DiContainer>("_container") != null);
            TextSegmentedControl textSegmentedControl = MonoBehaviour.Instantiate(prefab, parent, false);

            textSegmentedControl.name = "BSMLTabSelector";
            textSegmentedControl.SetPrivateField("_container", prefab.GetPrivateField <DiContainer>("_container"));
            (textSegmentedControl.transform as RectTransform).anchoredPosition = new Vector2(0, 0);
            foreach (Transform transform in textSegmentedControl.transform)
            {
                GameObject.Destroy(transform.gameObject);
            }
            textSegmentedControl.gameObject.AddComponent <TabSelector>().textSegmentedControl = textSegmentedControl;
            return(textSegmentedControl.gameObject);
        }
        public override GameObject CreateObject(Transform parent)
        {
            TextSegmentedControl prefab = Resources.FindObjectsOfTypeAll <TextSegmentedControl>().First(x => x.name == "BeatmapDifficultySegmentedControl" && x.GetPrivateField <DiContainer>("_container") != null);
            TextSegmentedControl textSegmentedControl = MonoBehaviour.Instantiate(prefab, parent, false);

            textSegmentedControl.name = "BSMLTextSegmentedControl";
            textSegmentedControl.SetPrivateField("_container", prefab.GetPrivateField <DiContainer>("_container"));
            (textSegmentedControl.transform as RectTransform).anchoredPosition = new Vector2(0, 0);
            foreach (Transform transform in textSegmentedControl.transform)
            {
                GameObject.Destroy(transform.gameObject);
            }
            MonoBehaviour.Destroy(textSegmentedControl.GetComponent <BeatmapDifficultySegmentedControlController>());
            return(textSegmentedControl.gameObject);
        }