Пример #1
0
        private static void AddDistanceSetting(UIHelper group)
        {
            UITextField distanceField = null;

            distanceField = group.AddTextfield(Localize.Settings_RenderDistance, RenderDistance.ToString(), OnDistanceChanged, OnDistanceSubmitted) as UITextField;

            void OnDistanceChanged(string distance)
            {
            }

            void OnDistanceSubmitted(string text)
            {
                if (float.TryParse(text, out float distance))
                {
                    if (distance < 0)
                    {
                        distance = 300;
                    }

                    RenderDistance.value = distance;
                    distanceField.text   = distance.ToString();
                }
                else
                {
                    distanceField.text = RenderDistance.ToString();
                }
            }
        }
Пример #2
0
            void OnDistanceSubmitted(string text)
            {
                if (float.TryParse(text, out float distance))
                {
                    if (distance < 0)
                    {
                        distance = 300;
                    }

                    RenderDistance.value = distance;
                    distanceField.text   = distance.ToString();
                }
                else
                {
                    distanceField.text = RenderDistance.ToString();
                }
            }
Пример #3
0
        private static void AddDistanceSetting(UIHelper group)
        {
            UITextField distanceField = null;

            distanceField = group.AddTextfield(Localize.Settings_RenderDistance, RenderDistance.ToString(), OnDistanceChanged, OnDistanceSubmitted) as UITextField;