您的位置:首页 > Web前端

自学TDTK(TowerDefenceToolKIt)(1)

2015-08-15 14:22 435 查看
http://www.unitymanual.com/thread-6660-1-1.html

塔防游戏插件:

TDTK集成了常见的塔防游戏框架

第一步:导入插件资源,会出现以下错误:

These are the errors:

1) Assets/Standard Assets/Scripts/MeshCombineUtility.cs(27,74): error CS1061: Type `UnityEngine.Mesh' does not contain a definition for `GetTriangleStrip'
and no extension method `GetTriangleStrip' of type `UnityEngine.Mesh' could be found (are you missing a using directive or an assembly reference?)

2) Assets/Standard Assets/Scripts/MeshCombineUtility.cs(130,73): error CS1061: Type `UnityEngine.Mesh' does not contain a definition for `GetTriangleStrip'
and no extension method `GetTriangleStrip' of type `UnityEngine.Mesh' could be found (are you missing a using directive or an assembly reference?)

3) Assets/Standard Assets/Scripts/MeshCombineUtility.cs(177,30): error CS1061: Type `UnityEngine.Mesh' does not contain a definition for `SetTriangleStrip'
and no extension method `SetTriangleStrip' of type `UnityEngine.Mesh' could be found (are you missing a using directive or an assembly reference?)

解决办法:Change the GetTriangleStrip
to GetTriangles and the same for the SetTriangleStrip, change that to SetTriangles

第二步:场景选择与创建

两种选择:一是Linear
Path,另外一个是Mazing。Linear Path表示敌人走的是点之间的连线,Mazing表示敌人走的是点和面的连线。例如:当你新建一个LinearPath的时候,你可以看到Path1中的waypoint1和waypoint2,

而新建一个Mazing可以看到Path下有waypoint1、BuildPlatform和waypoint2,表示敌人从点waypoint1走到BuildPlatform再到waypoint2。我们新添加一个waypoint3,再调整各个point的位置,则敌人前进路线就是Scene中的蓝色线条,所以在Path中你可以自定义敌人前进路线及前进方向。

同样的找到BuildfPlatform,炮塔在它上面建造,你可以选择建立多个Buildplatform,在你的场景中定义可以造塔的地方。

接下来是GameControl,可以设置游戏逻辑,比如游戏初始金钱,玩家生命值。

现在你运行游戏项目,并不能出现什么,为此,你需要一个界面,TDTK有两种界面选择,Unity原生的UI和免费版本的NGUI,画面有所不同,大家可以自己试试,体验一下效果。现在我们选择创建UI,UI下属性众多,有想深入了解的同学可以查看用户手册。创建UI之后,记得将BuildManager下的show
tower list面板中的炮塔选上,否则待会就不能建炮塔啦。

现在运行-》点击界面中的任一方格-》炮塔种类选择-》建造。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: