private float baseMoveSpeed = 5;// 这个应该从配置表里读

        public void Awake()
        {
            unit = GetParent <Unit>();
#if !SERVER
            animatorComponent = unit.GetComponent <AnimatorComponent>();
#endif
        }
예제 #2
0
        public void Awake()
        {
            this.mapMask               = LayerMask.GetMask("Map");
            roler                      = this.GetParent <Unit>().GameObject;
            animatorComponent          = this.GetParent <Unit>().GetComponent <AnimatorComponent>();
            animatorComponent.Animator = this.GameObject.GetComponent <Animator>();

            Debug.Log(" TranslateComponent-55: " + mapMask);
        }
예제 #3
0
 public void Awake()
 {
     this.animatorComponent = this.Entity.GetComponent <AnimatorComponent>();
 }
예제 #4
0
 public void Awake()
 {
     this.mainSpeed         = this.AddSpeed(new Vector3());
     this.animatorComponent = this.Entity.GetComponent <AnimatorComponent>();
 }
예제 #5
0
        static void AnimSet(this AnimatorComponent self, string moveState, float h, float v)
        {
            switch (moveState)
            {
            case "Move":        //播放行走动画
                self.Animator.SetBool("Move", true);
                self.Animator.SetFloat("Vblend", v);
                self.Animator.SetFloat("Hblend", h);
                self.Animator.SetBool("Attack", false);
                //Debug.Log(" move:v" + v);
                break;

            case "Walk":        //播放行走动画
                self.Animator.SetBool("Move", true);
                self.Animator.SetFloat("Vblend", -1f);
                self.Animator.SetFloat("Hblend", 0);
                self.Animator.SetBool("Attack", false);
                break;

            case "Run":         //播放追击动画
                self.Animator.SetBool("Move", true);
                self.Animator.SetFloat("Vblend", 1f);
                self.Animator.SetFloat("Hblend", 0);
                self.Animator.SetBool("Attack", false);
                break;

            case "Attack":      //播放攻击动画
                self.Animator.SetBool("Attack", true);
                self.Animator.SetBool("Move", false);
                break;

            case "Idle":        //播放休息动画
                self.Animator.SetBool("Move", false);
                self.Animator.SetBool("Attack", false);
                break;

            case "Die":         //播放死亡动画
                self.Animator.SetTrigger("Die");
                self.Animator.SetBool("Attack", false);
                self.Animator.SetBool("Move", false);
                break;

            case "Jump":        //播放跳跃动画
                self.Animator.SetTrigger("Jump");
                break;

            case "Hit":        //播放挨打动画
                self.Animator.SetTrigger("Hit");
                break;

            case "SkillOne":        //播放攻击特效1动画
                self.Animator.SetTrigger("SkillOne");
                break;

            case "SkillTwo":        //播放攻击特效1动画
                self.Animator.SetTrigger("SkillTwo");
                break;

            case "SkillThree":      //播放攻击特效1动画
                self.Animator.SetTrigger("SkillThree");
                break;

            case "SkillZero":      //播放基本攻击动画
                self.Animator.SetTrigger("SkillZero");
                break;
            }
        }
예제 #6
0
 public static void AnimSet(this AnimatorComponent self, float h, float v)
 {
     self.AnimSet("Move", h, v);
 }
예제 #7
0
 public static void AnimSet(this AnimatorComponent self, string moveState)
 {
     self.AnimSet(moveState, 0, 0);
 }