Beispiel #1
0
 public static ExcelMakerManager CreateExcelMakerManager()
 {
     if (eInstance == null)
     {
         eInstance = new ExcelMakerManager();
     }
     return(eInstance);
 }
    private void Start()
    {
        transform.FindChild("Button_Excel").GetComponent <UnityEngine.UI.Button>().onClick.AddListener(() => { SelectFolder("txt", "ExcelToTxt"); });
        //transform.FindChild("Button_ClothPNG").GetComponent<UnityEngine.UI.Button>().onClick.AddListener(() => { SelectFolder("png", "ClothPNG"); });
        //transform.FindChild("Button_BG").GetComponent<UnityEngine.UI.Button>().onClick.AddListener(() => { SelectFolder("png", "BG"); });
        //transform.FindChild("Button_Gestures").GetComponent<UnityEngine.UI.Button>().onClick.AddListener(() => { SelectFolder("png", "Gestures"); });
        transform.FindChild("Button_Model").GetComponent <UnityEngine.UI.Button>().onClick.AddListener(() =>
        {
            UIManager.GetInstance().ShowUIForms(ProConst.RESOURECESSCRECH_UIFROM);
            var temp         = UIManager.GetInstance().GetUIForms(ProConst.RESOURECESSCRECH_UIFROM);
            var var          = temp.GetComponent <LoadTexture>();
            var.imgaePath    = Application.streamingAssetsPath + "/Model";
            DirectoryInfo di = new DirectoryInfo(var.imgaePath);
            if (di.GetFiles().Length <= 0)
            {
                UIManager.GetInstance().ShowUIForms(ProConst.SHOWTEXT_UIFORM);
                var show = UIManager.GetInstance().GetUIForms(ProConst.SHOWTEXT_UIFORM);
                show.GetComponent <ShowTxtUIForm>().ts = "不存在人物模型图片";
                return;
            }
            StartCoroutine(var.StartLoad());
        });

        transform.FindChild("Button_Export").GetComponent <UnityEngine.UI.Button>().onClick.AddListener(() =>
        {
            ExcelMakerManager.CreateExcelMakerManager();
            var playerPart = StartAlice.playerPart;
            for (int i = 0; i < playerPart.childCount; i++)
            {
                var clothInfo      = playerPart.GetChild(i).GetComponent <ClothDressInfo>();
                TestInfo testInfo  = new TestInfo();
                testInfo.dressType = (int)clothInfo.eDressType;
                testInfo.iconID    = clothInfo.itemID;
                testInfo.model     = clothInfo.gameObject.name;
                var pos            = clothInfo.transform.localPosition;
                testInfo.modelPos  = "[" + pos.x.ToString() + ", " + pos.y.ToString() + ", " + pos.z + "]";
                listInfos.Add(testInfo);
            }
            PrintExcel();
            UIManager.GetInstance().ShowUIForms(ProConst.SHOWTEXT_UIFORM);
            UIManager.GetInstance().GetUIForms(ProConst.SHOWTEXT_UIFORM).GetComponent <ShowTxtUIForm>().ts = "导出成功";
        });
    }