Project_WL/Assets/Script/Info/PCInfo.cs

147 lines
6.7 KiB
C#
Raw Normal View History

2024-12-15 01:39:39 +00:00
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.ResourceManagement.AsyncOperations;
public class PCInfo : MonoBehaviourSingletonTemplate<PCInfo>
{
public void Make_Actors(bool _IsEnemy, ServerData sdata)
2024-12-15 01:39:39 +00:00
{
var curMapData = MyValue.MyChoiceMapData;
// PC
var pcid = sdata.Get_EqiupmentEquip(eItem.PC);
var pctable = table_classconfig.Ins.Get_Data_orNull(pcid);
var costumeid = sdata.Get_EqiupmentEquip(eItem.PCCostume);
var costumetable = table_costumelist.Ins.Get_Data_orNull(costumeid);
AddrResourceMgr.Ins.LoadObject<GameObject>($"Assets/Res_Addr/PC/{WL.Character.WLCharacterSwapSettings.Resolve(costumetable.s_Prefab)}.prefab", handle =>
2024-12-15 01:39:39 +00:00
{
if (handle.IsDone && handle.Status == AsyncOperationStatus.Succeeded)
{
var pc = DSUtil.Get_Clone<Actor>(handle.Result, transform);
AddrResourceMgr.Ins.Set_AddressableReleaseSelf(pc.gameObject);
pc.Set(_IsEnemy, null, sdata, pcid, true);
pc.Set_MyPet(null);
LoadMapMgr.Ins.Get_PortalPos(MyValue.MyChoiceMapData, portalpos =>
{
// Pets -> 2024. 9. 21 펫은 한 마리로 변경
dic_petbattle_deadcount[_IsEnemy][0] = dic_petbattle_deadcount[_IsEnemy][1] = 0;
Make_Pet(_IsEnemy, sdata, pc); // 펫 생성
Make_Worker(sdata, pc); // 일꾼 생성
});
ActorInfo.Ins.Add_Actor(pc, _IsEnemy ? eRole.EnemyPC : eRole.PC, 0, costumetable.s_Prefab);
2024-12-15 01:39:39 +00:00
}
});
}
public void Make_Pet(bool _IsEnemy, ServerData sdata, Actor pc)
{
var petlist = ActorInfo.Ins.Get_Actors(_IsEnemy ? eRole.EnemyPet : eRole.Pet);
petlist.ForEach(f => f.Off());
WL 리뉴얼 세션 2026-09-06~07 (#760~#800) — 전투·배경·UI·타격감 (조직 PD 로그 #746~#800 · 대화로그 §14~§24) - 전투: Knight@Attack1~3_S 3콤보(4 컨트롤러·클래스별 서브클립) · 타겟팅 4규칙(정면 우선·재타겟·즉시 공격·어그로 금지 · WLTargetingSettings) · 대쉬 후 공격(Stander@Chase_Start · DashDriver · 5 m · 사정거리+0.8 · 근거리 적 우선) · 공격 이동 FrameTable(발 접지 실측 표 · AttackRootMotion) · 충돌 반경/투사체 0.3 배(WLCollisionTuning) · 무적(임시)·펫 금지(WLGameplaySettings) - 검기: NamuFX Slash_B 배리언트 Effect_WLSwingArc 원 피팅 정합 배치 + 캘리브레이션(SlashArcMeasure · SlashTrailSettings) · 찌르기 Effect_WLStab 대기 · 램프 리본(BladeTrail · WL_BladeRibbon.shader · T_WL_BladeRibbonRamp) 보존(drawRibbon 0) - 타격감: Assets/WL/Feel(WLHitFeel · 히트스톱 0.03 · 셰이크 0.10 m · 몹 펀치 1.12 · Actor.Get_Damage 훅 1줄 · 원본 RealCamera 셰이크 결함 대체) - 배경/맵: LMHPOLY Demo_01~10 → WL_Nature01~10(프리팹·씬·NavMesh·스포너·BattleMapConfig) · 물(ToonWaterU) · 포스트 블룸 0.9/0.3 · 잔디(BruteForce·드레싱) 제거 · 마젠타 머티리얼 URP 변환 - UI: 세로 HUD(WL_HUD · 하단 5메뉴 폭 전체 · 채팅/전투 패드 숨김 · WLIngameUiOverride) · Title/TitleInfo 1080×1920 Expand + 배경 높이 fit(WLBackgroundFit) · 로딩 SortOrder_5(WLRawImageAspectSync · 초점표 8장) · Loading1~8 ASTC 6×6 - 도구: AgentScripts/*(LightProbe · WL_MapSwitch · WL760~WL800 프로브/집행/검증 · 상단 사용법 주석) · 에디터 락 프로토콜 파일(staging) - 제외(별도 커밋 예정): Assets/LMHPOLY(703 MB) · Assets/Feel(422 MB) · Assets/Shinabro(300 MB) — 에셋 스토어/구 WL 팩 원본 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-06 23:24:25 +00:00
// PD 지시 #763 (2026-09-06) "내가 지시할때까지 플레이어의 펫은 등장시키지 마."
// · 값은 코드 상수가 아니라 WLGameplaySettings 에셋에서 읽는다(C45). 다시 등장시킬 때는 에셋 체크박스만 켠다.
// · 적 펫(_IsEnemy = PvP·투견장 상대)은 건드리지 않는다.
// · 진입 경로는 여기 한 곳뿐이다 — Make_Actors(맵 진입) 와 PetUI.OnClick_Back(펫 교체) 모두 이 함수를 탄다.
// · 펫 미보유 계정과 완전히 같은 상태(펫 카드 Empty · Get_MyPet() null)를 만든다.
if (!_IsEnemy && !WL.Settings.WLGameplaySettings.SpawnPlayerPet)
{
if (!DSUtil.CheckNull(pc)) pc.Set_MyPet(null);
if (NewGameUI.isIns && NewGameUI.Ins.arr_PetCard != null && NewGameUI.Ins.arr_PetCard.Length > 0)
NewGameUI.Ins.arr_PetCard[0].Set_Empty();
return;
}
2024-12-15 01:39:39 +00:00
var pets = sdata.Get_EqiupmentEquip(eItem.Pet);
//for (int i = 0; i < pets.Count; i++)
{
if (pets > 0)
{
++dic_petbattle_deadcount[_IsEnemy][0];
var pettable = table_petlist.Ins.Get_Data_orNull(pets);
AddrResourceMgr.Ins.LoadObject<GameObject>(pettable.s_PetPrefab, handle =>
{
var pet = DSUtil.Get_Clone<Actor>(handle.Result, transform, null, pettable.f_Scale * Vector3.one);
AddrResourceMgr.Ins.Set_AddressableReleaseSelf(pet.gameObject);
ActorInfo.Ins.Add_Actor(pet, eRole.Pet, 0, pettable.s_PetPrefab);
pet.Set(_IsEnemy, pc, sdata, pets, true);
pet.Set_Card(0, 0);
pc.Set_MyPet(pet);
});
}
else
NewGameUI.Ins.arr_PetCard[0].Set_Empty();
}
}
public void Make_Worker(ServerData sdata, Actor pc)
{
var workerid = sdata.Get_EqiupmentEquip(eItem.Worker);
if (workerid > 0)
{
var workerData = table_worker.Ins.Get_Data_orNull(workerid);
AddrResourceMgr.Ins.LoadObject<GameObject>($"Assets/Res_Addr/Worker/{workerData.s_Prefab}.prefab", handle =>
{
var worker = DSUtil.Get_Clone<Actor>(handle.Result, transform, null, workerData.f_Scale * Vector3.one);
ActorInfo.Ins.Add_Actor(worker, eRole.Worker, 0, "");
AddrResourceMgr.Ins.Set_AddressableReleaseSelf(worker.gameObject);
worker.Set(false, pc, sdata, workerid, false);
});
}
}
2024-12-15 01:39:39 +00:00
public void Make_Farmer(int _id)
{
if (_id > 0)
{
Off_Farmer(_id);
//var farmerdata = table_farmer.Ins.Get_Data(_id);
//if (!dic_farmer.ContainsKey(_id))
//{
// var farmer = DSUtil.Get_Clone<FarmerActor>(DSUtil.Format("PC/Farm/{0}", farmerdata.Prefab), transform);
// dic_farmer.Add(_id, farmer);
//}
//dic_farmer[_id].Set(farmerdata, MyValue.MyPC.Get_position() + Random.insideUnitSphere);
}
}
public void Off_Farmer(int _id)
{
//if (dic_farmer.ContainsKey(_id))
// dic_farmer[_id].Off();
}
public void ReSet_Farmer()
{
//foreach (var item in dic_farmer)
// item.Value.ReSet();
}
//public void Set_QuestMobTarget(Actor _target)
//{ // NPC 구하기 퀘스트 시작
// dic_actor[false].ForEach(f => f.Change_Target(false, _target));
// dic_actor[false].ForEach(f => f.Add_FindEnemy(eRole.QuestMob));
// SaveNPCMgr.Ins.Get_QuestMobs().ForEach(f => f.Add_FindEnemy(eRole.PC)); // 타겟 찾기 시작
//}
//public void Add_FindTarget_AllPC(bool _IsEnemy, eRole _role, int _group = 0)
//{
// foreach (var item in dic_pc[_IsEnemy]) item.Value.Add_FindEnemy(_role, _group);
// foreach (var item in dic_pet[_IsEnemy]) item.Value.ForEach(f => f.Add_FindEnemy(_role, _group));
// list_Summon[_IsEnemy].ForEach(f => f.Add_FindEnemy(_role, _group));
//}
//public void Set_AllTarget(bool _IsEnemy, bool _find)
//{
// foreach (var item in dic_pc[_IsEnemy]) item.Value.Set_AllEnenmy(_find);
// foreach (var item in dic_pet[_IsEnemy]) item.Value.ForEach(f => f.Set_AllEnenmy(_find));
// list_Summon[_IsEnemy].ForEach(f => f.Set_AllEnenmy(_find));
//}
#region
Dictionary<bool, List<int>> dic_petbattle_deadcount = new Dictionary<bool, List<int>> { { false, new List<int> { 0, 0 } }, { true, new List<int> { 0, 0 } } };
public void PetBattle_AddDead(bool isenemy)
{
dic_petbattle_deadcount[isenemy][1]++;
if (dic_petbattle_deadcount[isenemy][0] == dic_petbattle_deadcount[isenemy][1])
{
ActorInfo.Ins.All_Stop(true);
InGameInfo.Ins.PetBattleResult(isenemy);
}
}
#endregion
}