| | |
| | | {
|
| | | static readonly Vector3 PlayerBornPosition1 = new Vector3(19.401f, 4.985f, 5.494f);
|
| | |
|
| | | static List<Vector3> s_NpcPositions = new List<Vector3>();
|
| | | static List<int> s_RandomIndexs = new List<int>();
|
| | |
|
| | | static readonly int s_EnemyNpcId = 40208005;
|
| | |
|
| | |
| | | {
|
| | | base.Initialize();
|
| | |
|
| | | s_NpcPositions.Clear();
|
| | | s_RandomIndexs.Clear();
|
| | | s_Sid2NpcIds.Clear();
|
| | | s_CollectNpcs.Clear();
|
| | | s_Sid2NpcIndexs.Clear();
|
| | |
| | | void InitializeNpc()
|
| | | {
|
| | | var config = ScriptableObjectLoader.LoadSoHazyMapNpc(ClientDungeonStageUtility.clientMapId);
|
| | | s_NpcPositions.AddRange(config.GetNpcPositions());
|
| | | var positions = config.GetNpcPositions();
|
| | |
|
| | | s_RandomIndexs.Clear();
|
| | | for (int i = 0; i < positions.Count; i++)
|
| | | {
|
| | | s_RandomIndexs.Add(i);
|
| | | }
|
| | |
|
| | | var mapId = model.GetGrassMapId(hazyRegionModel.processingIncidentId);
|
| | | var npcInfos = model.GetGrassNpcInfos(mapId);
|
| | |
| | | continue;
|
| | | }
|
| | |
|
| | | hasInitializedNpc = true;
|
| | |
|
| | | for (int j = 0; j < count; j++)
|
| | | {
|
| | | var index = -1;
|
| | |
| | | if (jsonInfoIndex != -1)
|
| | | {
|
| | | index = npcJsonDatas[jsonInfoIndex].index;
|
| | | npcJsonDatas.RemoveAt(jsonInfoIndex);
|
| | | }
|
| | | if (index == -1)
|
| | | {
|
| | | break;
|
| | | }
|
| | | InitializeNpc(npcId, index);
|
| | |
|
| | | s_RandomIndexs.Remove(index);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | for (int j = 0; j < count; j++)
|
| | | {
|
| | | var index = UnityEngine.Random.Range(0, s_NpcPositions.Count);
|
| | | InitializeNpc(npcId, index);
|
| | | var index = UnityEngine.Random.Range(0, s_RandomIndexs.Count);
|
| | | InitializeNpc(npcId, s_RandomIndexs[index]);
|
| | |
|
| | | hasInitializedNpc = true;
|
| | | s_RandomIndexs.RemoveAt(index);
|
| | | }
|
| | | }
|
| | |
|
| | | if (hasInitializedNpc)
|
| | | {
|
| | | var positions = config.GetNpcPositions();
|
| | | var enemyPosition = positions[UnityEngine.Random.Range(0, positions.Count)];
|
| | |
|
| | | if (ClientDungeonStageUtility.clientMapId == HazyGrassModel.FAIRY_CLIENTDATAMAP)
|
| | |
| | |
|
| | | void InitializeNpc(int npcId, int index)
|
| | | {
|
| | | var position = s_NpcPositions[index];
|
| | | hasInitializedNpc = true;
|
| | |
|
| | | var config = ScriptableObjectLoader.LoadSoHazyMapNpc(ClientDungeonStageUtility.clientMapId);
|
| | | var positions = config.GetNpcPositions();
|
| | |
|
| | | var position = positions[index];
|
| | |
|
| | | GA_NpcClientCollect _npc = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientCollect>((uint)npcId,
|
| | | E_ActorGroup.FuncNpc);
|
| | |
| | | {
|
| | | s_NpcCounts[npcId] += 1;
|
| | | }
|
| | |
|
| | | s_NpcPositions.RemoveAt(index);
|
| | |
|
| | | localNpcJsons.Add(new NpcJsonInfo()
|
| | | {
|