Ejemplo n.º 1
0
 public void PrepareFaceAnmation(string name)
 {
     if (!string.IsNullOrEmpty(name) && this._frameInfoDict.ContainsKey(name))
     {
         this._curFrameInfo = this._frameInfoDict[name];
         this._timer        = 0f;
         this._playing      = false;
     }
 }
Ejemplo n.º 2
0
 public void PlayFaceAnimation(string name, FaceAnimationPlayMode mode = 0)
 {
     if (!string.IsNullOrEmpty(name) && this._frameInfoDict.ContainsKey(name))
     {
         this._curFrameInfo = this._frameInfoDict[name];
         this._timer        = 0f;
         this._playing      = true;
         this._playMode     = mode;
     }
 }
Ejemplo n.º 3
0
        private void BuildAnimationFrameInfo(ConfigFaceAnimation config)
        {
            this._frameInfoDict.Clear();
            int index  = 0;
            int length = config.items.Length;

            while (index < length)
            {
                FaceAnimationFrameInfo info = new FaceAnimationFrameInfo {
                    name           = config.items[index].name,
                    length         = config.items[index].length,
                    timePerFrame   = config.items[index].timePerFrame,
                    leftEyeFrames  = this.GetFrameInfoFromBlocks(config.items[index].leftEyeBlocks, config.items[index].length, this._leftEye.GetFrameNames()),
                    rightEyeFrames = this.GetFrameInfoFromBlocks(config.items[index].rightEyeBlocks, config.items[index].length, this._rightEye.GetFrameNames()),
                    mouthFrames    = this.GetFrameInfoFromBlocks(config.items[index].mouthBlocks, config.items[index].length, this._mouth.GetFrameNames())
                };
                this._frameInfoDict[info.name] = info;
                index++;
            }
            if ((this._curFrameInfo != null) && this._frameInfoDict.ContainsKey(this._curFrameInfo.name))
            {
                this._curFrameInfo = this._frameInfoDict[this._curFrameInfo.name];
            }
        }