public RandomNode(RandomNodeModel model, Store store, GraphView graphView) : base(model, store, graphView)
        {
            styleSheets.Add(AssetDatabase.LoadAssetAtPath <StyleSheet>(UICreationHelper.TemplatePath + "Random.uss"));
            AddToClassList(k_UssClassName);

            void OnTitleChange(ChangeEvent <string> e)
            {
                Model.MethodBaseName = e.newValue;
                Model.DefineNode();
                store.Dispatch(new RefreshUIAction(UpdateFlags.RequestCompilation | UpdateFlags.GraphTopology));
            }

            void OnParamChange(ChangeEvent <Enum> e)
            {
                Model.Variant = (RandomNodeModel.ParamVariant)e.newValue;
                Model.DefineNode();
                store.Dispatch(new RefreshUIAction(UpdateFlags.RequestCompilation | UpdateFlags.GraphTopology));
            }

            RegisterCallback <AttachToPanelEvent>(evt =>
            {
                // Title : Random [Float v ] [(min, max) v ]
                if (m_TitleField == null)
                {
                    title = "Random";

                    m_TitleField = new PopupField <string>(RandomNodeModel.BaseMethodNames.ToList(), Model.MethodBaseName);
                    m_TitleField.RegisterValueChangedCallback(OnTitleChange);

                    TitleContainer?.Add(m_TitleField);

                    m_ParamField = new EnumField(Model.Variant);
                    m_ParamField.RegisterValueChangedCallback(OnParamChange);
                    TitleContainer?.Add(m_ParamField);

                    m_ParamField?.SetEnabled(RandomNodeModel.RngMethods.Count(m => m.Name == Model.RngMethod.Name) > 1);
                }
            });

            RegisterCallback <DetachFromPanelEvent>(evt =>
            {
                m_TitleField.UnregisterValueChangedCallback(OnTitleChange);
                m_ParamField.UnregisterValueChangedCallback(OnParamChange);
            });
        }
        public OnKeyPressStackNode(Store store, OnKeyPressEcsNodeModel model, INodeBuilder builder)
            : base(store, model, builder)
        {
            void OnKeyCodeChange(ChangeEvent <Enum> e)
            {
                model.Code = (KeyCode)e.newValue;
                store.Dispatch(new RefreshUIAction(UpdateFlags.RequestCompilation));
            }

            void OnKeyPressTypeChange(ChangeEvent <Enum> e)
            {
                model.PressType = (OnKeyPressEcsNodeModel.KeyPressType)e.newValue;
                store.Dispatch(new RefreshUIAction(UpdateFlags.RequestCompilation));
            }

            RegisterCallback <AttachToPanelEvent>(evt =>
            {
                if (m_KeyCodeEnumField == null)
                {
                    title = "On";

                    m_KeyCodeEnumField = new EnumField(model.Code);
                    m_KeyCodeEnumField.RegisterValueChangedCallback(OnKeyCodeChange);
                    TitleElement.Add(m_KeyCodeEnumField);

                    m_PressTypeEnumField = new EnumField(model.PressType);
                    m_PressTypeEnumField.RegisterValueChangedCallback(OnKeyPressTypeChange);

                    TitleElement.Add(m_PressTypeEnumField);
                }
            });

            RegisterCallback <DetachFromPanelEvent>(evt =>
            {
                m_KeyCodeEnumField.UnregisterValueChangedCallback(OnKeyCodeChange);
                m_PressTypeEnumField.UnregisterValueChangedCallback(OnKeyPressTypeChange);
            });
        }