protected override void OnOpen(object userData) { base.OnOpen(userData); m_InputField.onValidateInput = OnValidateInput; m_InputField.text = "1"; m_Type = (InputCountType)(int)GameEntry.DataNode.GetData <VarInt>(Constant.NodeKey.InputCountType); GameEntry.DataNode.RemoveNode(Constant.NodeKey.InputCountType); switch (m_Type) { case InputCountType.Sell: case InputCountType.Discard: m_KnapsackModel = (KnapsackModel)userData; break; case InputCountType.Buy: m_ShopModel = (ShopModel)userData; break; } }