Example #1
0
 void Awake()
 {
     _scrollView      = gameObject.GetComponent <ScrollRect>();
     _contentRect     = _scrollView.content;
     _gridLayoutGroup = gameObject.GetComponentInChildren <GridLayoutGroup>();
     _dataGrid        = gameObject.GetComponentInChildren <UIDataGrid>();
 }
    void Awake()
    {
        cachedTransform = transform;
        //开始UI获取;
        image_Equipcr       = cachedTransform.Find("image_Equipcr").GetComponent <Image>();
        Image_skill1cr      = cachedTransform.Find("image_Equipcr/Image_skill1cr").GetComponent <Image>();
        Scr_EquipStarcr     = cachedTransform.Find("image_Equipcr/Scr_EquipStarcr").GetComponent <ScrollRect>();
        glayout_EquipStarcr = cachedTransform.Find("image_Equipcr/Scr_EquipStarcr/glayout_EquipStarcr").GetComponent <GridLayoutGroup>();
        //结束UI获取;
        isUIinit = true;

        UIEventListener.Get(Image_skill1cr.gameObject).onPress = OnClickJO;

        _grid = glayout_EquipStarcr.gameObject.AddComponent <UIDataGrid>();
        _grid.InitDataGrid("prefab/UI/Equip/ItemeEquipStarcr", "ItemeEquipStarcr", glayout_EquipStarcr.gameObject, Scr_EquipStarcr, Direction.none);
    }
Example #3
0
    private void OnSynthesisClick(GameObject go)
    {
        go_EquipSynthesiscr.gameObject.SetActive(true);

        if (canCombineGrid == null)
        {
            canCombineGrid = glayout_CanSynthesisEquipcr.gameObject.AddComponent <UIDataGrid>();
            canCombineGrid.InitDataGrid("Prefab/UI/EquipsOutside/ItemeEquipOutSide3cr", "ItemeEquipOutSide3cr", glayout_CanSynthesisEquipcr.gameObject, Scr_CanSynthesisEquipcr);
            canCombineGrid.ArrowImage1 = btn_leftcr.gameObject;
            canCombineGrid.ArrowImage2 = btn_rightcr.gameObject;
        }

        if (lastClickItem != null)
        {
            ConfigEquip equip = lastClickItem.GetData();
            ChooseItem(equip);
        }
    }
Example #4
0
    void Awake()
    {
        cachedTransform = transform;
        //开始UI获取;
        image_Equipcr           = cachedTransform.Find("image_Equipcr").GetComponent <Image>();
        Image_skill1cr          = cachedTransform.Find("image_Equipcr/Image_skill1cr").GetComponent <Image>();
        Scr_EquipStarcr         = cachedTransform.Find("image_Equipcr/Scr_EquipStarcr").GetComponent <ScrollRect>();
        glayout_EquipStarcr     = cachedTransform.Find("image_Equipcr/Scr_EquipStarcr/glayout_EquipStarcr").GetComponent <GridLayoutGroup>();
        image_Selectedcr        = cachedTransform.Find("image_Equipcr/image_Selectedcr").GetComponent <Image>();
        image_EquipLineLinecr   = cachedTransform.Find("image_EquipLineLinecr").GetComponent <Image>();
        image_EquipLineTopcr    = cachedTransform.Find("image_EquipLineTopcr").GetComponent <Image>();
        image_EquipLineBottomcr = cachedTransform.Find("image_EquipLineBottomcr").GetComponent <Image>();
        //结束UI获取;
        isUIinit = true;

        star = glayout_EquipStarcr.gameObject.AddMissingComponent <UIDataGrid>();
        star.InitDataGrid("prefab/UI/Equip/ItemeEquipStarcr", "ItemeEquipStarcr", star.gameObject, null, Direction.none);

        UGUIClickHandler.Get(Image_skill1cr.gameObject).onPointerClick = OnClickJO;
    }
Example #5
0
    void Awake()
    {
        cachedTransform = transform;
        //开始UI获取;
        image_Equipcr       = cachedTransform.Find("image_Equipcr").GetComponent <Image>();
        Scr_EquipStarcr     = cachedTransform.Find("image_Equipcr/Scr_EquipStarcr").GetComponent <ScrollRect>();
        glayout_EquipStarcr = cachedTransform.Find("image_Equipcr/Scr_EquipStarcr/glayout_EquipStarcr").GetComponent <GridLayoutGroup>();
        image_Selectedcr    = cachedTransform.Find("image_Equipcr/image_Selectedcr").GetComponent <Image>();
        btn_Fillcr          = cachedTransform.Find("image_Equipcr/btn_Fillcr").GetComponent <Button>();
        Image_skill1cr      = cachedTransform.Find("image_Equipcr/Image_skill1cr").GetComponent <Image>();
        btn_Closedcr        = cachedTransform.Find("btn_Closedcr").GetComponent <Button>();
        //结束UI获取;
        isUIinit = true;

        image_Selectedcr.gameObject.SetActive(false);

        UIEventListener.Get(Image_skill1cr.gameObject).onClick = OnClickJO;
        UIEventListener.Get(btn_Closedcr.gameObject).onClick   = OnCloseClick;
        UIEventListener.Get(btn_Fillcr.gameObject).onClick     = OnFillClick;

        _grid = glayout_EquipStarcr.gameObject.AddComponent <UIDataGrid>();
        _grid.InitDataGrid("prefab/UI/Equip/ItemeEquipStarcr", "ItemeEquipStarcr", glayout_EquipStarcr.gameObject, Scr_EquipStarcr, Direction.none);
    }
Example #6
0
        private void saveToCSV()
        {
            int eventType = tCmb_LogsType.SelectedIndex + 1;
            List <UIDataGrid> gridList;
            DataGrid          grid;

            switch (eventType)
            {
            case (int)LOG_TABLE_TYPE.LOG_TABLE_TYPE_CALIBRATION:
            {
                logFiles = new LogToFile("Incom_Utility_Calibration_Log", "csv");
                grid     = grid_LogCal;
                gridList = logCalList;
                break;
            }

            case (int)LOG_TABLE_TYPE.LOG_TABLE_TYPE_ALARM:
            {
                logFiles = new LogToFile("Incom_Utility_Alarm_Log", "csv");
                grid     = grid_LogAlarm;
                gridList = logAlarmList;
                break;
            }

            case (int)LOG_TABLE_TYPE.LOG_TABLE_TYPE_FAULT:
            {
                logFiles = new LogToFile("Incom_Utility_Fault_Log", "csv");
                grid     = grid_LogFault;
                gridList = logFaultList;
                break;
            }

            case (int)LOG_TABLE_TYPE.LOG_TABLE_TYPE_WARNING:
            {
                logFiles = new LogToFile("Incom_Utility_Warining_Log", "csv");
                grid     = grid_LogWarning;
                gridList = logWarningList;
                break;
            }

            case (int)LOG_TABLE_TYPE.LOG_TABLE_TYPE_REFLEX:
            {
                logFiles = new LogToFile("Incom_Utility_Reflex_Log", "csv");
                grid     = grid_LogRelfex;
                gridList = logReflexList;
                break;
            }

            case (int)LOG_TABLE_TYPE.LOG_TABLE_TYPE_INFO:
            {
                logFiles = new LogToFile("Incom_Utility_Info_Log", "csv");
                grid     = grid_LogInfo;
                gridList = logInfoList;
                break;
            }

            default:
            {
                return;
            }
            }

            string filePath = logFiles.Checked();

            if (filePath == null)
            {
                return;
            }

            string strHeader  = "";
            int    columCount = grid.Columns.Count;

            for (int i = 0; i < columCount; i++)
            {
                if (i == grid.Columns.Count - 1)
                {
                    strHeader += grid.Columns[i].Header.ToString();
                    break;
                }
                strHeader += grid.Columns[i].Header.ToString() + ",";
            }
            logFiles.SetDataHeader(strHeader);

            for (int i = 0; i < gridList.Count; i++)
            {
                string strWrite = UIDataGrid.getDataToStr(gridList[i], columCount);
                logFiles.Write(strWrite);
            }

            logFiles.Unchecked();
            MessageBox.Show("Saved CSV file");
        }
Example #7
0
    protected override void Awake()
    {
        base.Awake();
        cachedTransform = transform;
        //开始UI获取;
        rawI_EquipBottomcr          = cachedTransform.Find("rawI_EquipBottomcr").GetComponent <RawImage>();
        go_EquipListcr              = cachedTransform.Find("go_EquipListcr").gameObject;
        Scr_EquipListcr             = cachedTransform.Find("go_EquipListcr/Scr_EquipListcr").GetComponent <ScrollRect>();
        go_contentcr                = cachedTransform.Find("go_EquipListcr/Scr_EquipListcr/go_contentcr").gameObject;
        glayout_EquipList1cr        = cachedTransform.Find("go_EquipListcr/Scr_EquipListcr/go_contentcr/glayout_EquipList1cr").GetComponent <GridLayoutGroup>();
        glayout_EquipList2cr        = cachedTransform.Find("go_EquipListcr/Scr_EquipListcr/go_contentcr/glayout_EquipList2cr").GetComponent <GridLayoutGroup>();
        glayout_EquipList3cr        = cachedTransform.Find("go_EquipListcr/Scr_EquipListcr/go_contentcr/glayout_EquipList3cr").GetComponent <GridLayoutGroup>();
        scrollbar_Applycr           = cachedTransform.Find("go_EquipListcr/Scr_EquipListcr/scrollbar_Applycr").GetComponent <Scrollbar>();
        btn_Homecr                  = cachedTransform.Find("go_topright/go_TopImformation/btn_Homecr").GetComponent <Button>();
        btn_Replycr                 = cachedTransform.Find("go_bottomright/btn_Replycr").GetComponent <Button>();
        go_MyEquipBarcr             = cachedTransform.Find("go_bottomright/go_MyEquipBarcr").gameObject;
        Scr_MyEquipBarcr            = cachedTransform.Find("go_bottomright/go_MyEquipBarcr/Scr_MyEquipBarcr").GetComponent <ScrollRect>();
        glayout_EquipListcr         = cachedTransform.Find("go_bottomright/go_MyEquipBarcr/Scr_MyEquipBarcr/glayout_EquipListcr").GetComponent <GridLayoutGroup>();
        btn_Modifycr                = cachedTransform.Find("go_bottomright/btn_Modifycr").GetComponent <Button>();
        btn_Renamedecr              = cachedTransform.Find("go_bottomright/btn_Renamedecr").GetComponent <Button>();
        image_Herocr                = cachedTransform.Find("go_bottomright/go_ChangeHero/image_Herocr").GetComponent <Image>();
        btn_ChangeHerocr            = cachedTransform.Find("go_bottomright/go_ChangeHero/btn_ChangeHerocr").GetComponent <Button>();
        btn_Cancelcr                = cachedTransform.Find("go_bottomright/btn_Cancelcr").GetComponent <Button>();
        btn_Surecr                  = cachedTransform.Find("go_bottomright/btn_Surecr").GetComponent <Button>();
        btn_EquipSchemecr           = cachedTransform.Find("go_bottomright/btn_EquipSchemecr").GetComponent <Button>();
        togGroup_EquipBtnListcr     = cachedTransform.Find("go_leftcenter/togGroup_EquipBtnListcr").GetComponent <ToggleGroup>();
        text_AttackTogcr            = cachedTransform.Find("go_leftcenter/togGroup_EquipBtnListcr/Attack/text_AttackTogcr").GetComponent <Text>();
        text_LiveTogcr              = cachedTransform.Find("go_leftcenter/togGroup_EquipBtnListcr/Live/text_LiveTogcr").GetComponent <Text>();
        text_MoveTogcr              = cachedTransform.Find("go_leftcenter/togGroup_EquipBtnListcr/Move/text_MoveTogcr").GetComponent <Text>();
        go_rightcentercr            = cachedTransform.Find("go_rightcentercr").gameObject;
        Scr_ContentcrTextcr         = cachedTransform.Find("go_rightcentercr/Scr_ContentcrTextcr").GetComponent <ScrollRect>();
        Text_contcr                 = cachedTransform.Find("go_rightcentercr/Scr_ContentcrTextcr/Content/Text_contcr").GetComponent <Text>();
        text_Namecr                 = cachedTransform.Find("go_rightcentercr/Scr_ContentcrTextcr/text_Namecr").GetComponent <Text>();
        btn_Synthesiscr             = cachedTransform.Find("go_rightcentercr/btn_Synthesiscr").GetComponent <Button>();
        go_EquipSynthesiscr         = cachedTransform.Find("go_EquipSynthesiscr").gameObject;
        btn_Closedcr                = cachedTransform.Find("go_EquipSynthesiscr/btn_Closedcr").GetComponent <Button>();
        Scr_ContentcrText2cr        = cachedTransform.Find("go_EquipSynthesiscr/go_rightcenter2/Scr_ContentcrText2cr").GetComponent <ScrollRect>();
        Text_cont2cr                = cachedTransform.Find("go_EquipSynthesiscr/go_rightcenter2/Scr_ContentcrText2cr/Content/Text_cont2cr").GetComponent <Text>();
        text_Name2cr                = cachedTransform.Find("go_EquipSynthesiscr/go_rightcenter2/Scr_ContentcrText2cr/Content/text_Name2cr").GetComponent <Text>();
        text_Rricecr                = cachedTransform.Find("go_EquipSynthesiscr/go_rightcenter2/text_Rricecr").GetComponent <Text>();
        Scr_CanSynthesisEquipcr     = cachedTransform.Find("go_EquipSynthesiscr/go_topleft2/image_CanSybottom/Scr_CanSynthesisEquipcr").GetComponent <ScrollRect>();
        glayout_CanSynthesisEquipcr = cachedTransform.Find("go_EquipSynthesiscr/go_topleft2/image_CanSybottom/Scr_CanSynthesisEquipcr/glayout_CanSynthesisEquipcr").GetComponent <GridLayoutGroup>();
        btn_leftcr                  = cachedTransform.Find("go_EquipSynthesiscr/go_topleft2/image_CanSybottom/btn_leftcr").GetComponent <Button>();
        btn_rightcr                 = cachedTransform.Find("go_EquipSynthesiscr/go_topleft2/image_CanSybottom/btn_rightcr").GetComponent <Button>();
        //结束UI获取;
        //开始texture设置;
        //结束texture设置;
        isUIinit = true;

        UIEventListener.Get(btn_Homecr.gameObject, AudioConst.CommonReturn).onClick = OnBtnExitClick;
        UIEventListener.Get(btn_ChangeHerocr.gameObject).onClick = OnChangeHero;
        UIEventListener.Get(image_Herocr.gameObject).onClick     = OnChangeHero;

        UIEventListener.Get(btn_EquipSchemecr.gameObject).onClick = OnSchemeClick;
        UIEventListener.Get(btn_Replycr.gameObject).onClick       = OnDefaultClick;
        UIEventListener.Get(btn_Renamedecr.gameObject).onClick    = OnRenameClick;
        UIEventListener.Get(btn_Modifycr.gameObject).onClick      = OnModifyClick;
        UIEventListener.Get(btn_Cancelcr.gameObject).onClick      = OnCancelClick;
        UIEventListener.Get(btn_Surecr.gameObject).onClick        = OnSureClick;
        UIEventListener.Get(btn_Synthesiscr.gameObject).onClick   = OnSynthesisClick;
        UIEventListener.Get(btn_Closedcr.gameObject).onClick      = OnSynthesisCloseClick;

        _heroChooseEquipGrid = glayout_EquipListcr.gameObject.AddComponent <UIDataGrid>();
        _heroChooseEquipGrid.InitDataGrid("prefab/UI/EquipsOutside/ItemeEquipOutSideChoose2cr", "ItemeEquipOutSideChoose2cr", glayout_EquipListcr.gameObject, Scr_MyEquipBarcr, Direction.none);

        equip1    = glayout_EquipList1cr.gameObject.GetRectTransform();
        equip2    = glayout_EquipList2cr.gameObject.GetRectTransform();
        equip3    = glayout_EquipList3cr.gameObject.GetRectTransform();
        equipSelf = go_contentcr.GetRectTransform();
        equipScr  = Scr_EquipListcr.gameObject.GetRectTransform();

        dataEquipt1 = glayout_EquipList1cr.gameObject.AddMissingComponent <UIDataGrid>();
        dataEquipt1.InitDataGrid("Prefab/UI/EquipsOutside/ItemeEquipOutSidecr", "ItemeEquipOutSidecr", dataEquipt1.gameObject, Scr_EquipListcr, Direction.Vertical);
        dataEquipt2 = glayout_EquipList2cr.gameObject.AddMissingComponent <UIDataGrid>();
        dataEquipt2.InitDataGrid("Prefab/UI/EquipsOutside/ItemeEquipOutSidecr", "ItemeEquipOutSidecr", dataEquipt2.gameObject, Scr_EquipListcr, Direction.Vertical);
        dataEquipt3 = glayout_EquipList3cr.gameObject.AddMissingComponent <UIDataGrid>();
        dataEquipt3.InitDataGrid("Prefab/UI/EquipsOutside/ItemeEquipOutSidecr", "ItemeEquipOutSidecr", dataEquipt3.gameObject, Scr_EquipListcr, Direction.Vertical);

        tabBar = togGroup_EquipBtnListcr.gameObject.AddComponent <TabBar>();
        tabBar.ManulInit(togGroup_EquipBtnListcr.GetComponentsInChildren <Toggle>(), togGroup_EquipBtnListcr);
        tabBar.InitColorAndSize(Color.white, Color.yellow, 20, 24);
        tabBar.OnChange = SelectTab;
        tabBar.SelectTab(0);
    }