今天有點忙先發怕忘記
要做閃避功能
等等更新
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyControl : MonoBehaviour
{
public enum EnemyBehavior {patrol,battle};
public EnemyBehavior EnemyNow;
public enum Battle { follow, attack, dodge };
public Battle BatChoose;
public enum checkface { Lelf,Right};
public checkface face;
public GameObject SpearAttack;
public static bool SpearSpr;
...
private void FixedUpdate() ...
}
private void FixedUpdate()
{
//敵人狀態
switch (EnemyNow)
{
case EnemyBehavior.patrol:
if (playertransform)
{
//巡邏
Domove();
}
break;
case EnemyBehavior.battle:
switch (BatChoose)
{
case Battle.follow:
followPlayer();
break;
case Battle.attack:
DoAttack();
break;
case Battle.dodge:
Dodging();
break;
}
break;
}
}
void Dodging()
{
待更
}