예제 #1
0
 protected override void init()
 {
     character = new SpiderQueen();
     genDamge = new Model.Behavior.EnemyBehavior.GeneralDamage();
     //受伤动画如果没有不同的位移的话,就用同一个
     animToState["damage"] = genDamge;
     animToState["damage2"] = 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 + "不存在");
     }
     character.xDirection = Global.GlobalValue.XDIRECTION_RIGHT;
     transform.localScale = Vector3.right * transform.localScale.x * -character.xDirection + Vector3.one - Vector3.right;
     base.init();
 }
예제 #2
0
 protected override void init()
 {
     character = new SpiderQueen();
     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();
 }