Ejemplo n.º 1
0
        /** 登録。
         */
        public void Regist(InputField2D a_item)
        {
            //list
            this.list.Add(a_item);

            //sort_request_flag
            this.sort_request_flag = true;
        }
Ejemplo n.º 2
0
        /** 作成。
         *
         *      「DRAWPRIORITY_STEP」ごとに描画カメラが切り替わる。
         *      同一カメラ内では必ずテキストが上に表示される。
         *      テキストの上にスプライトを表示する場合は、描画カメラが切り替わるようにプライオリィを設定する必要がある。
         *
         */
        public static InputField2D Create(Fee.Deleter.Deleter a_deleter, long a_drawpriority)
        {
            InputField2D t_this = Fee.Render2D.Render2D.GetInstance().GetInputFieldList().PoolNew();
            {
                //どこから確保されたのか。
                                #if (UNITY_EDITOR)
                {
                    try{
                        System.Text.StringBuilder t_stringbuilder = new System.Text.StringBuilder(Config.DEBUG_TRACECOUNT * 32);
                        for (int ii = Config.DEBUG_TRACECOUNT; ii >= 1; ii--)
                        {
                            System.Diagnostics.StackFrame t_stackframe = new System.Diagnostics.StackFrame(ii);
                            if (t_stackframe != null)
                            {
                                if (t_stackframe.GetMethod() != null)
                                {
                                    t_stringbuilder.Append(t_stackframe.GetMethod().ReflectedType.FullName);
                                    t_stringbuilder.Append(" : ");
                                    t_stringbuilder.Append(t_stackframe.GetMethod().Name);
                                    t_stringbuilder.Append("\n");
                                }
                            }
                        }
                        t_this.debug = t_stringbuilder.ToString();
                    }catch (System.Exception t_exception) {
                        Tool.DebugReThrow(t_exception);
                    }
                }
                                #endif

                //表示フラグ。
                t_this.visible = true;

                //削除フラグ。
                t_this.is_delete_request = false;
                Render2D.GetInstance().InputField2D_Regist(t_this);

                //描画プライオリティ。
                t_this.drawpriority = a_drawpriority;

                //位置。
                //t_this.pos;

                //パラメータ。
                t_this.param.InitializeFromPool();

                //削除管理。
                if (a_deleter != null)
                {
                    a_deleter.Regist(t_this);
                }
            }
            return(t_this);
        }
Ejemplo n.º 3
0
        /** 作成。
         *
         *      「DRAWPRIORITY_STEP」ごとに描画カメラが切り替わる。
         *      同一カメラ内では必ずテキストが上に表示される。
         *      テキストの上にスプライトを表示する場合は、描画カメラが切り替わるようにプライオリィを設定する必要がある。
         *
         */
        public static InputField2D Create(Fee.Deleter.Deleter a_deleter, long a_drawpriority)
        {
            InputField2D t_this = Fee.Render2D.Render2D.GetInstance().GetInputFieldList().PoolNew();
            {
                                #if (UNITY_EDITOR)
                {
                    try{
                        System.Diagnostics.StackFrame t_stackframe = new System.Diagnostics.StackFrame(1);
                        if (t_stackframe != null)
                        {
                            if (t_stackframe.GetMethod() != null)
                            {
                                t_this.debug = t_stackframe.GetMethod().ReflectedType.FullName + " : " + t_stackframe.GetMethod().Name;
                            }
                        }
                    }catch (System.Exception t_exception) {
                        Tool.DebugReThrow(t_exception);
                    }
                }
                                #endif

                //表示フラグ。
                t_this.visible = true;

                //削除フラグ。
                t_this.is_delete_request = false;
                Render2D.GetInstance().InputField2D_Regist(t_this);

                //描画プライオリティ。
                t_this.drawpriority = a_drawpriority;

                //位置。
                //t_this.pos;

                //パラメータ。
                t_this.param.InitializeFromPool();

                //削除管理。
                if (a_deleter != null)
                {
                    a_deleter.Regist(t_this);
                }
            }
            return(t_this);
        }
Ejemplo n.º 4
0
        /** 計算。入力フィールド。
         */
        public void CalcInputFieldRect(InputField2D a_inputfield)
        {
            //サイズ計算。
            {
                UnityEngine.Vector2 t_sizedelta = new UnityEngine.Vector2(a_inputfield.GetW() * this.calc_ui_scale, a_inputfield.GetH() * this.calc_ui_scale);
                a_inputfield.Raw_SetRectTransformSizeDelta(in t_sizedelta);
            }

            //位置計算。
            UnityEngine.Vector3 t_localposition = new UnityEngine.Vector3(this.calc_ui_x + a_inputfield.GetX() * this.calc_ui_scale, this.calc_ui_y - a_inputfield.GetY() * this.calc_ui_scale, 0.0f);
            {
                //計算済みサイズ取得。
                UnityEngine.Vector2 t_sizedelta;
                a_inputfield.Raw_GetRectTransformSizeDelta(out t_sizedelta);

                t_localposition.x += t_sizedelta.x / 2;
                t_localposition.y -= t_sizedelta.y / 2;
            }
            a_inputfield.Raw_SetRectTransformLocalPosition(in t_localposition);
        }
Ejemplo n.º 5
0
        /** 初期化。
         */
        public void Initialize(InputField2D a_parent)
        {
            //raw
            this.raw_gameobject          = Fee.Instantiate.Instantiate.CreateUiInputField("InputField", Fee.Render2D.Render2D.GetInstance().GetRootTransform());
            this.raw_focus_monobehaviour = this.raw_gameobject.AddComponent <Fee.Ui.Focus_MonoBehaviour>();
            this.raw_transform           = this.raw_gameobject.GetComponent <UnityEngine.Transform>();
            this.raw_inputfield          = this.raw_gameobject.GetComponent <UnityEngine.UI.InputField>();
            this.raw_recttransform       = this.raw_gameobject.GetComponent <UnityEngine.RectTransform>();
            this.raw_text             = this.raw_inputfield.textComponent;
            this.raw_image            = this.raw_inputfield.image;
            this.raw_placeholder_text = this.raw_inputfield.placeholder.GetComponent <UnityEngine.UI.Text>();
            this.raw_gameobject.SetActive(false);

            {
                UnityEngine.UI.Navigation t_navigation = this.raw_inputfield.navigation;
                t_navigation.mode = UnityEngine.UI.Navigation.Mode.None;
                this.raw_inputfield.navigation = t_navigation;
            }

            //共通マテリアルアイテム複製。
            this.raw_custom_text_material_item  = Render2D.GetInstance().GetUiTextMaterialItem().DuplicateMaterialItem();
            this.raw_custom_image_material_item = Render2D.GetInstance().GetUiImageMaterialItem().DuplicateMaterialItem();
        }
Ejemplo n.º 6
0
 /** 計算。フォントサイズ。
  */
 public int CalcFontSize(InputField2D a_inputfield)
 {
     return((int)(a_inputfield.GetFontSize() * this.calc_ui_scale));
 }