Beispiel #1
0
 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;
     }
 }
Beispiel #2
0
 private void Awake()
 {
     GlobalDataManager.metaConfig = ConfigUtil.LoadConfig <ConfigMetaConfig>("Common/MetaConfig");
     TouchPatternData.ReloadFromFile();
 }