Beispiel #1
0
    //-------------------------------------------------------------- MESSAGE HANDLE ---------------------------------
    void OnLogin(string data)
    {
        MsgJson.Login jsonData = JsonUtility.FromJson <MsgJson.Login>(data);

        //登录成功;
        if (jsonData.state == "success")
        {
            //保留token;
            PlayerPrefs.SetString("token", jsonData.token);
            //保留ControlPlayer信息;
            ControlPlayer.Instance.m_GroupName = jsonData.user[0].GroupName;
            ControlPlayer.Instance.m_FirstName = jsonData.user[0].firstname;
            ControlPlayer.Instance.m_LastName  = jsonData.user[0].lastname;
            ControlPlayer.Instance.m_Email     = jsonData.user[0].email;
            ControlPlayer.Instance.m_Phone     = jsonData.user[0].phone;

            //加载主面板;
            FrameUtil.AddChild(GameObject.Find("Canvas/Stack"), Resources.Load <GameObject>("MainPanel"));
            //加入TitlePanel;
            FrameUtil.AddChild(GameObject.Find("Canvas/Other"), Resources.Load <GameObject>("TitlePanel"));
            //销毁Login面板;
            Destroy(gameObject);
        }
        //登录失败;
        else if (jsonData.state == "fail")
        {
            //弹出提示面板;
            Debug.Log("------------------------------------------- 登录失败 !!!-------------------------------------------------");
            GameObject go = FrameUtil.AddChild(GameObject.Find("Canvas/Other"), Resources.Load <GameObject>("NoticePanel"));
            go.GetComponent <NoticePanelLogic>().Init("Login Fail");
        }
    }
Beispiel #2
0
    //-------------------------------------------------------------- MESSAGE HANDLE ---------------------------------
    void OnCheckUserFunction(string data)
    {
        MsgJson.UserFunction jsonData = JsonUtility.FromJson <MsgJson.UserFunction>(data);

        if (jsonData.state == "success")
        {
            foreach (var v in jsonData.function)
            {
                switch (v.id)
                {
                case "1":
                    FrameUtil.AddChild(m_MainMenuList.gameObject, m_MainMenuItem).GetComponent <MainMenuItemLogic>().Init("User Access", OnUesrAccessClick);
                    break;

                case "2":
                    FrameUtil.AddChild(m_MainMenuList.gameObject, m_MainMenuItem).GetComponent <MainMenuItemLogic>().Init("Sales", OnSalesClick);
                    break;

                case "4":
                    FrameUtil.AddChild(m_MainMenuList.gameObject, m_MainMenuItem).GetComponent <MainMenuItemLogic>().Init("Model Management", OnModelManagementClick);
                    break;

                default:
                    Debug.Log(v.name);
                    Debug.Log("-------------------------------- OnCheckUserFunction Switch Error ! ---------------------------------------------------");
                    break;
                }
            }
        }
        else
        {
            GameObject go = FrameUtil.AddChild(GameObject.Find("Canvas/Other"), Resources.Load <GameObject>("NoticePanel"));
            go.GetComponent <NoticePanelLogic>().Init(jsonData.state);
        }
    }
Beispiel #3
0
 void OnBackButtonClick()
 {
     //加载UsersAndGroupsInfoPanel;
     FrameUtil.AddChild(GameObject.Find("Canvas/Stack"), Resources.Load <GameObject>("UsersAndGroupsInfoPanel"));
     //销毁本面板;
     Destroy(gameObject);
 }
Beispiel #4
0
    //参数为 url ,data 数据, 消息ID的string形式;
    private IEnumerator SendPostFormCoroutine(string url, WWWForm form)
    {
        WWW www_instance = new WWW(url, form);

        //开始转菊花图;
        FrameUtil.AddChild(GameObject.Find("Canvas/Other"), Resources.Load <GameObject>("WaitingPanel"));

        yield return(www_instance);

        if (www_instance.error != null)
        {
            //这里应该是做超时处理,要通知主逻辑弹出通知面板;
            Object.DestroyImmediate(GameObject.Find("WaitingPanel(Clone)"));
            //后面来做;
            Debug.LogError("------------------------ Send WWW Post Error : " + www_instance.error + "------------------------");
            GameObject go = FrameUtil.AddChild(GameObject.Find("Canvas/Other"), Resources.Load <GameObject>("NoticePanel"));
            go.GetComponent <NoticePanelLogic>().Init("Send WWW Post Error: " + www_instance.error);
        }
        else
        {
            Object.DestroyImmediate(GameObject.Find("WaitingPanel(Clone)"));

            Debug.Log("----------------------------------------- 收到消息号 : " + www_instance.responseHeaders["code"] + "----------------------------------------");
            Debug.Log(www_instance.text);

            MsgRegister.Instance.Handle(www_instance.responseHeaders["code"], www_instance.text);
        }
    }
Beispiel #5
0
    void OnDeleteButtonClick()
    {
        //加载UsersAndGroupsInfoPanel;
        GameObject go = FrameUtil.AddChild(GameObject.Find("Canvas/Other"), Resources.Load <GameObject>("ConfirmPanel"));

        go.GetComponent <ConfirmPanelLogic>().Init(OnDeleteUserCallBack);
    }
Beispiel #6
0
    // Use this for initialization
    void Start()
    {
        //加入第一界面选择的Size;
        foreach (var v in ControlPlayer.Instance.m_AddModelPanelSaveData.m_Size)
        {
            FrameUtil.AddChild(m_LeftSizeList.gameObject, m_LeftSizeItem).GetComponent <LeftSizeItemLogic>().Init(v);
        }
        //默认点选第一个;
        m_LeftSizeList.transform.GetChild(0).GetComponent <LeftSizeItemLogic>().OnClick();

        //重新加入上个界面选择的普通部件;
        //AddPartItem();

        //加入供货商;
        foreach (var v in ControlPlayer.Instance.m_GetSupplier.supplier)
        {
            FrameUtil.AddChild(m_SupplierList.gameObject, Resources.Load <GameObject>("SupplierItem")).GetComponent <SupplierItemLogic>().Init(v);
        }

        ////获得ItemCategory信息
        //WWWForm form = new WWWForm();
        //form.AddField("token", PlayerPrefs.GetString("token"));
        //HttpManager.Instance.SendPostForm(ProjectConst.GetItemCategory, form);
        ////获得Stages信息;
        //WWWForm form1 = new WWWForm();
        //form1.AddField("token", PlayerPrefs.GetString("token"));
        //HttpManager.Instance.SendPostForm(ProjectConst.GetItemStages, form1);
        AddPartItem();
    }
Beispiel #7
0
    void Start()
    {
        //加入所有用户;
        foreach (var v in ControlPlayer.Instance.m_UserAccessData.users)
        {
            FrameUtil.AddChild(m_UserItemList.gameObject, m_UserAccessUserItem).GetComponent <UserAccessUserItemLogic>().Init(v.id);
        }

        //加入新添用户按钮;
        FrameUtil.AddChild(m_UserItemList.gameObject, m_UserAccessUserItem).GetComponent <UserAccessUserItemLogic>().Init("Add New User", AddNewUser);

        //将第一个用户的信息显示在用户信息里面;
        m_FirstName.text = ControlPlayer.Instance.m_UserAccessData.users[0].firstname;
        m_LastName.text  = ControlPlayer.Instance.m_UserAccessData.users[0].lastname;
        m_Email.text     = ControlPlayer.Instance.m_UserAccessData.users[0].email;
        m_Phone.text     = ControlPlayer.Instance.m_UserAccessData.users[0].phone;

        //第一个用户的ID;
        ControlPlayer.Instance.m_CurrentEditUserID = ControlPlayer.Instance.m_UserAccessData.users[0].id;

        //加入现在所有的组,并检查第一个用户有没有这些组功能;
        foreach (var i in ControlPlayer.Instance.m_UserAccessData.groups)
        {
            GameObject go = FrameUtil.AddChild(m_Group.gameObject, m_GroupToggle);
            go.GetComponent <GroupToggleItemLogic>().Init(i);

            m_UserAccessToggleDic[i.id] = go;
        }
        RefreshGroupDisplay(ControlPlayer.Instance.m_UserAccessData.users[0].id);
    }
 void OnBackButtonClick()
 {
     //加载UsersAndGroupsInfoPanel;
     FrameUtil.AddChild(GameObject.Find("Canvas/Stack"), Resources.Load <GameObject>("MainPanel"));
     GameObject.Find("TitlePanel(Clone)").GetComponent <TitlePanelLogic>().ChangeModuleName("");
     //销毁Login面板;
     Destroy(gameObject);
 }
Beispiel #9
0
    //处理得到供货商消息;
    void OnGetSupplier(string data)
    {
        ControlPlayer.Instance.m_GetSupplier = JsonUtility.FromJson <MsgJson.GetSupplier>(data);

        //Common Parts Selection Panel;
        FrameUtil.AddChild(GameObject.Find("Canvas/Stack"), Resources.Load <GameObject>("CommonPartsSelectionPanel"));

        Destroy(gameObject);
    }
    // Use this for initialization
    void Start()
    {
        UpdateTypeDropdownView();

        foreach (var v in ControlPlayer.Instance.m_ItemStages.stages)
        {
            FrameUtil.AddChild(m_StagesGrounp.gameObject, m_StageToggle).GetComponent <ItemStageLogic>().Init(v);
        }
    }
Beispiel #11
0
    //添加左边的Item;
    public void AddPartItem()
    {
        //清空所有的stage和item
        foreach (Transform child in m_PartList)
        {
            Destroy(child.gameObject);
        }

        //首先循环所有的stage;
        foreach (var v in ControlPlayer.Instance.m_ItemStages.stages)
        {
            bool check = false;
            //看看stageDisplayList里面有没有当前循环到的stage;
            foreach (var i in ControlPlayer.Instance.m_StageDisplayList)
            {
                if (i.stegeId == v.id)
                {
                    if (check == false)
                    {
                        FrameUtil.AddChild(m_PartList.gameObject, m_StageTatil).GetComponent <StageTitleLogic>().Init(v.des);
                        check = true;
                    }

                    foreach (var x in ControlPlayer.Instance.m_CommonItemList)
                    {
                        if (x.item.id == i.itemId)
                        {
                            FrameUtil.AddChild(m_PartList.gameObject, m_LeftSpecialItemItem).GetComponent <LeftSpecialItemItemLogic>().Init(x.item, x.qty);
                        }
                    }
                }
            }

            //添加特殊部件;
            foreach (var i in ControlPlayer.Instance.m_SpStageDisplayList)
            {
                if (i.stegeId == v.id && i.sizeId == ControlPlayer.Instance.m_CurrentChoiceSizeId)
                {
                    if (check == false)
                    {
                        FrameUtil.AddChild(m_PartList.gameObject, m_StageTatil).GetComponent <StageTitleLogic>().Init(v.des);
                        check = true;
                    }

                    foreach (var x in ControlPlayer.Instance.m_SpItemList)
                    {
                        if (x.item.id == i.itemId)
                        {
                            FrameUtil.AddChild(m_PartList.gameObject, m_LeftColorItemItem).GetComponent <LeftItemItemLogic>().Init(x.item, x.qty);
                        }
                    }
                }
            }
        }

        CalculateTotalAmount();
    }
Beispiel #12
0
    //------------------------------------------------------------- Button Response ------------------------------------

    //用户控制按钮;
    void OnUesrAccessClick(GameObject go, PointerEventData eventData)
    {
        //加载UsersAndGroupsInfoPanel;
        FrameUtil.AddChild(GameObject.Find("Canvas/Stack"), Resources.Load <GameObject>("UsersAndGroupsInfoPanel"));

        GameObject.Find("TitlePanel(Clone)").GetComponent <TitlePanelLogic>().ChangeModuleName("User Access");
        //销毁主面板;
        Destroy(gameObject);
    }
Beispiel #13
0
    //模块管理(Model Management);
    void OnModelManagementClick(GameObject go, PointerEventData eventData)
    {
        //TitlePanel改名;
        GameObject.Find("TitlePanel(Clone)").GetComponent <TitlePanelLogic>().ChangeModuleName("Model Management");
        //加载模块管理面板;
        FrameUtil.AddChild(GameObject.Find("Canvas/Stack"), Resources.Load <GameObject>("ModelManagementPanel"));

        //销毁主面板;
        Destroy(gameObject);

        //m_CurrentChoseFunctionID = 1;
    }
Beispiel #14
0
    //------------------------------------------------MESSAGE RESPONSE------------------------------------------
    //得到模块类别消息处理 1012;
    void OnGetRange(string data)
    {
        MsgJson.ModelRange jsonData = JsonUtility.FromJson <MsgJson.ModelRange>(data);

        //将收到的数据转存到ControlPlayer
        ControlPlayer.Instance.m_ModelsRange = jsonData;

        //加入所有的Models Item
        foreach (var v in ControlPlayer.Instance.m_ModelsRange.range)
        {
            FrameUtil.AddChild(m_ModelsList.gameObject, m_ModelItem).GetComponent <ModelItemLogic>().Init(v);
        }
    }
Beispiel #15
0
    // Use this for initialization
    void Start()
    {
        //跟新 CategoryDropdown 显示;
        UpdateCategoryDropdownView();
        //跟新 NameDropdown显示;
        UpdateNameDropdownView();
        //更新 StdDropdown显示;
        UpdateStdDropdownView();

        foreach (var v in ControlPlayer.Instance.m_ItemStages.stages)
        {
            FrameUtil.AddChild(m_StagesGrounp.gameObject, m_StageToggle).GetComponent <ItemStageLogic>().Init(v);
        }
    }
    void OnGetItem(string data)
    {
        foreach (Transform child in m_ItemList)
        {
            Destroy(child.gameObject);
        }

        MsgJson.Items items = JsonUtility.FromJson <MsgJson.Items>(data);

        foreach (var v in items.item)
        {
            FrameUtil.AddChild(m_ItemList.gameObject, m_ItemItem).GetComponent <ItemItemLogic>().Init(v);
        }
    }
Beispiel #17
0
 //处理添加尺寸消息;
 public void OnAddSize(string data)
 {
     MsgJson.AddSize addSize = JsonUtility.FromJson <MsgJson.AddSize>(data);
     if (addSize.state == "success")
     {
         FrameUtil.AddChild(m_ModelsList.gameObject, m_ModelItem).GetComponent <SizeItemLogic>().Init_2(
             addSize.size,
             addSize.type,
             addSize.doorPosition,
             addSize.note);
     }
     else
     {
         Debug.LogError("Add Size Error");
     }
 }
Beispiel #18
0
    //处理1013 获得车型消息;
    void OnGetCarModel(string data)
    {
        MsgJson.CarModels jsonData = JsonUtility.FromJson <MsgJson.CarModels>(data);
        //将收到的数据转存到ControlPlayer
        ControlPlayer.Instance.m_CarModels = jsonData;

        foreach (Transform child in m_ModelCodeList)
        {
            Destroy(child.gameObject);
        }

        //加入所有的Models Code Item
        foreach (var v in ControlPlayer.Instance.m_CarModels.models)
        {
            FrameUtil.AddChild(m_ModelCodeList.gameObject, m_ModelCodeItem).GetComponent <ModeCodeItemLogic>().Init(v);
        }
    }
    // Use this for initialization
    void Start()
    {
        foreach (var v in ControlPlayer.Instance.m_GetSupplier.supplier)
        {
            FrameUtil.AddChild(m_SupplierList.gameObject, Resources.Load <GameObject>("SupplierItem")).GetComponent <SupplierItemLogic>().Init(v);
        }

        //获得ItemCategory信息
        WWWForm form = new WWWForm();

        form.AddField("token", PlayerPrefs.GetString("token"));
        HttpManager.Instance.SendPostForm(ProjectConst.GetItemCategory, form);
        //获得Stages信息;
        WWWForm form1 = new WWWForm();

        form1.AddField("token", PlayerPrefs.GetString("token"));
        HttpManager.Instance.SendPostForm(ProjectConst.GetItemStages, form1);
    }
Beispiel #20
0
    // Use this for initialization
    void Start()
    {
        m_SaveButton = transform.FindChild("Save").GetComponent <Button>();
        m_SaveButton.onClick.AddListener(OnSaveButtonClick);

        m_BackButton = transform.FindChild("Back").GetComponent <Button>();
        m_BackButton.onClick.AddListener(OnBackButtonClick);

        m_DeleteButton = transform.FindChild("Delete").GetComponent <Button>();
        m_DeleteButton.onClick.AddListener(OnDeleteButtonClick);

        m_GroupNameInputField = transform.FindChild("GroupNameInputField").GetComponent <InputField>();

        m_FunctionArea = transform.FindChild("FunctionArea");

        //组列表
        m_GroupItemList = transform.FindChild("GroupList/Content");

        //加入所有的组Item;
        foreach (var v in ControlPlayer.Instance.m_UserAccessData.groups)
        {
            GameObject go = FrameUtil.AddChild(m_GroupItemList.gameObject, m_GroupItem);
            go.GetComponent <GroupsGroupItemLogic>().Init(v);
        }
        //加入 增加新组按钮;
        FrameUtil.AddChild(m_GroupItemList.gameObject, m_GroupItem).GetComponent <GroupsGroupItemLogic>().Init("Add New Group", OnAddGroupButtonClick);

        //加入所有功能Toggle
        foreach (var i in ControlPlayer.Instance.m_UserAccessData.function)
        {
            GameObject go = FrameUtil.AddChild(m_FunctionArea.gameObject, m_FunctionToggle);
            go.GetComponent <FunctionToggleLogic>().Init(i);

            m_FunctionToggleDic[i.id] = go;
        }

        //刷新,判断那些Toggle要打勾;
        RefreshDisplay(ControlPlayer.Instance.m_UserAccessData.groups[0].id, ControlPlayer.Instance.m_UserAccessData.groups[0].name);

        //当前操作的组ID;
        m_CurrentChoseGroupID = ControlPlayer.Instance.m_UserAccessData.groups[0].id;
    }
Beispiel #21
0
    //-------------------------------------------- Message Response ------------------------------------------------

    //加入新组;
    void OnAddNewGroups(string data)
    {
        //销毁加入新组面板;
        Destroy(GameObject.Find("AddNewGroupPanel(Clone)"));

        MsgJson.AddNewGroup tmp = JsonUtility.FromJson <MsgJson.AddNewGroup>(data);

        if (tmp.state == "success")
        {
            GameObject go = FrameUtil.AddChild(m_GroupItemList.gameObject, m_GroupItem, m_GroupItemList.childCount - 1);
            go.GetComponent <GroupsGroupItemLogic>().Init(tmp);
            //将新数据加入总管理;
            ControlPlayer.Instance.m_GroupFunctionDic[tmp.id] = new List <string>();
            RefreshDisplay(tmp.id, tmp.name);
        }
        else
        {
            Debug.LogError("--------------------------------- 添加新组失败 --------------------------------------");
        }
    }
Beispiel #22
0
    void OnAddNewUser(string data)
    {
        //销毁加入新组面板;
        Destroy(GameObject.Find("AddNewUserPanel(Clone)"));

        MsgJson.AddNewUser tmp = JsonUtility.FromJson <MsgJson.AddNewUser>(data);

        if (tmp.state == "success")
        {
            GameObject go = FrameUtil.AddChild(m_UserItemList.gameObject, m_UserAccessUserItem, m_UserItemList.childCount - 1);


            ControlPlayer.Instance.m_CurrentEditUserID = tmp.id;

            //将新数据加入总管理;
            ControlPlayer.UserInfo userInfo = new ControlPlayer.UserInfo();
            userInfo.userID    = tmp.id;
            userInfo.userName  = tmp.username;
            userInfo.firstName = tmp.firstname;
            userInfo.lastName  = tmp.lastname;
            userInfo.email     = tmp.email;
            userInfo.phone     = tmp.phone;

            ControlPlayer.Instance.m_UserInfoDic[tmp.id] = userInfo;

            //刷新该用户的组相关数据;
            RefreshGroupDisplay(userInfo.userID);

            //刷新显示;
            m_FirstName.text = userInfo.firstName;
            m_LastName.text  = userInfo.lastName;
            m_Email.text     = userInfo.email;
            m_Phone.text     = userInfo.phone;

            go.GetComponent <UserAccessUserItemLogic>().Init(tmp.id);
        }
        else
        {
            Debug.LogError("--------------------------------- 添加新组失败 --------------------------------------");
        }
    }
    void Start()
    {
        //加入第一界面选择的Size;
        foreach (var v in ControlPlayer.Instance.m_AddModelPanelSaveData.m_Size)
        {
            FrameUtil.AddChild(m_LeftSizeList.gameObject, m_LeftSizeItem).GetComponent <LeftSizeItemLogic>().Init(v);
        }
        //默认点选第一个;
        m_LeftSizeList.transform.GetChild(0).GetComponent <LeftSizeItemLogic>().OnClick();

        //重新加入上个界面选择的普通部件;
        //AddPartItem();

        //加入供货商;
        foreach (var v in ControlPlayer.Instance.m_GetSupplier.supplier)
        {
            FrameUtil.AddChild(m_SupplierList.gameObject, Resources.Load <GameObject>("SupplierItem")).GetComponent <SupplierItemLogic>().Init(v);
        }

        AddPartItem();
    }
Beispiel #24
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);
    }
    //------------------------------------------- Message Handle --------------------------------

    void OnUserAccess(string data)
    {
        //数据转存到ControlPlayer;
        ControlPlayer.Instance.m_UserAccessData = JsonUtility.FromJson <MsgJson.UserAccess>(data);
        //转存数据,将数据转换为客户端好使用的格式;
        ControlPlayer.Instance.DataFormatConversion(ControlPlayer.Instance.m_UserAccessData);

        if (m_CurrentChoseFunctionID == 1)
        {
            //加载UserAccessPanel;
            FrameUtil.AddChild(GameObject.Find("Canvas/Stack"), Resources.Load <GameObject>("UserAccessPanel"));
            //销毁Login面板;
            Destroy(gameObject);
        }
        else if (m_CurrentChoseFunctionID == 2)
        {
            //加载UserAccessPanel;
            FrameUtil.AddChild(GameObject.Find("Canvas/Stack"), Resources.Load <GameObject>("GroupsPanel"));
            //销毁Login面板;
            Destroy(gameObject);
        }
    }
Beispiel #26
0
    //处理1014车型详细信息消息;
    void OnGetModelDetail(string data)
    {
        MsgJson.ModelsDetail jsonData = JsonUtility.FromJson <MsgJson.ModelsDetail>(data);

        ControlPlayer.Instance.m_ModelsDetail = jsonData;

        foreach (var v in ControlPlayer.Instance.m_ModelsRange.range)
        {
            if (v.id == jsonData.models[0].range_id)
            {
                m_BrandText.text = v.brand;
                m_ModelText.text = v.description;
            }
        }

        m_ModelYearText.text = ControlPlayer.Instance.m_ModelsDetail.models[0].model_year;
        m_VersionText.text   = ControlPlayer.Instance.m_ModelsDetail.models[0].version;
        m_StatusText.text    = ControlPlayer.Instance.m_ModelsDetail.models[0].status;

        if (m_StatusText.text == "Active")
        {
            m_m_MakeItInactiveButtonText.text = "Make it InActive";
        }
        else
        {
            m_m_MakeItInactiveButtonText.text = "Make it Active";
        }

        //添加新Size之前删除老的;
        foreach (Transform child in m_SizeList)
        {
            Destroy(child.gameObject);
        }

        foreach (var v in ControlPlayer.Instance.m_ModelsDetail.size)
        {
            FrameUtil.AddChild(m_SizeList.gameObject, m_ModelDetailItem).GetComponent <ModelDetailItemLogic>().Init(v);
        }
    }
Beispiel #27
0
    //----------------------------------------------- MEG Handle --------------------------------------------------------------------
    //得到AddModel面板的1015 Size消息;
    void OnGetSize(string data)
    {
        MsgJson.AddModelSize addModelSize = JsonUtility.FromJson <MsgJson.AddModelSize>(data);
        ControlPlayer.Instance.m_AddModelSize = addModelSize;

        //加入所有的SizeItem
        foreach (var v in ControlPlayer.Instance.m_AddModelSize.size)
        {
            GameObject tempSize = FrameUtil.AddChild(m_ModelsList.gameObject, m_ModelItem);
            tempSize.GetComponent <SizeItemLogic>().Init(v);

            foreach (var i in ControlPlayer.Instance.m_AddModelPanelSaveData.m_Size)
            {
                if (v.id == i.id)
                {
                    tempSize.transform.FindChild("Selected/Toggle").GetComponent <Toggle>().isOn = true;
                }
            }
        }

        //刷新多选框元素;
        UpdateChassisDropdownView();
    }
    void OnAddModel(string data)
    {
        MsgJson.State state = JsonUtility.FromJson <MsgJson.State>(data);

        if (state.state == "success")
        {
            FrameUtil.AddChild(GameObject.Find("Canvas/Stack"), Resources.Load <GameObject>("ModelManagementPanel"));
            //清空数据;
            ControlPlayer.Instance.m_CommonItemList.Clear();
            ControlPlayer.Instance.m_StageDisplayList.Clear();

            ControlPlayer.Instance.m_SpItemList.Clear();
            ControlPlayer.Instance.m_SpStageDisplayList.Clear();

            ControlPlayer.Instance.m_OpItemList.Clear();
            ControlPlayer.Instance.m_OpStageDisplayList.Clear();

            ControlPlayer.Instance.m_AddModelPanelSaveData = null;
        }
        else
        {
        }
    }
Beispiel #29
0
    //---------------------------------------- Call Back -------------------------------------------------

    void AddNewUser()
    {
        //加载新加组面板;
        FrameUtil.AddChild(GameObject.Find("Canvas/Other"), Resources.Load <GameObject>("AddNewUserPanel"));
    }
Beispiel #30
0
 /// <summary>
 /// 在Other层弹出提示面板参数为提示面板要显示的字符串;
 /// </summary>
 /// <param name="str"></param>
 public static void PopNoticePanel(string str)
 {
     FrameUtil.AddChild(GameObject.Find("Canvas/Other"), Resources.Load <GameObject>("NoticePanel")).GetComponent <NoticePanelLogic>().Init(str);
 }