fix:修改场地中所有问题
This commit is contained in:
@@ -93,9 +93,12 @@ public class Actions
|
||||
playerAi.ai.isStopped = false;
|
||||
GameObject target = GameManager.Ins.GetEnemy(transform);
|
||||
playerAi.ai.destination = target==null? GameLocal.Ins.pkPos.position : target.transform.position;
|
||||
if(target==null)
|
||||
return TaskStatus.Failure;
|
||||
// 计算目标距离
|
||||
float distance = Vector3.Distance(transform.position, target.transform.position);
|
||||
if (distance <= playerAi.ai.radius)
|
||||
float distance = Vector3.Distance(transform.position, target.transform.position)+1f;
|
||||
Debug.Log("距离:"+distance);
|
||||
if (distance <= 4.2f)
|
||||
{
|
||||
playerAi.ai.isStopped = true;
|
||||
return TaskStatus.Success;
|
||||
@@ -116,7 +119,7 @@ public class Actions
|
||||
playerAi.ai.destination = target.position;
|
||||
// 计算目标距离
|
||||
float distance = Vector3.Distance(transform.position, target.position);
|
||||
if (distance <= playerAi.ai.radius)
|
||||
if (distance <= 4.2f)
|
||||
{
|
||||
playerAi.ai.isStopped = true;
|
||||
return TaskStatus.Success;
|
||||
@@ -208,14 +211,15 @@ public class Actions
|
||||
{
|
||||
PlayerAI playerAi = transform.GetComponent<PlayerAI>();
|
||||
if (playerAi == null) return TaskStatus.Failure;
|
||||
if(target.Value==null|| GameManager.Ins.gameState==GameState.Victory)
|
||||
return TaskStatus.Success;
|
||||
transform.LookAt(new Vector3(targetPos.Value.x, transform.position.y, targetPos.Value.z));
|
||||
if (target.Value != null)
|
||||
{
|
||||
transform.LookAt(new Vector3(target.Value.transform.position.x, transform.position.y, target.Value.transform.position.z));
|
||||
}
|
||||
playerAi.DoAttack();
|
||||
if(target.Value==null|| GameManager.Ins.gameState==GameState.Victory)
|
||||
return TaskStatus.Success;
|
||||
|
||||
return TaskStatus.Running;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,11 @@ public class MeleeWeapon : Launcher
|
||||
Quaternion effectRot = Quaternion.LookRotation(hit.normal);
|
||||
muzzlePoint.position = effectPos;
|
||||
muzzlePoint.rotation = effectRot;
|
||||
Enemy curEnemy = hit.collider.GetComponent<Enemy>();
|
||||
if (curEnemy != null)
|
||||
{
|
||||
curEnemy.Die(null,transform);
|
||||
}
|
||||
SpawnMuzzle();
|
||||
}
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ public class GameManager : NetworkBehaviour
|
||||
{
|
||||
//GameOver(GameState.Settle);
|
||||
StartSpecialEvent(GameEnemyEventType.CleanUp);
|
||||
}, 60f * 0.5f);
|
||||
}, 60f * 15f);
|
||||
}
|
||||
|
||||
[ClientRpc]
|
||||
@@ -506,9 +506,11 @@ public class GameManager : NetworkBehaviour
|
||||
List<Enemy> curEnemyList = new List<Enemy>();
|
||||
int curRoundIndex=Random.Range(1,RoundInfos.Count);
|
||||
var roundInfo=roundIndex <= 2? RoundInfos[0]: RoundInfos[curRoundIndex];
|
||||
curRoundIndex=2;
|
||||
|
||||
// curRoundIndex=2;
|
||||
// roundInfo= RoundInfos[curRoundIndex];
|
||||
|
||||
roundIndex = curRoundIndex;
|
||||
roundInfo= RoundInfos[curRoundIndex];
|
||||
StartEvent(roundInfo);
|
||||
if (roundIndex == 5)
|
||||
{
|
||||
@@ -688,6 +690,7 @@ public class GameManager : NetworkBehaviour
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Enemy> NpcEnemyList = new List<Enemy>();
|
||||
public void CreateNpc()
|
||||
{
|
||||
if (!isStart)
|
||||
@@ -738,6 +741,7 @@ public class GameManager : NetworkBehaviour
|
||||
|
||||
enemy.GetComponent<Enemy>().OnSpawn(j, 3, 1, GameLocal.Ins.npcPos[posId].position);
|
||||
enemy.GetComponent<Enemy>().outline.enabled = true;
|
||||
NpcEnemyList.Add(enemy.GetComponent<Enemy>());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -765,6 +769,10 @@ public class GameManager : NetworkBehaviour
|
||||
{
|
||||
item.Die(null,transform);
|
||||
}
|
||||
foreach (var item in NpcEnemyList)
|
||||
{
|
||||
item.Die(null,transform);
|
||||
}
|
||||
}, 5);
|
||||
CoroutineTaskManager.Instance.WaitSecondTodo(() =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user