Exemple #1
0
 protected override void init()
 {
     character = new ZakoFar();
     genDamge = new GeneralDamage();
     animToState["dmg_1"] = genDamge;
     animToState["dmg_2"] = genDamge;
     Sound sound;
     for (int i = 0; i < soundLists.Count; i++) {
         sound = soundLists[i];
         if (animToState.ContainsKey(sound.animName)) animToState[sound.animName].SetAudioClip(sound.audioClip);
         else Debug.LogError("SoundLists中声音文件动画名找不到对应动画!");
     }
     for (int i = 0; i < m_behaviors.Count; i++)
     {
         if (animToState.ContainsKey(m_behaviors[i].animName))
             animToState[m_behaviors[i].animName].animCurve = m_behaviors[i].curve;
         else if (m_behaviors[i].animName == "")
         {
             Debug.LogError("动画名不能为空");
         }
         else Debug.LogError("动画名" + m_behaviors[i].animName + "不存在");
     }
     transform.localScale = Vector3.right * transform.localScale.x * -character.xDirection + Vector3.one - Vector3.right;
     base.init();
 }
Exemple #2
0
 protected override void init()
 {
     character = new ZakoFar();
     for (int i = 0; i < m_behaviors.Count; i++)
     {
         if (animToState.ContainsKey(m_behaviors[i].animName))
             animToState[m_behaviors[i].animName].animCurve = m_behaviors[i].curve;
         else if (m_behaviors[i].animName == "")
         {
             Debug.LogError("动画名不能为空");
         }
         else Debug.LogError("动画名" + m_behaviors[i].animName + "不存在");
     }
     character.xDirection = Global.GlobalValue.XDIRECTION_RIGHT;
     transform.localScale = Vector3.right * transform.localScale.x * -character.xDirection + Vector3.one - Vector3.right;
     base.init();
 }