コード例 #1
0
        private void OnItemClick(object sender, ItemArgs e)
        {
            ProBuilderCmd cmd = (ProBuilderCmd)e.Items[0];

            if (cmd.Validate())
            {
                cmd.Run();
            }
        }
コード例 #2
0
        private void OnItemDataBinding(object sender, VirtualizingTreeViewItemDataBindingArgs e)
        {
            TextMeshProUGUI text = e.ItemPresenter.GetComponentInChildren <TextMeshProUGUI>();
            ProBuilderCmd   cmd  = (ProBuilderCmd)e.Item;

            text.text = cmd.Text;

            bool  isValid = cmd.Validate();
            Color color   = text.color;

            color.a    = isValid ? 1 : 0.5f;
            text.color = color;

            e.CanDrag     = cmd.CanDrag;
            e.HasChildren = cmd.HasChildren;
        }