Exemplo n.º 1
0
    public GameObject CreateIdol(int color, int shape, EventBind onPickupAction)
    {
        Material   mat          = idolMaterials[color];
        GameObject originalItem = idolPrefabs[shape];
        GameObject go           = Instantiate(originalItem);
        Idol       idol         = go.GetComponent <Idol>();

        idol.intMetaData = new int[] { color, shape };
        idol.color       = mat.name;
        go.name          = mat.name;
        Renderer r = go.GetComponent <Renderer>();

        r.material = mat;
        InventoryItem ii = go.GetComponent <InventoryItem>();

        string[] floatyTextOptions = null;
        if (resourceNames == null || (resourceNames.TryGetValue(mat.name, out floatyTextOptions) && floatyTextOptions != null))
        {
            string floatyTextString = floatyTextOptions[shape];
            idol.kind   = floatyTextString;
            ii.itemName = floatyTextString;
        }
        if (onPickupAction != null && !onPickupAction.IsAlreadyBound(ii.addToInventoryEvent))
        {
            //Show.Log("bound "+onPickupAction.methodName);
            onPickupAction.Bind(ii.addToInventoryEvent);
        }
        return(go);
    }
Exemplo n.º 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                int      qty, itemId;
                DateTime saleDate;
                double   rate, amount;

                saleDate = dtpDate.Value;
                itemId   = Convert.ToInt32(cmbItem.SelectedValue);
                qty      = Convert.ToInt32(txtQty.Text);
                rate     = Convert.ToDouble(txtRate.Text);
                amount   = Convert.ToDouble(txtAmount.Text);
                objLogics.Insert(saleDate, itemId, qty, rate, amount);

                EventBind.Invoke();
                this.Close();
            }
            catch (FormatException)
            {
                MessageBox.Show("Please Enter Required Fields");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 3
0
 public static void Unbind(EventBind b)
 {
     if (instance.connections.ContainsKey(b.eventName))
     {
         instance.connections[b.eventName].Remove(b);
     }
 }
 private void Reset()
 {
     KeyBind(KCode.BackQuote, KModifier.None, "activate console", nameof(SetScreenSpaceCanvas), target: this);
     KeyBind(KCode.Escape, KModifier.None, "deactivate console", nameof(SetWorldSpaceCanvas), target: this);
     EventBind.On(callbacks.WhenThisActivates, this, nameof(Pause));
     EventBind.On(callbacks.WhenThisDeactivates, this, nameof(Unpause));
 }
Exemplo n.º 5
0
 public void AddEvents(Func <bool> onPressEvent = null, Func <bool> onHoldEvent = null, Func <bool> onReleaseEvent = null,
                       EventBind pressFunc      = null, EventBind holdFunc      = null, EventBind releaseFunc = null)
 {
     if (onPressEvent != null)
     {
         AddPress(onPressEvent);
     }
     if (onHoldEvent != null)
     {
         AddHold(onHoldEvent);
     }
     if (onReleaseEvent != null)
     {
         AddRelease(onReleaseEvent);
     }
     if (pressFunc != null)
     {
         AddPress(pressFunc);
     }
     if (holdFunc != null)
     {
         AddHold(holdFunc);
     }
     if (releaseFunc != null)
     {
         AddRelease(releaseFunc);
     }
 }
Exemplo n.º 6
0
        public void Init()
        {
            TMPro.TMP_InputField tif = GetComponentInChildren <TMPro.TMP_InputField>();
            if (tif != null)
            {
                EventBind.IfNotAlready(setText, tif, "set_text"); getText = () => tif.text;
            }
            TMPro.TMP_Text tmp = GetComponentInChildren <TMPro.TMP_Text>();
            if (tmp != null)
            {
                EventBind.IfNotAlready(setText, tmp, "set_text"); getText = () => tmp.text;
            }
            InputField inf = GetComponentInChildren <InputField>();

            if (inf != null)
            {
                EventBind.IfNotAlready(setText, inf, "set_text"); getText = () => inf.text;
            }
            Text txt = GetComponentInChildren <Text>();

            if (txt != null)
            {
                EventBind.IfNotAlready(setText, txt, "set_text"); getText = () => txt.text;
            }
            if (UiImage.HasImageHolder(gameObject))
            {
                EventBind.IfNotAlready(setText, this, SetImageByName); getText = GetImageName;
            }
        }
Exemplo n.º 7
0
 public void AddHold(EventBind a)
 {
     if (onHold == null)
     {
         onHold = new UnityEvent();
     }
     a.Bind(onHold);
 }
Exemplo n.º 8
0
 public void AddRelease(EventBind a)
 {
     if (onRelease == null)
     {
         onRelease = new UnityEvent();
     }
     a.Bind(onRelease);
 }
Exemplo n.º 9
0
 public void AddPress(EventBind a)
 {
     if (onPress == null)
     {
         onPress = new UnityEvent();
     }
     a.Bind(onPress);
 }
Exemplo n.º 10
0
 public void Generate(EventBind onPickupAction)
 {
     idols = CreateIdols(game.maze.floorTileNeighborHistogram[1], onPickupAction);
     for (int i = 0; i < game.maze.floorTileNeighborHistogram[1]; ++i)
     {
         game.maze.PlaceObjectOverTile(idols[i].transform, game.maze.floorTiles[i]);
     }
 }
Exemplo n.º 11
0
 public void BindEvents()
 {
     Init();
     CharacterMove.Callbacks cb = character.move.callbacks;
     EventBind.On(cb.jumped, this, nameof(Jump));
     EventBind.On(cb.stand, this, nameof(Stand));
     EventBind.On(cb.fall, this, nameof(Fall));
     EventBind.On(cb.arrived, this, nameof(Wave));
 }
Exemplo n.º 12
0
 public Entry(string text, object target, string methodName, bool valuePersists = true)
 {
     if (!string.IsNullOrEmpty(methodName))
     {
         selectionAction = new UnityEvent();
         EventBind.On(selectionAction, target, methodName);
     }
     this.text = text;
     eventOnly = !valuePersists;
 }
Exemplo n.º 13
0
        public static bool AddOnButtonClickIfNotAlready(GameObject obj, Object target, UnityAction action)
        {
            Button button = obj.GetComponent <Button>();

            if (button != null)
            {
                EventBind.IfNotAlready(button.onClick, target, action);
                return(true);
            }
            return(false);
        }
Exemplo n.º 14
0
 /// <param name="et"></param>
 /// <param name="type"></param>
 /// <param name="target">if not null, and in the UnityEditor, will register the event in the UI</param>
 /// <param name="pointerEvent">tip: try to typecast the <see cref="BaseEventData"/> as <see cref="PointerEventData"/></param>
 public static void AddEvent(EventTrigger et, EventTriggerType type, object target, UnityAction <BaseEventData> pointerEvent)
 {
     EventTrigger.Entry entry = et.triggers.Find(t => t.eventID == type);
     if (entry == null)
     {
         entry = new EventTrigger.Entry {
             eventID = type
         };
     }
     EventBind.On(entry.callback, target, pointerEvent);
     et.triggers.Add(entry);
 }
Exemplo n.º 15
0
        private void Init()
        {
            UnityDataSheet uds = UDS();

            if (uds == null)
            {
                return;
            }
            Button b = GetComponent <Button>();

            EventBind.On(b.onClick, uds, uds.RefreshData);
        }
Exemplo n.º 16
0
    public static EventBind Bind(string eventName, Action <object> action)
    {
        EventBind eventBind = new EventBind(eventName, action);

        if (!instance.connections.ContainsKey(eventName))
        {
            instance.connections.Add(eventName, new List <EventBind>());
        }

        instance.connections[eventName].Add(eventBind);

        return(eventBind);
    }
Exemplo n.º 17
0
    public void GenerateMoreIdols(EventBind onPickupAction)
    {
        // TODO maze should have a list of unfilled tiles sorted by weight
        int start = game.maze.floorTileNeighborHistogram[1] + game.npcCreator.npcs.Count;
        int limit = game.maze.floorTileNeighborHistogram[1] + game.maze.floorTileNeighborHistogram[2] + game.maze.floorTileNeighborHistogram[3];
        int ii    = idols.Count;

        idols.AddRange(CreateIdols(limit - start, onPickupAction));
        for (int i = start; i < limit; ++i)
        {
            game.maze.PlaceObjectOverTile(idols[ii++].transform, game.maze.floorTiles[i]);
        }
    }
Exemplo n.º 18
0
 public void AddKeyCombinations(KCombo[] keyCombo, string nameToUse, Func <bool> onPress = null, Func <bool> onHold = null, Func <bool> onRelease = null,
                                EventBind setPress = null, EventBind setHold = null, EventBind setRelease = null)
 {
     if (keyCombo != null)
     {
         AddComplexKeyPresses(keyCombo);
     }
     if (string.IsNullOrEmpty(name))
     {
         name = nameToUse;
     }
     keyEvent.AddEvents(onPress, onHold, onRelease, setPress, setHold, setRelease);
 }
Exemplo n.º 19
0
 /// <summary>
 /// describes functions to execute when any of the specified key-combinations are pressed/held/released
 /// </summary>
 public KBind(KCombo[] kCombos, string name = null, Func <bool> onPressEvent          = null, Func <bool> onHoldEvent = null,
              Func <bool> onReleaseEvent    = null, Func <bool> additionalRequirement = null,
              bool eventAlwaysTriggerable   = false, EventBind pressFunc              = null, EventBind holdFunc = null, EventBind releaseFunc = null)
 {
     keyCombinations = kCombos;
     Init();
     Array.Sort(keyCombinations); Array.Reverse(keyCombinations);             // put least complex key bind first, backwards from usual processing
     this.name = name;
     keyEvent.AddEvents(onPressEvent, onHoldEvent, onReleaseEvent, pressFunc, holdFunc, releaseFunc);
     if (additionalRequirement != null)
     {
         this.additionalRequirement = additionalRequirement;
     }
     this.alwaysTriggerable = eventAlwaysTriggerable;
 }
Exemplo n.º 20
0
    public List <GameObject> CreateIdols(int count, EventBind onPickupAction)
    {
        List <GameObject> idols = new List <GameObject>();
        int advancementindex    = idolsDistributed;

        for (int i = 0; i < count; ++i)
        {
            idols.Add(CreateIdol(advancementColor[advancementindex], advancementShape[advancementindex], onPickupAction));
            ++advancementindex;
            if (advancementindex >= advancementShape.Length)
            {
                advancementindex = 0;
            }
        }
        return(idols);
    }
Exemplo n.º 21
0
        public static void BindDropdownAction(TMP_Dropdown dd, object ownerOfDropdownHandler, Action <int> action)
        {
            if (ownerOfDropdownHandler == null || action == null)
            {
                return;
            }
            //Show.Log("set " + options.Count + " opt : " + dd + "(" + dd.options.Count + ")\n" + options.Stringify(pretty: true));
#if UNITY_EDITOR
            UnityEngine.Object uObj = ownerOfDropdownHandler as UnityEngine.Object;
            if (uObj != null)
            {
                EventBind.IfNotAlready(dd.onValueChanged, uObj, action.Method.Name);
                return;
            }
#endif
            dd.onValueChanged.RemoveAllListeners();
            dd.onValueChanged.AddListener(action.Invoke);
        }
Exemplo n.º 22
0
        private void Reset()
        {
            UnityConsole          console          = GetComponent <UnityConsole>();
            UnityConsoleCommander consoleCommander = GetComponent <UnityConsoleCommander>();

            if (consoleCommander != null)
            {
                EventBind.On(inputListener, consoleCommander, nameof(consoleCommander.DoCommand));
            }
            KeyBind(KCode.Equals, KModifier.AnyCtrl, "+ console font", nameof(console.AddToFontSize), 1f, console);
            KeyBind(KCode.Minus, KModifier.AnyCtrl, "- console font", nameof(console.AddToFontSize), -1f, console);
            KeyBind(KCode.Return, KModifier.NoShift, "submit console input", nameof(FinishCurrentInput), target: this);
            KeyBind(KCode.C, KModifier.AnyCtrl, "copy from command console", nameof(CopyToClipboard), target: this);
            KeyBind(KCode.V, KModifier.AnyCtrl, "paste into command console", nameof(PasteFromClipboard), target: this);
            KeyBind(KCode.UpArrow, KModifier.AnyAlt, "move cursor up", nameof(MoveCursorUp), target: this);
            KeyBind(KCode.LeftArrow, KModifier.AnyAlt, "move cursor left", nameof(MoveCursorLeft), target: this);
            KeyBind(KCode.DownArrow, KModifier.AnyAlt, "move cursor down", nameof(MoveCursorDown), target: this);
            KeyBind(KCode.RightArrow, KModifier.AnyAlt, "move cursor right", nameof(MoveCursorRight), target: this);
            KeyBind(KCode.UpArrow, KModifier.AnyShift, "shift window up", nameof(ShiftWindowUp), target: this);
            KeyBind(KCode.LeftArrow, KModifier.AnyShift, "shift window left", nameof(ShiftWindowLeft), target: this);
            KeyBind(KCode.DownArrow, KModifier.AnyShift, "shift window down", nameof(ShiftWindowDown), target: this);
            KeyBind(KCode.RightArrow, KModifier.AnyShift, "shift window right", nameof(ShiftWindowRight), target: this);
        }
Exemplo n.º 23
0
        public static void RemoveEvent(EventTrigger et, EventTriggerType type, Object target, UnityAction <BaseEventData> pointerEvent)
        {
            EventTrigger.Entry entry = et.triggers.Find(t => t.eventID == type);
            if (entry == null)
            {
                return;
            }
            entry.callback.RemoveListener(pointerEvent);

            List <int> eventsToRemove = new List <int>();

            for (int i = 0; i < entry.callback.GetPersistentEventCount(); ++i)
            {
                if (entry.callback.GetPersistentTarget(i) == target && entry.callback.GetPersistentMethodName(i) == pointerEvent.Method.Name)
                {
                    eventsToRemove.Add(i);
                }
            }
            if (eventsToRemove.Count < entry.callback.GetPersistentEventCount())
            {
                // for whatever reason, UnityEventTools.RemovePersistentListener() exists, but only in the UnityEditor context.
                // to delete a unity event listener, the entire event must simply be replaced by a new event with the offending listener missing.
                EventTrigger.Entry newEntry = new EventTrigger.Entry {
                    eventID = type
                };
                for (int i = 0; i < entry.callback.GetPersistentEventCount(); ++i)
                {
                    if (!eventsToRemove.Contains(i))
                    {
                        EventBind.On(newEntry.callback, entry.callback.GetPersistentTarget(i), entry.callback.GetPersistentMethodName(i));
                    }
                }
                et.triggers.Remove(entry);
                et.triggers.Add(newEntry);
            }
        }
Exemplo n.º 24
0
    public void LevelGenerate(LevelState lvl)
    {
        Team      team      = Global.GetComponent <Team>();
        EventBind checkGoal = new EventBind(this, nameof(GoalCheck));

        if (lvl == null)
        {
            lvl                  = new LevelState();
            lvl.stage            = maze.stage;
            lvl.seed             = random.Seed;
            lvl.idolsDistributed = idolCreator.idolsDistributed;
            if (inventory.GetItems() != null)
            {
                lvl.idolInventory = CodeConvert.Stringify(inventory.GetItems().ConvertAll(go => {
                    Idol t = go.GetComponent <Idol>(); return(t ? t.intMetaData : null);
                }));
            }
            else
            {
                lvl.idolInventory = "";
            }
            lvl.variables = CodeConvert.Stringify(mainDictionaryKeeper.Dictionary);
            lvl.allies    = CodeConvert.Stringify(team.members.ConvertAll(m => npcCreator.npcs.FindIndex(n => n.gameObject == m)));
            levels.Add(lvl);
        }
        else
        {
            Tokenizer tokenizer = new Tokenizer();
            // check if level is valid
            if (levels.IndexOf(lvl) < 0)
            {
                throw new Exception("TODO validate the level plz!");
            }
            // set allies
            int[] allies; CodeConvert.TryParse(lvl.allies, out allies, null, tokenizer);
            team.Clear();
            team.AddMember(firstPlayer);
            for (int i = 0; i < allies.Length; ++i)
            {
                int index = allies[i];
                if (index < 0)
                {
                    continue;
                }
                team.AddMember(npcCreator.npcs[index].gameObject);
            }
            // clear existing idols
            idolCreator.Clear();
            // reset inventory to match start state
            inventory.RemoveAllItems();
            int[][] invToLoad;
            CodeConvert.TryParse(lvl.idolInventory, out invToLoad, null, tokenizer);
            //Debug.Log(Show.Stringify(invToLoad,false));
            Vector3 playerLoc = Global.GetComponent <CharacterControlManager>().localPlayerInterfaceObject.transform.position;
            for (int i = 0; i < invToLoad.Length; ++i)
            {
                int[] t = invToLoad[i];
                if (t == null || t.Length == 0)
                {
                    continue;
                }
                GameObject idol = idolCreator.CreateIdol(t[0], t[1], checkGoal);
                idol.transform.position = playerLoc + Vector3.forward;
                inventory.AddItem(idol);
            }
            // set stage
            maze.stage = lvl.stage;
            // set seed
            random.Seed = lvl.seed;
            // set variables
            HashTable_stringobject d = mainDictionaryKeeper.Dictionary;
            CodeConvert.TryParse(lvl.variables, out d, null, tokenizer);
            // set
        }
        MarkTouchdown.ClearMarkers();
        clickToMove.ClearAllWaypoints();
        seedLabel.text = "level " + maze.stage + "." + Convert.ToBase64String(BitConverter.GetBytes(random.Seed));
        maze.Generate(random);
        Discovery.ResetAll();
        idolCreator.Generate(checkGoal);
        int len = Mathf.Min(maze.floorTileNeighborHistogram[2], idolCreator.idolMaterials.Count);

        npcCreator.GenerateMore(len);
        if (testingPickups)
        {
            idolCreator.GenerateMoreIdols(checkGoal);
        }
        // TODO maze should have a list of unfilled tiles sorted by weight
        for (int i = 0; i < npcCreator.npcs.Count; ++i)
        {
            maze.PlaceObjectOverTile(npcCreator.npcs[i].transform, maze.floorTiles[maze.floorTileNeighborHistogram[1] + i]);
        }
        team.AddMember(firstPlayer);
        maze.PlaceObjectOverTile(team.members[0].transform, maze.floorTiles[maze.floorTiles.Count - 1]);
        Vector3 pos = team.members[0].transform.position;

        for (int i = 0; i < team.members.Count; ++i)
        {
            team.members[i].transform.position = pos;
            CharacterMove cm = team.members[i].GetComponent <CharacterMove>();
            if (cm != null)
            {
                cm.SetAutoMovePosition(pos);
                cm.MoveForwardMovement = 0;
                cm.StrafeRightMovement = 0;
            }
        }
        UiText.SetColor(timer.gameObject, Color.white);
        timer.Start();
        GoalCheck(null);
        nextLevelButton.SetActive(false);
        bestTimeLabel.gameObject.SetActive(false);
    }
Exemplo n.º 25
0
        public void RefreshData()
        {
            // get the data
            List <object> objects = new List <object>();

            dataPopulator.Invoke(objects);
            for (int i = objects.Count - 1; i >= 0; --i)
            {
                if (objects[i] == null)
                {
                    Show.Warning("{" + EventBind.DebugPrint(dataPopulator) + "}[" + i + "] is null. removing it");
                    objects.RemoveAt(i);
                }
            }
            // take stock of what objects are here
            HashSet <object> manifest = new HashSet <object>();

            for (int i = 0; i < data.rows.Count; ++i)
            {
                object o = data.rows[i].obj;
                if (o != null)
                {
                    if (manifest.Contains(o))
                    {
                        throw new Exception("old data contains duplicate " + o + " at index " + i);
                    }
                    manifest.Add(o);
                }
            }
            // now check which ones are not in the new list, and which ones are missing in the new list
            Dictionary <object, int> toAdd = new Dictionary <object, int>();

            for (int i = 0; i < objects.Count; ++i)
            {
                object o = objects[i];
                if (!manifest.Contains(o))
                {
                    if (toAdd.TryGetValue(o, out int index))
                    {
                        throw new Exception("new data contains duplicate " + o + " at index " +
                                            index + " and index " + i);
                    }
                    toAdd[o] = i;
                }
                else
                {
                    manifest.Remove(o);
                }
            }
            // remove the old values that are not in the new set
            for (int i = data.rows.Count - 1; i >= 0; --i)
            {
                if (manifest.Contains(data.rows[i].obj))
                {
                    data.rows.RemoveAt(i);
                }
            }
            // add the new values that should be in the new set, in the order they appeared from the new data
            List <KeyValuePair <object, int> > values = toAdd.GetPairs();

            values.Sort((a, b) => a.Value.CompareTo(b.Value));
            for (int i = 0; i < values.Count; ++i)
            {
                int index = values[i].Value;
                if (index < data.rows.Count)
                {
                    data.InsertRow(index, values[i].Key);
                }
                else
                {
                    data.AddRow(values[i].Key);
                }
            }
            FullRefresh();
            //data.Clear();
            //Load(objects);
        }
Exemplo n.º 26
0
 /// <summary>
 /// describes functions to execute when a specific key-combination is pressed/held/released
 /// </summary>
 public KBind(KCombo kCombo, string name  = null, Func <bool> onPressEvent          = null, Func <bool> onHoldEvent = null,
              Func <bool> onReleaseEvent  = null, Func <bool> additionalRequirement = null,
              bool eventAlwaysTriggerable = false, EventBind pressFunc              = null, EventBind holdFunc = null, EventBind releaseFunc = null)
     : this(new[] { kCombo }, name, onPressEvent, onHoldEvent, onReleaseEvent, additionalRequirement, eventAlwaysTriggerable, pressFunc, holdFunc, releaseFunc)
 {
 }
Exemplo n.º 27
0
    public ListItemUi AddMember(GameObject memberObject)
    {
        //Show.Log("adding member " + memberObject);
        if (members == null)
        {
            members = new List <GameObject>();
        }
        // make sure this character adds to the communal inventory! (assuming there is one)
        TeamMember teamMember = memberObject.GetComponent <TeamMember>();

        if (teamMember == null)
        {
            teamMember = memberObject.AddComponent <TeamMember>();
        }
        // add them to the roster
        if (members.IndexOf(memberObject) < 0)
        {
            members.Add(memberObject);
            teamMember.onJoinTeam?.Invoke(this);
            CharacterRoot cr = memberObject.GetComponent <CharacterRoot>();
            if (cr)
            {
                EventBind.IfNotAlready(cr.activateFunction, this, ActivateTeamMember);
            }
        }
        if (members.Count > 1)
        {
            if (prev)
            {
                prev.gameObject.SetActive(true);
            }
            if (next)
            {
                next.gameObject.SetActive(true);
            }
            if (team)
            {
                team.gameObject.SetActive(true);
            }
        }
        if (rosterUi != null)
        {
            ListItemUi result = rosterUi.GetListItemUi(memberObject);
            if (result != null)
            {
                //Show.Log("already ui");
                return(result);
            }
        }
        string name = teamMember != null ? teamMember.name : null;

        if (string.IsNullOrEmpty(name))
        {
            name = memberObject.name;
        }

        Interact3dItem i3i = teamMember.GetComponent <Interact3dItem>();
        //void ActivateTeamMember() {
        //	CharacterControlManager ccm = Global.Get<CharacterControlManager>();
        //	ccm.SetCharacter(memberObject);
        //	i3i.showing = false;
        //}
        Action activateMember = () => ActivateTeamMember(memberObject);

        if (i3i != null)
        {
            i3i.OnInteract             = activateMember;
            i3i.Text                   = "switch";
            i3i.internalState.alwaysOn = true;
        }
        if (rosterUi == null)
        {
            Show.Log("missing roster UI");
            return(null);
        }
        return(rosterUi.AddItem(memberObject, name, activateMember));
    }
Exemplo n.º 28
0
 public void Reset()
 {
     TMPro.TMP_InputField input = GetComponent <TMPro.TMP_InputField>();
     EventBind.IfNotAlready(input.onValueChanged, this, nameof(AssignFromText));
     //EventBind.IfNotAlready(input.onEndEdit, this, nameof(Sort));
 }
Exemplo n.º 29
0
        public void SetColumnHeader(ColumnHeader columnHeader, UnityDataSheet uds, int column)
        {
            // unregister listeners before values change, since values are about to change.
            ClearInputTextBoxListeners();

            this.uds    = uds;
            this.column = column;
            cHeader     = columnHeader;
            TokenErrorLog errLog = new TokenErrorLog();
            // setup script value
            Token t = cHeader.columnSetting.fieldToken;
            //string textA = t.GetAsSmallText();
            //string textB = t.Stringify();
            //string textC = t.StringifySmall();
            //string textD = t.ToString();
            string text = t.GetAsBasicToken();

            //Show.Log("A: "+textA+"\nB:" + textB + "\nC:" + textC + "\nD:" + textD + "\nE:" + text);
            scriptValue.text = text;
            EventBind.On(scriptValue.onValueChanged, this, OnScriptValueEdit);
            // implicitly setup value types dropdown
            OnScriptValueEdit(text);
            // setup column label
            object labelText = cHeader.columnSetting.data.label.Resolve(errLog, uds.data);

            if (errLog.HasError())
            {
                popup.Set("err", defaultValue.gameObject, errLog.GetErrorString() + Proc.Now); return;
            }
            columnLabel.text = labelText.StringifySmall();
            EventBind.On(columnLabel.onValueChanged, this, OnLabelEdit);
            // setup column width
            columnWidth.text = cHeader.columnSetting.data.widthOfColumn.ToString();
            EventBind.On(columnWidth.onValueChanged, this, OnColumnWidthEdit);
            // setup column index
            columnIndex.text = column.ToString();
            EventBind.On(columnIndex.onValueChanged, this, OnIndexEdit);
            // setup column type
            List <ModalConfirmation.Entry> entries = columnTypes.ConvertAll(c => {
                string dropdownLabel;
                if (c.uiField != null && !string.IsNullOrEmpty(c.name))
                {
                    dropdownLabel = "/*" + c.name + "*/ " + c.uiField.name;
                }
                else
                {
                    dropdownLabel = c.name;
                }
                return(new ModalConfirmation.Entry(dropdownLabel, null));
            });

            t = cHeader.columnSetting.data.columnUi;
            string fieldTypeText = t.ToString();            //cHeader.columnSetting.data.columnUi.GetAsBasicToken();//ResolveString(errLog, null);
            int    currentIndex  = columnTypes.FindIndex(c => fieldTypeText.StartsWith(c.uiField.name)) + 1;

            //Show.Log(currentIndex+" field  " + fieldTypeText);
            DropDownEvent.PopulateDropdown(fieldType, entries, this, SetFieldType, currentIndex, true);
            if (currentIndex == 0)
            {
                DropDownEvent.SetCustomValue(fieldType.gameObject, fieldTypeText);
            }
            TMP_InputField elementUiInputField = fieldType.GetComponentInChildren <TMP_InputField>();

            if (elementUiInputField != null)
            {
                elementUiInputField.onValueChanged.RemoveAllListeners();
                //Show.Log("bind to "+elementUiInputField.name);
                EventBind.On(elementUiInputField.onValueChanged, this, OnSetFieldTypeText);
            }
            // setup default value
            object defVal = cHeader.columnSetting.defaultValue;

            if (defVal != null)
            {
                defaultValue.text = defVal.ToString();
            }
            else
            {
                defaultValue.text = "";
            }
            EventBind.On(defaultValue.onValueChanged, this, OnSetDefaultValue);
            // setup column destroy option
            EventBind.On(trashColumn.onClick, this, ColumnRemove);
            popup.Hide();
        }