コード例 #1
0
        public VoiceLineInstance(STUVoiceLineInstance instance)
        {
            STU = instance;

            if (instance.m_AF226247 != null)
            {
                var voiceSounds = new List <ulong>();
                foreach (var soundFile in new[] {
                    instance.m_AF226247.m_1485B834, instance.m_AF226247.m_798027DE,
                    instance.m_AF226247.m_A84AA2B5, instance.m_AF226247.m_D872E45C
                })
                {
                    if (soundFile != null)
                    {
                        voiceSounds.Add(soundFile.m_3C099E86);
                    }
                }

                VoiceSounds = voiceSounds.ToArray();
            }

            if (instance.m_voiceLineRuntime != null)
            {
                if (instance.m_voiceLineRuntime.m_voiceConversation != null)
                {
                    VoiceConversation = instance.m_voiceLineRuntime.m_voiceConversation;
                }

                if (instance.m_voiceLineRuntime.m_criteria != null)
                {
                    Conditions = instance.m_voiceLineRuntime.m_criteria;
                }
            }
        }
コード例 #2
0
        private void Init(STUVoiceSet voiceSet)
        {
            if (voiceSet.m_voiceLineInstances == null)
            {
                return;
            }
            VoiceLines = new Dictionary <ulong, VoiceLineInstance>(voiceSet.m_voiceLineInstances.Length);
            Stimuli    = new Dictionary <ulong, HashSet <ulong> >();

            for (int i = 0; i < voiceSet.m_voiceLineInstances.Length; i++)
            {
                ulong voiceLineGuid           = voiceSet.m_voiceLineGuids[i];
                STUVoiceLineInstance instance = voiceSet.m_voiceLineInstances[i];

                VoiceLineInstance instanceModel = new VoiceLineInstance(instance);

                VoiceLines[voiceLineGuid] = instanceModel;

                if (instance.m_voiceLineRuntime != null)
                {
                    ulong stimuli = instance.m_voiceLineRuntime.m_stimulus;
                    if (stimuli != 0)
                    {
                        if (!Stimuli.ContainsKey(stimuli))
                        {
                            Stimuli[stimuli] = new HashSet <ulong>();
                        }

                        Stimuli[stimuli].Add(voiceLineGuid);
                    }
                }
            }
        }