Exemplo n.º 1
0
        void CreateDefaultPreset(VrmLib.ExpressionPreset preset)
        {
            var clip = GetClip(new ExpressionKey(preset));

            if (clip != null)
            {
                return;
            }
            clip                = ScriptableObject.CreateInstance <VRM10Expression>();
            clip.name           = preset.ToString();
            clip.ExpressionName = preset.ToString();
            clip.Preset         = preset;
            Clips.Add(clip);
        }
Exemplo n.º 2
0
        public ExpressionKey(VrmLib.ExpressionPreset preset, string customName = null)
        {
            Preset       = preset;
            m_customName = customName;

            if (Preset != VrmLib.ExpressionPreset.Custom)
            {
                if (m_presetNameDictionary.ContainsKey((Preset)))
                {
                    m_id = m_presetNameDictionary[Preset];
                }
                else
                {
                    m_presetNameDictionary.Add(Preset, Preset.ToString());
                    m_id = m_presetNameDictionary[Preset];
                }
            }
            else
            {
                if (string.IsNullOrEmpty(m_customName))
                {
                    throw new ArgumentException("name is required for VrmLib.ExpressionPreset.Custom");
                }
                m_id = UnknownPresetPrefix + m_customName;
            }
        }