예제 #1
0
    //---------------------------------------------Button -------------------------------------------
    void OnMakeChangesClick()
    {
        if (ControlPlayer.Instance.m_ModelsDetail == null)
        {
            FrameUtil.PopNoticePanel("Please select a model !");
            return;
        }

        WWWForm form = new WWWForm();

        form.AddField("id", ControlPlayer.Instance.m_ModelsDetail.models[0].id);
        form.AddField("token", PlayerPrefs.GetString("token"));

        HttpManager.Instance.SendPostForm(ProjectConst.GetModelPartDetail, form);

        m_ButtonText = "MakeChanges";
        Destroy(gameObject);
    }
 void OnConfirmClick()
 {
     //name字段不能为空;
     if (m_NameInputField.text == "")
     {
         FrameUtil.PopNoticePanel("Name Cannot Be Empty !");
         return;
     }
     //查看Name是否重复;
     if (ControlPlayer.Instance.m_NameList.Contains(m_NameInputField.text))
     {
         FrameUtil.PopNoticePanel("Name Already Exists !");
         return;
     }
     //添加新的名字进List;
     ControlPlayer.Instance.m_NameList.Add(m_NameInputField.text);
     //重新刷新AddItemGroupSecondPanel面板NameList列表;
     GameObject.Find("AddItemGroupSecondPanel(Clone)").GetComponent <AddItemGroupSecondPanel>().UpdateNameDropdownView();
     Destroy(gameObject);
 }
예제 #3
0
    void OnConfirmButtonClick()
    {
        //检查尺寸字符
        if (m_SizeInputField.text == "")
        {
            FrameUtil.PopNoticePanel("Size  Cannot Be Empty !");
            return;
        }

        //现有的尺寸通过getSize.php获得,
        WWWForm form = new WWWForm();

        form.AddField("token", PlayerPrefs.GetString("token"));
        form.AddField("size", m_SizeInputField.text);
        form.AddField("type", m_TypeDropDown.captionText.text);
        form.AddField("doorPosition", m_DoorPositionDropDown.captionText.text);
        form.AddField("note", m_NoteInputField.text);

        HttpManager.Instance.SendPostForm(ProjectConst.AddSize, form);

        Destroy(gameObject);
    }
예제 #4
0
    void OnAddClick()
    {
        //加载AddItem面板;
        foreach (var v in ControlPlayer.Instance.m_CommonItemList)
        {
            if (v.item.id == m_Item.id)
            {
                FrameUtil.PopNoticePanel("This Item Add To Common Item List Already !");
                return;
            }
        }

        foreach (var v in ControlPlayer.Instance.m_SpItemList)
        {
            if (v.item.id == m_Item.id)
            {
                FrameUtil.PopNoticePanel("This Item Add To Common Item List Already !");
                return;
            }
        }

        if (ControlPlayer.Instance.m_CurrentPanelName == "SpecialPartsSelectionPanel")
        {
            GameObject temp = FrameUtil.AddChild(GameObject.Find("Canvas/Other"), Resources.Load <GameObject>("AddItemSecondPanel"));
            //删除原有脚本;
            Destroy(temp.GetComponent <AddItemSecondPanel>());
            //加入新脚本;
            temp.AddComponent <AddSpecialItemSecondPanel>().Init(m_Item);
            return;
        }
        //这里如果是最后一个面板 要加入 最后一个面板特殊的 AddPanel;
        else if (ControlPlayer.Instance.m_CurrentPanelName == "LastPartsSelectionPanel")
        {
            FrameUtil.AddChild(GameObject.Find("Canvas/Other"), Resources.Load <GameObject>("AddItemGroupSecondPanel")).GetComponent <AddItemGroupSecondPanel>().Init(m_Item);
            return;
        }

        FrameUtil.AddChild(GameObject.Find("Canvas/Other"), Resources.Load <GameObject>("AddItemSecondPanel")).GetComponent <AddItemSecondPanel>().Init(m_Item);
    }
예제 #5
0
    //处理 next 按钮后的事情;
    void OnNextButtonClick()
    {
        //清空之前的选择数据;
        ControlPlayer.Instance.m_AddModelPanelSaveData.m_Size.Clear();
        //存储信息;
        //判断InputField是否为空;
        if (m_BandInputField.text == "")
        {
            FrameUtil.PopNoticePanel("Band Cannot Be Empty !");
            return;
        }

        if (m_ModeInputField.text == "")
        {
            FrameUtil.PopNoticePanel("Model Cannot Be Empty !");
            return;
        }

        if (m_ModelYearInputField.text == "")
        {
            FrameUtil.PopNoticePanel("Model Year Cannot Be Empty !");
            return;
        }

        if (m_ModelCodeInputField.text == "")
        {
            FrameUtil.PopNoticePanel("Model Code Cannot Be Empty !");
            return;
        }

        //保存填写的数据到ControlPlayer
        ControlPlayer.Instance.m_AddModelPanelSaveData.m_Brand       = m_BandInputField.text;
        ControlPlayer.Instance.m_AddModelPanelSaveData.m_Model       = m_ModeInputField.text;
        ControlPlayer.Instance.m_AddModelPanelSaveData.m_ModelYear   = m_ModelYearInputField.text;
        ControlPlayer.Instance.m_AddModelPanelSaveData.m_ModelCode   = m_ModelCodeInputField.text;
        ControlPlayer.Instance.m_AddModelPanelSaveData.m_ChassisType = m_ChassisDropdown.captionText.text;

        ControlPlayer.Instance.m_ModelName = ControlPlayer.Instance.m_AddModelPanelSaveData.m_ModelCode + "MY" + ControlPlayer.Instance.m_AddModelPanelSaveData.m_ModelYear + "V" + ControlPlayer.Instance.m_Version;

        List <MsgJson.Size> m_SizeList = new List <MsgJson.Size>();

        bool isHaveData = false;

        //保存size;
        foreach (Transform v in m_ModelsList)
        {
            if (v.GetComponent <SizeItemLogic>().m_SelectedToggle.isOn == true)
            {
                isHaveData = true;
                m_SizeList.Add(v.GetComponent <SizeItemLogic>().m_Size);
            }
        }

        if (isHaveData == false)
        {
            FrameUtil.PopNoticePanel("Must Select At Least One Size");
            return;
        }

        ControlPlayer.Instance.m_AddModelPanelSaveData.m_Size = m_SizeList;

        //发送获取供货商消息
        WWWForm form = new WWWForm();

        form.AddField("token", PlayerPrefs.GetString("token"));
        HttpManager.Instance.SendPostForm(ProjectConst.GetSupplier, form);
    }