【发布时间】:2017-10-15 17:50:13
【问题描述】:
我是 Unity3d 编程的新手,我在 c# 中几乎不需要帮助。我的问题是我试图在不选择怪物的情况下施放技能。
所以代码是:
if (EventSkillFinished()) {
var skill = skills[currentSkill];
// apply the skill on the target
**CastSkill(skill, target);**
if (nextSkill != -1) {
currentSkill = nextSkill;
nextSkill = -1;
} else currentSkill = skill.followupDefaultAttack ? 0 : -1;
这里有一些代码
public void CastSkill(Skill skill) {
if (CastCheckSelf(skill, false) && CastCheckTarget(skill)) {
// do the logic in here or let the skill effect take care of it?
if (skill.effectPrefab == null || skill.effectPrefab.isPurelyVisual) {
// attack
if (skill.category == "Attack") {
// deal damage directly
DealDamageAt(target, damage + skill.damage, skill.aoeRadius);
【问题讨论】: