수상한 미궁 몹 수 이상하고, 안 움직임 수정

This commit is contained in:
Ino 2025-03-23 09:23:25 +09:00
parent ad58f1203b
commit 3feaa3d411
5 changed files with 22 additions and 37 deletions

View File

@ -15,7 +15,7 @@ public class MobActor : Actor
protected int m_SpawnerId; protected int m_SpawnerId;
protected eMobStatus MobStatus; protected eMobStatus MobStatus;
Vector3 OriginalPos, TargetPatrolPos; Vector3 OriginalPos, TargetPatrolPos;
float m_PatrolDelay, m_DieTime, f_BaseChaseRange, HealPerSec, HPRegenPerSec; float m_PatrolDelay, m_PatrolTime, f_BaseChaseRange, HealPerSec, HPRegenPerSec;
bool b_IsFirstAttack, NoUpdate_byTool; bool b_IsFirstAttack, NoUpdate_byTool;
protected MonsterAppearData m_MonsterAppearData; protected MonsterAppearData m_MonsterAppearData;
protected MonsterTableData m_MonsterTableData; protected MonsterTableData m_MonsterTableData;
@ -39,6 +39,7 @@ public class MobActor : Actor
{ {
base.Set(isEnemy, owner, sdata, _id, _stop); base.Set(isEnemy, owner, sdata, _id, _stop);
m_PatrolTime = 0f;
if (MagicID > 0) m_Magic = new UseMagicInfo { m_SkillTableData = table_skilllist.Ins.Get_Data_orNull(MagicID), m_uiIndex = -1 }; if (MagicID > 0) m_Magic = new UseMagicInfo { m_SkillTableData = table_skilllist.Ins.Get_Data_orNull(MagicID), m_uiIndex = -1 };
m_SpawnerId = _id; m_SpawnerId = _id;
m_MonsterAppearData = table_monsterappear.Ins.Get_Data_orNull(m_SpawnerId); m_MonsterAppearData = table_monsterappear.Ins.Get_Data_orNull(m_SpawnerId);
@ -79,6 +80,7 @@ public class MobActor : Actor
// 순찰 모드로 전환 // 순찰 모드로 전환
transform.SetPositionAndRotation(pos, Quaternion.identity); transform.SetPositionAndRotation(pos, Quaternion.identity);
OriginalPos = pos; OriginalPos = pos;
Set_Warp(pos);
Change_MobStatus(eMobStatus.PatrolWait); Change_MobStatus(eMobStatus.PatrolWait);
// 몹 스탯 설정 // 몹 스탯 설정
@ -142,17 +144,16 @@ public class MobActor : Actor
//if (!IsSubRole(eSubRol.Mimic)) //if (!IsSubRole(eSubRol.Mimic))
// Check_Battle(); // Check_Battle();
break; break;
case eMobStatus.PatrolRot: case eMobStatus.PatrolRot: // TargetPatrolPos 위치를 바라봄
// TargetPatrolPos 위치를 바라봄
Vector3 directionToTarget = (TargetPatrolPos - transform.position).normalized; Vector3 directionToTarget = (TargetPatrolPos - transform.position).normalized;
Quaternion lookRotation = Quaternion.LookRotation(new Vector3(directionToTarget.x, 0, directionToTarget.z)); Quaternion lookRotation = Quaternion.LookRotation(new Vector3(directionToTarget.x, 0, directionToTarget.z));
transform.rotation = Quaternion.Slerp(transform.rotation, lookRotation, Time.deltaTime * 5f); transform.rotation = Quaternion.Slerp(transform.rotation, lookRotation, Time.deltaTime * 5f);
if (Quaternion.Angle(transform.rotation, lookRotation) < 5f) if (Quaternion.Angle(transform.rotation, lookRotation) < 5f)
Change_MobStatus(eMobStatus.Patroling); Change_MobStatus(eMobStatus.Patroling);
break; break;
case eMobStatus.Patroling: case eMobStatus.Patroling: // TargetPatrolPos 위치로 이동함
// TargetPatrolPos 위치로 이동함 m_PatrolTime -= Time.deltaTime;
if (Complete_Destination()) if (m_PatrolTime <= 0f || Complete_Destination())
{ {
Change_MobStatus(eMobStatus.PatrolWait); Change_MobStatus(eMobStatus.PatrolWait);
if (!IsSubRole(eSubRol.Mimic)) if (!IsSubRole(eSubRol.Mimic))
@ -276,6 +277,7 @@ public class MobActor : Actor
Play_Run(); Play_Run();
Set_Path(TargetPatrolPos); Set_Path(TargetPatrolPos);
m_NavMeshAgent.stoppingDistance = 0.1f; m_NavMeshAgent.stoppingDistance = 0.1f;
m_PatrolTime = 5f;
break; break;
case eMobStatus.Battle: case eMobStatus.Battle:
m_NavMeshAgent.stoppingDistance = m_NavStopDistance; m_NavMeshAgent.stoppingDistance = m_NavStopDistance;
@ -424,7 +426,6 @@ public class MobActor : Actor
sdata.Add_MissionCount(ePurpose.KILL_MONSTER_ACC); sdata.Add_MissionCount(ePurpose.KILL_MONSTER_ACC);
} }
base.Set_Die(); base.Set_Die();
m_DieTime = m_MonsterAppearData.f_SpawnerDelay;
} }
protected override void After_Die() protected override void After_Die()
{ {

View File

@ -28,7 +28,7 @@ public class PCActor : MyActor
{ {
MyValue.MyPC = null; MyValue.MyPC = null;
if (!DSUtil.CheckNull(MyValue.m_RealCamera)) if (!DSUtil.CheckNull(MyValue.m_RealCamera))
MyValue.m_RealCamera.Set_Target(null, 0f); MyValue.m_RealCamera.Set_Target(null);
} }
} }

View File

@ -185,15 +185,18 @@ public class DungeonInfo : MonoBehaviourSingletonTemplate<DungeonInfo>
IEnumerator Co_Update_Maze() IEnumerator Co_Update_Maze()
{ {
float min = 10f, max = 20f; Vector3 centerpos = new Vector3(15f, 0f, 19f);
float min = 0f, max = 5f;
var dgData = MyValue.MyChoiceMapData.Get_DungeonMapData_orNull(); var dgData = MyValue.MyChoiceMapData.Get_DungeonMapData_orNull();
for (int i = 0; i < dgData.n_MobCount; i++) for (int i = 0; i < dgData.n_MobCount; i++)
Make_Mob(eSubRol.None, table_monsterlist.Ins.Get_RandomData(eSubRol.None), dgData, MyValue.MyPC.Get_position(), min, max); Make_Mob(eSubRol.None, table_monsterlist.Ins.Get_RandomData(eSubRol.None), dgData, centerpos, min, max,
mob => mob.transform.SetParent(transform));
if (m_MazeClear >= 5) if (m_MazeClear >= 5)
{ {
m_MazeClear = 0; m_MazeClear = 0;
Make_Mob(eSubRol.Boss, table_monsterlist.Ins.Get_RandomData(eSubRol.Boss), dgData, MyValue.MyPC.Get_position(), min, max); Make_Mob(eSubRol.Boss, table_monsterlist.Ins.Get_RandomData(eSubRol.Boss), dgData, centerpos, min, max,
boss => boss.transform.SetParent(transform));
} }
yield return new WaitForSeconds(1f); yield return new WaitForSeconds(1f);

View File

@ -21,7 +21,7 @@ public class PCInfo : MonoBehaviourSingletonTemplate<PCInfo>
AddrResourceMgr.Ins.Set_AddressableReleaseSelf(pc.gameObject); AddrResourceMgr.Ins.Set_AddressableReleaseSelf(pc.gameObject);
pc.Set(_IsEnemy, null, sdata, pcid, true); pc.Set(_IsEnemy, null, sdata, pcid, true);
pc.Set_MyPet(null); pc.Set_MyPet(null);
(pc as PCActor).StartCam(pos => LoadMapMgr.Ins.Get_PortalPos(MyValue.MyChoiceMapData, portalpos =>
{ {
// Pets -> 2024. 9. 21 펫은 한 마리로 변경 // Pets -> 2024. 9. 21 펫은 한 마리로 변경
dic_petbattle_deadcount[_IsEnemy][0] = dic_petbattle_deadcount[_IsEnemy][1] = 0; dic_petbattle_deadcount[_IsEnemy][0] = dic_petbattle_deadcount[_IsEnemy][1] = 0;
@ -31,29 +31,6 @@ public class PCInfo : MonoBehaviourSingletonTemplate<PCInfo>
ActorInfo.Ins.Add_Actor(pc, _IsEnemy ? eRole.EnemyPC : eRole.PC, 0, costumetable.s_Prefab); ActorInfo.Ins.Add_Actor(pc, _IsEnemy ? eRole.EnemyPC : eRole.PC, 0, costumetable.s_Prefab);
} }
}); });
//// Fairy
//var fairyid = sdata.Get_EqiupmentEquip(eItem.Fairy);
//if (fairyid > 0)
//{
// if (!dic_fairy[_IsEnemy].ContainsKey(fairyid))
// {
// var table = table_fairy.Ins.Get_Data(fairyid);
// var fairy = DSUtil.Get_Clone<Actor>(Get_ModelPrefabPath(eItem.Fairy, table.Prefab), transform, null, table.Scale * Vector3.one);
// dic_fairy[_IsEnemy].Add(fairyid, fairy);
// }
// dic_fairy[_IsEnemy][fairyid].Set(_IsEnemy, sdata, fairyid, true);
//}
//// 전투 NPC
//for (int i = 0; i < list_BattleNPC[_IsEnemy].Count; i++)
//{
// if (list_BattleNPC[_IsEnemy][i].IsActiveNPC())
// {
// dic_actor[_IsEnemy].Add(list_BattleNPC[_IsEnemy][i]);
// list_BattleNPC[_IsEnemy][i].Set(false, sdata, 0, true);
// }
//}
} }
public void Make_Pet(bool _IsEnemy, ServerData sdata, Actor pc) public void Make_Pet(bool _IsEnemy, ServerData sdata, Actor pc)
{ {

View File

@ -55,9 +55,8 @@ public class RealCamera : MyCoroutine
} }
public bool IsEnter() { return CamStatus == 0; } public bool IsEnter() { return CamStatus == 0; }
public void Set_Target(Transform _target, float _camrot) public void Set_Target(Transform _target)
{ {
CamStatus = 0;
target = _target; target = _target;
isTarget = target; isTarget = target;
if (isTarget) if (isTarget)
@ -65,6 +64,11 @@ public class RealCamera : MyCoroutine
m_Target = target.GetComponent<Actor>(); m_Target = target.GetComponent<Actor>();
Add_CamActionTarget(_target); Add_CamActionTarget(_target);
} }
}
public void Set_Target(Transform _target, float _camrot)
{
Set_Target(_target);
CamStatus = 0;
rotateAround = _camrot; rotateAround = _camrot;
Set_DistanceUp(false); Set_DistanceUp(false);
VerticalAxis = maxDistance = OrimaxDistance; VerticalAxis = maxDistance = OrimaxDistance;