Code Monkey home page Code Monkey logo

excel2unityinternal's Introduction

提示

  • 工具已经集成到UnityGameFramework中,以后不再单独维护这个工具,会在UnityGameFramework中进行维护

Excel2Unity

  • 目标功能

    • 导出txt文本文件以及生成各个语言的解析版本(针对客户端和服务器)
  • 目前功能

    • 导出txt文本文件并生成相应的解析代码到unity(客户端)
  • 安装须知

    • 1, 源代码使用的python3,需要安装python3安装包

    • 2, 导入xlrd包

    • 3, IDE使用的pycharm, 推荐使用pycharm开发python

  • 代码修改

    打开Config.py文件, 修改几个配置属性

    # Unity输出根目录
    UNITY_TABLE_ROOT_DIR = "./TestTable/Assets/"
    
    # Unity数据目录
    UNITY_TABLE_DATA_DIR = "GameData/TableData/"
    
    # Unity代码目录
    UNITY_TABLE_CODE_DIR = "Scripts/Table/"   

    有一个配置行暂时不需要修改, 目前配置文件都默认生成在Resources文件夹下 , 通过Resources.Load()加载,资源动态加载还没有完成

    # Unity使用资源路径读取
    UINTY_TABLE_USE_RESOURCE_PATH_READ = True
  • Excel配置使用

    • Excel表头有5行

    • 第一行为字段注释,在生成代码中显示

    • 第二行有三个字段可以选择 C, S, CS , 分别用来代码这个字段是客户端 所有,服务器所有,还是客户端服务器共有

    • 第三行是字段的类型, 目前有 Int, float, string, List[int], List[float], List[string], Map[int|int], Map[int|float], Map[int|string], Map[string|int], Map[string|float], Map[string|string]这些类型可供选择, 应该是涵盖了常用的类型,字段类型后期可以增加

    • 第四行填写字段名

    • 第五行是指字段是否为key,这个表格工具支持多个字段key和没有key

      • 没有key的情况下,生成的表格的数据管理类的数据使用List管理

      • 有一个key的情况下,生成的表格的数据管理类的数据使用Dictionary管理

      • 多个key的情况下,也是使用Dictionary来管理,但是获取数据的函数会有不同 可能会有多个形参

excel2unityinternal's People

Contributors

xieliujian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.