Esempio n. 1
0
        public override float[] GetWorldValues()
        {
            List <float> values = new List <float>();

            for (int i = 0; i < faceVals.GetLength(0); i++)
            {
                String key = faceVals[i, 0];
                if (targetMorph.Contains(key))
                {
                    values.Add(targetMorph.BlendValues[(int)targetMorph.hash[key]]);
                }
            }
            return(values.ToArray());
        }
        private void Update()
        {
            if (!Enum.IsDefined(typeof(TargetLevel), level))
            {
                return;
            }

            Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);

            if (maid != null && maid.body0.Face.morph != null)
            {
                foreach (ShapeKeyNode shapeKeyNode in xmlManager.shapeKeyNodeList)
                {
                    int   h;
                    bool  c;
                    float f = maid.body0.Face.morph.BlendValues[(int)maid.body0.Face.morph.hash[shapeKeyNode.baseTags]];

                    for (int j = 0; j < maid.body0.goSlot.Count; j++)
                    {
                        TMorph morph = maid.body0.goSlot[j].morph;
                        if (morph != null)
                        {
                            c = false;
                            if (morph.Contains(shapeKeyNode.propTag))
                            {
                                h = (int)maid.body0.goSlot[j].morph.hash[shapeKeyNode.propTag];
                                maid.body0.goSlot[j].morph.BlendValues[h] = f * shapeKeyNode.propRatio;
                                c = true;
                            }
                            if (c)
                            {
                                maid.body0.goSlot[j].morph.FixBlendValues();
                            }
                        }
                    }
                }
            }
        }