Skip to content

EnvSetup

jiepengtan edited this page Nov 20, 2019 · 1 revision

1.开发环境

1. 环境要求

2. 目录安排

Screen Shot 2019-11-15 at 10.14.28 AM.png

  • 1.Game.Model
    • 这里放置的是MVC 中Model and Control 代码(Logic 层)
  • 2.Game.View
    • 这里放置的是MVC 中View 代码(View 层),依赖于Model 层
  • 3.Tools.UnsafeECS.ECSDefine.Game
    • 这里放置的是你对游戏中 Entity Component System 以及全局状态 State 的定义,必须保证该子dll 是能编译的(不能依赖于Model 或 View 层)
  • 4.Scripts
    • 这里放置一些Editor或和游戏逻辑无关的代码

3. Tools.UnsafeECS.ECSDefine 定义详解

0. 代码生成

  1. Windows 用户

    • 使用gitBash 执行 Client.Unity/DataAndTools/Tools/UpdateAndCodeGen_Win.sh
  2. Mac 用户

    • 使用命令行执行 Client.Unity/DataAndTools/Tools/UpdateAndCodeGen.sh
    • 或直接双击运行 Client.Unity/DataAndTools/Tools/UpdateAndCodeGen (注意无后缀)

2.如何运行

1.单机模式

  • 1.打开场景 Screen Shot 2019-11-13 at 4.48.20 PM.png

    1. 确保钩上了 ClientMode 选项 Screen Shot 2019-11-13 at 4.49.50 PM.png
    1. 运行 游戏
    • A D 控制方向
    • Space 释放技能 (Boid demo 才有技能)

2.联网模式

  • 1.打开Game.sln Screen Shot 2019-11-13 at 4.59.36 PM.png

  • 2.编译并运行 Game.sln [图片上传中...(Screen Shot 2019-11-13 at 4.50.45 PM.png-75d531-1573782602414-0)]

  • 3.确保关闭了单机模式 ClientMode Screen Shot 2019-11-13 at 4.50.45 PM.png

  • 4.Build Screen Shot 2019-11-13 at 5.03.04 PM.png

  • 5.Run Client Screen Shot 2019-11-13 at 5.07.33 PM.png

    1. 现在是简单帧同步模式

Screen Shot 2019-11-13 at 5.09.51 PM.png

(Build 版本代码中为了方便测试,做了限制自动绕圈圈,你可以修改他) Screen Shot 2019-11-15 at 10.04.02 AM.png