当前位置: 首页 > news >正文

html5网站用什么软件宁波seo优化报价多少

html5网站用什么软件,宁波seo优化报价多少,凡科建站和wordpress,wordpress 设置首页目录 此篇需要你有一定的阅读代码的能力,不然点开了也不知道在做什么 这是读表工具 So文件这么写 使用 此篇需要你有一定的阅读代码的能力,不然点开了也不知道在做什么 在此之前你需要知道epplus是干什么的,然后知道其基本api&#xff0…

目录

        此篇需要你有一定的阅读代码的能力,不然点开了也不知道在做什么 

这是读表工具 

So文件这么写

 使用


        此篇需要你有一定的阅读代码的能力,不然点开了也不知道在做什么 

        在此之前你需要知道epplus是干什么的,然后知道其基本api,其实我之前写过一篇关于这个插件的说明

        【插件】【干货】用EPPlus在Unity中读写Excel表_epplus unity-CSDN博客

读表工具 

                 十分简单,然后又写了一个存入so文件类,涉及到一个所谓脏标记的api,箭头读取该excel表必不可少的重要的信息

using System.Collections.Generic;
using System.IO;
using UnityEngine;
using OfficeOpenXml;
using UnityEditor;public class ExcelTool {// 定义颜色单词与Color的映射字典private static Dictionary<string, Color> colorDictionary = new Dictionary<string, Color>(){{"green", new Color(0, 1, 0)},{"red", new Color(1, 0, 0)},{"gray", new Color(0.5f, 0.5f, 0.5f)},{"yellow", new Color(1, 1, 0)},{"clear", new Color(0.5f, 0.5f, 0.5f, 0.2f)}};// 从 Excel 导入史莱姆类型表public static SlimeTable ImportSlimeTypeTable(string filePath = "Assets/Resources/Model/史莱姆表.xlsx") {SlimeTable slimeTypeTable = ScriptableObject.CreateInstance<SlimeTable>();using (ExcelPackage excelPackage = new ExcelPackage(new FileInfo(filePath))) {ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets[1];int rowCount = worksheet.Dimension.Rows;for (int i = 2; i <= rowCount; i++) {SlimeTypeData data = new SlimeTypeData();int.TryParse(worksheet.Cells[i, 1].Value?.ToString(), out data.ID);data.ID = i;if (System.Enum.TryParse(worksheet.Cells[i, 2].Value?.ToString(), out E_SlimeType slimeType)) {data.E_SlimeTypeData = slimeType;}if (System.Enum.TryParse(worksheet.Cells[i, 3].Value?.ToString(), out E_Recip recip)) {data.E_RecipData = recip;}string colorString = worksheet.Cells[i, 4].Value?.ToString();if (!string.IsNullOrEmpty(colorString)) {colorString = colorString.ToLower(); // 转换为小写,确保与字典中的键匹配if (colorDictionary.TryGetValue(colorString, out Color color)) {data.colorData = color;}else {Debug.LogError($"Failed to find color mapping for: {colorString} at row {i}");}}// 尝试将单元格的值解析为浮点数if (float.TryParse(worksheet.Cells[i, 5].Value?.ToString(), out float huangeyTime)) {data.huangeyTime = huangeyTime;}else {Debug.LogError($"Failed to parse huangeyTime at row {i}");}slimeTypeTable.dataList.Add(data);}}return slimeTypeTable;}
}public class ExcelImporterMenu {[MenuItem("Tools/Import Slime Table from Excel")]public static void ImportSlimeTableFromExcel() {SlimeTable slimeTypeTable = ExcelTool.ImportSlimeTypeTable();if (slimeTypeTable != null && slimeTypeTable.dataList.Count > 0) {// 假设当前选中的对象是一个 SlimeTable 实例SlimeTable selectedTable = Selection.activeObject as SlimeTable;if (selectedTable != null) {selectedTable.dataList = slimeTypeTable.dataList;EditorUtility.SetDirty(selectedTable);AssetDatabase.SaveAssets();Debug.Log("史莱姆表已成功从 Excel 导入");}else {Debug.LogWarning("请先在项目窗口中选中一个 SlimeTable 实例");}}else {Debug.LogError("导入史莱姆表时出现问题,请检查文件路径和文件内容");}}
}

So文件

using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;// 定义史莱姆类型数据结构[Serializable]public class SlimeTypeData {public int ID;public E_SlimeType E_SlimeTypeData;public E_Recip E_RecipData;public Color colorData;public float huangeyTime;}    // 定义史莱姆类型表的 ScriptableObject[CreateAssetMenu(fileName = "创建史莱姆列表")]public class SlimeTable : ScriptableObject {[SerializeField]public List<SlimeTypeData> dataList = new List<SlimeTypeData>();public Slime IndexForType(Slime slime,int index,Food f){ if(dataList.Count!=0) {SlimeTypeData data = dataList[index];slime.gameObject.name = data.E_SlimeTypeData.ToString();f.foodType = data.E_RecipData;slime.E_SlimeType = data.E_SlimeTypeData;slime.SpriteRd.color = data.colorData;slime.MaxHuangryValue = data.huangeyTime;slime.CurHuangryTimer = slime.MaxHuangryValue;}return slime;}
}

 使用

选择你创建出来的SO文件,然后点击你的菜单栏拓展 如果格式正确就能直接读取出来了

 

 

 

 

http://www.mnyf.cn/news/47666.html

相关文章:

  • 网站被取消备案淘宝app官方下载
  • 怎样自学做网站网站推广方案有哪些
  • 英语网站建设的必要性页面seo是什么意思
  • 网站建设的费用预算如何写郑州网络营销
  • 用jsp做网站用什么软件杭州制作公司网站
  • 淄博 建设网站站长seo综合查询
  • 怎么做网站写书品牌广告和效果广告的区别
  • 药品招商网站大全seo排名优化推荐
  • 网站建设外包公司最近有新病毒出现吗
  • 网站建设推广接单语廊坊优化技巧
  • 国外的ps网站阿拉善盟seo
  • 营养早餐网站的设计与制作生意参谋官网
  • 香港八达通app最新版本下载苏州关键词优化搜索排名
  • wordpress限制用户下载次数baidu优化
  • 想学网站建设跨境电商营销推广
  • 企业网站后台管理系统快速排序优化
  • 长春火车站人工电话手机百度app下载安装
  • 在网站上做的h5如何发到微信上建站系统源码
  • 宝安的医院网站建设抖音代运营公司
  • dw做新闻网站百度优选官网
  • 做网站的价位网址如何下载视频
  • 网站导航栏兼容性关联词有哪些三年级
  • 什么网站系统做的最好营销网站优化推广
  • 有做装修效果图赚钱的网站吗什么是营销型网站?
  • vultr建站wordpress百度优化
  • 经营购物网站媒介
  • 网站内容怎么写汕头seo公司
  • 网页制作与网站建设ppt中国知名网站排行榜
  • 全球设计师站长工具seo综合查询怎么用
  • 官方网站搭建要多少钱如何规划企业网络推广方案