예제 #1
0
        private static bool ProcessGameObject(GameObject target, Any property)
        {
            if (property.Is <bool>())
            {
                target.SetActive(property.BoolValue());
                return(true);
            }

            return(false);
        }
예제 #2
0
        private static bool ProcessButton(GameObject target, Any property)
        {
            var button = target.GetComponent <Button>();

            if (button == null)
            {
                return(false);
            }

            if (property.Is <bool>())
            {
                button.interactable = property.BoolValue();
                return(true);
            }

            return(false);
        }
예제 #3
0
        private static bool ProcessSlider(GameObject target, Any property)
        {
            var slider = target.GetComponent <Slider>();

            if (slider == null)
            {
                return(false);
            }

            if (property.Is <bool>())
            {
                slider.interactable = property.BoolValue();
                return(true);
            }

            if (property.Is <float>())
            {
                slider.value = property.FloatValue();
                return(true);
            }

            return(false);
        }