
1.编写玩家受击逻辑BeHit(atk,dir) (1.受击时得知受到的攻击力和受击方向 (2.受击时向受击方向被击飞一小段 (3.减去相应的生命值 2.编写基本小怪逻辑 (1.wander状态,在两点间巡逻 (2.当触发OnTouchThePlayer,通知玩家BeHit 3.编写了更多摘要和参数解释 4.更新的Dotween插件的版本
15 lines
362 B
C#
15 lines
362 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class NormalEnemy : Enemy
|
|
{
|
|
protected override void OnTouchThePlayer(MyPlayer player)
|
|
{
|
|
player.OnBeHit(ATK,
|
|
((transform.position.x -
|
|
player.transform.position.x)
|
|
> 0) ? 1 : -1);
|
|
}
|
|
}
|