Esempio n. 1
0
    protected override void OnMouseLeftDoubleClick(PointerEventData eventData)
    {
        base.OnMouseLeftDoubleClick(eventData);

        //if (_MyKVContainer.KVDateDic.ContainsKey (TreeItemID.ToString ())) {
        //	Debug.Log ("==========>包含:" + TreeItemID.ToString ());
        //}
        //else
        //{
        //	Debug.Log ("==========>不包含:" + TreeItemID.ToString ());
        //}

        //if (_MyKVContainer.KVDateDic[TreeItemID.ToString()].ContainsKey(Index)) {
        //	Debug.Log ("==========>包含Index:" + Index);
        //}
        //else
        //{
        //	Debug.Log ("==========>不包含Index:" + Index);
        //}

        KVData data  = _MyKVContainer.KVDateDic[TreeItemID.ToString()][Index];
        string title = "title";
        string key   = data.key;
        string value = data.value;
        string type  = data.type;

        Log.i("KVListItem", "OnMouseLeftDoubleClick", "Index:" + Index + " type:" + type + " key:" + key + " value:" + value);
        KVDataModifyDialog.Open(OnDialogReturnValue, _MyKVContainer.Name, title, data.key, value, type);
    }
Esempio n. 2
0
    /// <summary>
    /// 打开窗口操作
    /// </summary>
    /// <param name="callback">用于返回窗口操作的结果</param>
    /// <param name="editorType">当前打开dlg的kvitem属于于哪个editor,有了这个信息,就可以去特定editor数据模板中查找一些数据项的dropdown选项</param>
    /// <param name="title">打开窗口的名称</param>
    /// <param name="key">kvitem中 KVData的 key值</param>
    /// <param name="value">kvitem中 KVData的 value值</param>
    /// <param name="type">kvitem中 KVData的 type值</param>
    public static void Open(Listener <byte[]> callback, string editorType, string title = "title", string key = "key", string value = "value", string type = "string")
    {
        var go = GameObject.Instantiate(Resources.Load("Prefabs/DefaultDialog")) as GameObject;

        go.transform.SetParent(GEditorRoot.GetIns().DialogPanel);
        var rt = go.GetComponent <RectTransform> ();

        rt.anchoredPosition = Vector2.zero;

        KVDataModifyDialog dlg = go.GetComponent <KVDataModifyDialog>();

        //dialog.FilterRegularStr = regular;
        //dialog.WarningStr = info;
        //dialog.Info.text = info;
        dlg.Title.text           = title;
        dlg.KeyInputField.text   = key;
        dlg.ValueInputField.text = value;
        dlg.EditorType           = editorType;
        dlg.DataType             = type;
        dlg.TypeInfo.text        = type;
        dlg.InitContentDropdown(type);

        dlg.DlgCallback = callback;
    }