예제 #1
0
        private void TryGenerateNPCs()
        {
            foreach (var pair in Npcs)
            {
                var info = pair.Value;
                if (info.IsEmpty)
                {
                    NpcData targetData = null;
                    foreach (NpcData data in resourceService.npcList.Shuffled())
                    {
                        if (UnityEngine.Random.value < data.prob)
                        {
                            targetData = data;
                            break;
                        }
                    }
                    if (targetData != null)
                    {
                        info.SetNpc(targetData);
                        RavenhillEvents.OnNpcCreated(pair.Key, pair.Value);
                    }
                }
            }

            if (ravenhillGameModeService.gameModeName == GameModeName.map)
            {
                CreateMapNpcs();
            }
        }