コード例 #1
0
ファイル: FaceAnimation.cs プロジェクト: slb1988/agame
 public void Setup(ConfigFaceAnimation config, FacePartControl leftEye, FacePartControl rightEye, FacePartControl mouth)
 {
     this._leftEye  = leftEye;
     this._rightEye = rightEye;
     this._mouth    = mouth;
     this.BuildAnimationFrameInfo(config);
 }
コード例 #2
0
        private void Awake()
        {
            this._faceAnimation = new FaceAnimation();
            ConfigFaceAnimation config = Resources.Load <ConfigFaceAnimation>("FaceAnimation/Mei");

            this.leftEyeControl = new FacePartControl();
            this.leftEyeControl.Init(this.leftEyeProvider, this.leftEye);
            this.rightEyeControl = new FacePartControl();
            this.rightEyeControl.Init(this.rightEyeProvider, this.rightEye);
            this.mouthControl = new FacePartControl();
            this.mouthControl.Init(this.mouthProvider, this.mouth);
            this._faceAnimation.Setup(config, this.leftEyeControl, this.rightEyeControl, this.mouthControl);
        }
コード例 #3
0
ファイル: GalTouchSystem.cs プロジェクト: slb1988/agame
 public void Init(Animator animator, int characterId, int heartLevel, Renderer leftEyeRenderer, Renderer rightEyeRenderer, Renderer mouthRenderer, IFaceMatInfoProvider leftEyeProvider, IFaceMatInfoProvider rightEyeProvider, IFaceMatInfoProvider mouthProvider, Transform headRoot = null)
 {
     if (!this._init)
     {
         this._animator   = animator;
         this._heartLevel = heartLevel;
         string characterName = this.CharacterName(characterId);
         this._touchPatternList = TouchPatternData.GetTouchPatternList(characterName);
         this._itemIndexRecord  = new List <int>(20);
         this._faceAnimation    = new FaceAnimation();
         ConfigFaceAnimation faceAnimation = FaceAnimationData.GetFaceAnimation(characterName);
         FacePartControl     leftEye       = new FacePartControl();
         leftEye.Init(leftEyeProvider, leftEyeRenderer);
         FacePartControl rightEye = new FacePartControl();
         rightEye.Init(rightEyeProvider, rightEyeRenderer);
         FacePartControl mouth = new FacePartControl();
         mouth.Init(mouthProvider, mouthRenderer);
         this._faceAnimation.Setup(faceAnimation, leftEye, rightEye, mouth);
         if (this._faceEffect != null)
         {
             this._faceEffect.Uninit();
             this._faceEffect = null;
         }
         if (headRoot != null)
         {
             GameObject original = Resources.Load <GameObject>("FaceEffect/FFX_" + characterName);
             if (original != null)
             {
                 GameObject     obj3      = UnityEngine.Object.Instantiate <GameObject>(original);
                 MonoFaceEffect component = obj3.GetComponent <MonoFaceEffect>();
                 if (component != null)
                 {
                     this._faceEffect = new FaceEffect();
                     obj3.transform.SetParent(headRoot, false);
                     this._faceEffect.Init(component);
                 }
                 else
                 {
                     UnityEngine.Object.Destroy(obj3);
                 }
             }
         }
         this.enable = false;
         this._init  = true;
     }
 }
コード例 #4
0
ファイル: FaceAnimation.cs プロジェクト: slb1988/agame
        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];
            }
        }
コード例 #5
0
 public void SetupFaceAnimation(ConfigFaceAnimation config)
 {
     this._faceAnimation.Setup(config, this._leftEye, this._rightEye, this._mouth);
     this._config = config;
 }