【unity】开发rts 3 出生点,创建建筑物

一 出生点、阵营类型、阵营

实例栏-GameManage,默认有一个插槽

 size 插槽数量

role 权限,host是主人,权限高

type 阵营类型,不选不限制,选的效果没看懂,文档原文:

The Type field in Data allows you to define a specific type for the faction occupying the slot which would allow other RTS Engine components to behave differently depending on that type. For example, you may have a building that you want to share between different faction types but the same building allows to create different units depending on the faction type. This can be done by specifying which unit creation tasks would be visible via the same building depending on the faction type and whenever that building is placed by a faction, it initializes its unit creation tasks by querying the type of the faction it is part of and only enables the unit creation tasks associated to that type. You can also leave this field unassigned, meaning that the faction slot does not posses any particular type.

从大厅进入,此字段会被大厅的选择覆盖

npc type 电脑类型,大概就是ai吧,需要role是npc,本阵营role是host,所以设成unsign

is local player 是否本地玩家,如果此插槽要为玩家则必须开启,否则玩家不能使用此插槽【大概。试了试,开启此按钮的阵营似乎都能被玩家控制?

inital cam look at 设置初始摄像机看向哪里,可设置为初始建筑

init faction entity 初始单位,包括建筑、单位。

        all types,不论选择什么阵营都会初始化;

        type specific,选择了指定阵营才初始化这里设定的单位。

可添加其他阵营,设置为npc,取消【is local player】避免玩家控制,调整名字、颜色;

新阵营的实体列表中会复制上一个阵营的内容,需新建实例、关联上去;

最后将新阵营的初始相机视角调整过来。

想使用其它出生点,需调整【is local player】与role。从大厅开始游戏,大厅会覆盖这些字段。

*阵营类型可以创建:(例如人族/异虫/星灵这种概念)

project右键-create-rts engine-faction type

name阵营名称

code唯一标识

limits限制,比如此阵营某些建筑的建造上限等

二 创建建筑

1 导航栏rts engine - new building,进入创造建筑页面

 name 名称

code 唯一标识

category 类别,可多个,用逗号分隔,不能有空格

 description 描述

icon 图标,30*30,拖进project后还要点一下,texture type改成sprite

右上角final结束创建,创建好的预制体在Assets/Resources/Prefabs。

要移动预制体,路径结尾必须为../Resources/Prefabs

2 进入预制体编辑

所有其他内容都应作为子组件;

主体:

entity页面:

radius半径,建筑的面积

model 模型

faction entuty页面: 用于设置建筑所属阵营、阵营颜色展示在哪等

 isMainEntity 胜利条件为消灭主要目标时,此建筑是否为主要目标

isFactionLocked 游戏中不能转换阵营【没懂

init resources 初始化资源,建造费用?

disable resources 禁用资源,没懂

colored renderers 颜色渲染,展示阵营颜色的模型部分

        查看此模型部分的mesh rendering,里面有多少matrial ID就要在colored renderers加几条

building标签暂时没内容,未来可能加入建筑类型字段

3 建筑血量building health

 max / inital health 最大血量,初始血量。初始血量不满,则初始化建筑时是建造状态,需工人完成建造;初始等于最大血量,则建筑初始化时就是完成状态。

attack target position 被攻击的位置。可指定被攻击的模型,none则为selection,建筑范围圈

can increase / decrease/be attacked 血量是否可增加、减少、建筑是否可被攻击

build time建造时间(1到满血)

repair costs修复消耗,无则不消耗资源(1到满血)

hover health bar 血条吧应该是

hit effect 被攻击的特效?

hit audio 被攻击音效

desctruction tab 页面,建筑摧毁后延迟,destroy award摧毁赏金?还是返还资源

health states建筑状态页面

construction states中可设置多个建造阶段,打开percenage按百分比血量区分阶段,每阶段在show/hide中设置显示隐藏的模型部分

4 complete states建造完成状态,按文档说法这里的血量字段没作用,就设置个显示、隐藏的部分

5 states 这里按血量设置不同阶段显示/隐藏的部分,比如按损坏程度显示不同的火烟墙

6 destroy states摧毁,设置摧毁延迟可在这里显示隐藏指定部分,添加特效

trigger event 用于在脚本里自行编写此状态触发的内容

三 其它主体组件属性

1 audio 音频

2 nav mesh obstacle 网格障碍,在地形掏个洞,使寻路绕过建筑,可设置中心和大小。

下面有carve雕刻属性(包含move threhold移动阈值,time to stationary不动时间,carve only stationary雕刻仅不动),没懂什么意思

四 子组件

1 selection component 选择组件,用于定义鼠标选中此建筑的碰撞体

selection需设置enable

可包含多个子碰撞体,以匹配建筑形状。子组件需要有 colider碰撞体,以及entity selection colider组件来关联脚本

2 selection render 选中后展示的建筑位置高亮圈

 selection render 把实例栏的selection_render自己拖进来

material ID 圈的颜色的材质id,0?

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值