Beispiel #1
0
        void Initialize()
        {
            //这结构要重新规划

            //fillRect
            RectTransform fillHolderRect = KComponentUtil.NeedChildComponent <RectTransform>(gameObject, "Container_fillArea/Container_fillHolder");

            this.fillRect            = fillHolderRect;
            fillHolderRect.sizeDelta = new Vector2(0, 0);

            //根据进度填充的那张图片
            m_fillImage = KComponentUtil.NeedChildComponent <StateImage>(gameObject, "Container_fillArea/Container_fillHolder/Image_fill");
            if (m_fillImage)
            {
                m_fillImageRect          = m_fillImage.gameObject.GetComponent <RectTransform>();
                m_fillImage.SlicedFilled = m_slicedFilled;
            }

            //handleRect
            GameObject handleGo = KComponentUtil.NeedChild(gameObject, "Container_handleArea/Container_handleHolder");

            if (handleGo != null)
            {
                RectTransform handleHolderRect = handleGo.GetComponent <RectTransform>();
                this.handleRect = handleHolderRect;
            }


            RefreshFillImage(this.value);

            base.onValueChanged.AddListener(onInternalValueChanged);
        }
Beispiel #2
0
 public T GetChildComponent <T>(string path) where T : Component
 {
     return(KComponentUtil.NeedChildComponent <T>(gameObject, path));
 }
Beispiel #3
0
 public GameObject GetChild(string path)
 {
     return(KComponentUtil.NeedChild(gameObject, path));
 }