コード例 #1
0
        // Make
        //---------------------------------------------
        public static apGUIContentWrapper Make(string text, bool isLongText)
        {
            apGUIContentWrapper newGUIContent = new apGUIContentWrapper(isLongText);

            newGUIContent.SetText(text);
            return(newGUIContent);
        }
コード例 #2
0
        public static apGUIContentWrapper Make(int space, string text, Texture2D image)
        {
            apGUIContentWrapper newGUIContent = new apGUIContentWrapper(false);

            newGUIContent.SetText(space, text);
            newGUIContent.SetImage(image);
            return(newGUIContent);
        }
コード例 #3
0
        public static apGUIContentWrapper Make(string text, Texture2D image, string tooltip)
        {
            apGUIContentWrapper newGUIContent = new apGUIContentWrapper(false);

            newGUIContent.SetText(text);
            newGUIContent.SetImage(image);
            newGUIContent.SetToolTop(tooltip);
            return(newGUIContent);
        }
コード例 #4
0
        private void MakeGUIContent()
        {
            if (_icon != null)
            {
                if (_guiContent_Icon == null)
                {
                    _guiContent_Icon = apGUIContentWrapper.Make(_icon);
                }
                else
                {
                    _guiContent_Icon.SetImage(_icon);
                }
                //_guiContent_Icon = new GUIContent(_icon);//이전
            }
            else
            {
                //_guiContent_Icon = null;//null로 만들진 않는다.
                _guiContent_Icon.SetVisible(false);
            }

            //이전
            //if (!string.IsNullOrEmpty(_text))
            //{
            //	_guiContent_Text = new GUIContent(" " + _text + "  ");
            //}
            //else
            //{
            //	_guiContent_Text = new GUIContent(" <No Name>  ");
            //}

            //변경
            if (_guiContent_Text == null)
            {
                _guiContent_Text = new apGUIContentWrapper();
            }

            if (!string.IsNullOrEmpty(_text))
            {
                //공백(1) + 텍스트 + 공백(2)
                _guiContent_Text.ClearText(false);
                _guiContent_Text.AppendSpaceText(1, false);
                _guiContent_Text.AppendText(_text, false);
                _guiContent_Text.AppendSpaceText(2, true);
            }
            else
            {
                _guiContent_Text.SetText(NO_NAME);
            }

            RefreshPrevRender();
        }