// Use this for initialization void OnGUI() { if (GUI.Button(new Rect(10, 10, 150, 100), "攻击测试")) { unit.BeAttacked(); } }
void attackEnemy(BaseUnit enemy) { string enemyId = enemy.Id; int damage = Attack; Vector3 hurtVector = Vector3.one; int hurtForce = 1; bool finish = enemy.BeAttacked(damage, hurtVector, hurtForce); if (finish) { mActionTarget = null; //mPath = null; } //gameController.attackEnemy(this.playerIdOfUnit, this.Id, enemyId, damage, hurtVector, hurtForce); }