public override void OnStart() { // m_SkeletonAnimation.state.Complete += HandleComplete; // m_SkeletonAnimation.ClearState(); switch (animationName) { case BDAnimation.Idle: m_RoleAnimation.Idle(); break; case BDAnimation.Move: m_RoleAnimation.Move(); break; // case BDAnimation.Attack: // m_SkeletonAnimation.state.SetAnimation(0, m_AniName_Attack, false); // break; // case BDAnimation.Death: // // m_SkeletonAnimation.state.SetAnimation(0, m_AniName_PostRollingAttack, false); // m_SkeletonAnimation.state.SetAnimation(0, m_AniName_PreRollingAttack, false); // m_SkeletonAnimation.state.AddAnimation(0, m_AniName_RollingAttack, true, 0f); // running = true; // break; } }
// vec : the vector of moving rotation public void Move(Vector3 vec) { if (m_CurStatus == RoleStatus.Die) { return; } if (m_CurStatus == RoleStatus.Atked) { return; } if (vec == Vector3.zero) { return; } m_CurStatus = RoleStatus.Move; vec = vec.normalized; this.SetCurVec_Move(vec); vec *= m_MoveVec * m_EffectiveVal; Rigidbody rig = GetComponent <Rigidbody>(); if (rig != null) { rig.MovePosition(transform.position + vec * Time.deltaTime); } else { transform.Translate(vec * Time.deltaTime); } // action if (m_AniMng != null) { m_AniMng.Move(); } // particle if (m_Particle_Dust != null && m_ParticlePos_Dust != null) { if (m_NextDustPlayTime < Time.time) { ParticleManager.instance.CreateParticle( m_Particle_Dust, m_ParticlePos_Dust.position, Vector3.zero); m_NextDustPlayTime = Time.time + m_DustPlayInterval; } } }
public override void OnStart() { m_SkeletonAnimation.state.Complete += HandleComplete; m_SkeletonAnimation.ClearState(); switch (animationName) { case AnimationName.Idle: m_RoleAnimation.Idle(); break; case AnimationName.Move: m_RoleAnimation.Move(); break; case AnimationName.Attack: m_SkeletonAnimation.state.SetAnimation(0, m_AniName_Attack, false); break; case AnimationName.RollingAttack: // m_SkeletonAnimation.state.SetAnimation(0, m_AniName_PostRollingAttack, false); m_SkeletonAnimation.state.SetAnimation(0, m_AniName_PreRollingAttack, false); m_SkeletonAnimation.state.AddAnimation(0, m_AniName_RollingAttack, true, 0f); running = true; break; case AnimationName.SpinAttack: // m_SkeletonAnimation.state.SetAnimation(0, m_AniName_PostSpinAttack, false); m_SkeletonAnimation.state.SetAnimation(0, m_AniName_PreSpinAttack, false); m_SkeletonAnimation.state.AddAnimation(0, m_AniName_SpinAttack, true, 0f); running = true; break; case AnimationName.SpinAttackEnd: m_SkeletonAnimation.state.SetAnimation(0, m_AniName_PostSpinAttack, false); running = true; break; case AnimationName.RollingAttackEnd: m_SkeletonAnimation.state.SetAnimation(0, m_AniName_PostRollingAttack, false); running = true; break; case AnimationName.JustRolling: m_SkeletonAnimation.state.SetAnimation(0, m_AniName_RollingAttack, true); running = false; break; case AnimationName.JustSpin: m_SkeletonAnimation.state.SetAnimation(0, m_AniName_SpinAttack, true); running = false; break; case AnimationName.Death: m_RoleAnimation.Die(); break; } }