public void Reset() { m_ActiveActions.Clear(); // Stop = false; MotionType = E_MotionType.None; WeaponState = E_WeaponState.NotInHands; WeaponToSelect = E_WeaponType.None; Speed = 0; Health = MaxHealth; Rage = RageMin; Dodge = DodgeMin; Fear = FearMin; IdleTimer = 0; MoveDir = Vector3.zero; DesiredPosition = Vector3.zero; DesiredDirection = Vector3.zero; InteractionObject = null; Interaction = E_InteractionType.None; DesiredAnimation = ""; DesiredTarget = null; DesiredAttackType = E_AttackType.None; DontUpdate = false; }
public override string GetIdleActionAnim(E_WeaponType weapon, E_WeaponState weaponState) { if (weapon == E_WeaponType.Katana) { return("idleTaunt"); } return("idle"); }
// Use this for initialization void Start() { m_Animator = GetComponent <Animator>(); m_Collider = GetComponent <Collider>(); m_Rigidbody = GetComponent <Rigidbody>(); m_AudioSource = GetComponent <AudioSource>(); m_WeaponContainer = transform.parent; m_WeaponState = E_WeaponState.HOLDED; }
public override string GetIdleAnim(E_WeaponType weapon, E_WeaponState weaponState) { if (weaponState == E_WeaponState.NotInHands) { return("idle"); } return("idleSword"); }
public override string GetIdleActionAnim(E_WeaponType weapon, E_WeaponState weaponState) { Debug.LogError("unssupported !!"); if (weapon == E_WeaponType.Katana) { return("idleTount"); } return("idle"); }
private void StartComingBack() { // apply rotation speed StopCoroutine("Rotate"); StartCoroutine("Rotate"); m_Rigidbody.velocity = Vector3.zero; m_Rigidbody.angularVelocity = Vector3.zero; m_Rigidbody.isKinematic = true; m_Rigidbody.useGravity = false; //deactivate animator m_Animator.enabled = false; m_WeaponState = E_WeaponState.COMING_BACK; WeaponAudio.WooshLoopData.SetToAudioSource(ref m_AudioSource); m_AudioSource.Play(); }
private void OnCollisionEnter(Collision collision) { if (m_WeaponState == E_WeaponState.THROWING) { m_Rigidbody.isKinematic = true; m_WeaponState = E_WeaponState.LANDED; StopCoroutine("Rotate"); StopCoroutine("FallingDelayed"); WeaponAudio.ImpactData.SetToAudioSource(ref m_AudioSource); m_AudioSource.Play(); } else { GoToIdle(); } }
private void OnGettingBack() { StopCoroutine("RotateToNormalPos"); transform.position = m_WeaponContainer.transform.position; transform.rotation = m_WeaponContainer.transform.rotation; SafeSetParent(m_WeaponContainer.transform); // apply velocity m_Rigidbody.isKinematic = true; //deactivate animator m_Animator.enabled = true; m_WeaponState = E_WeaponState.HOLDED; WeaponAudio.GettingBackData.SetToAudioSource(ref m_AudioSource); m_AudioSource.Play(); }
public void StartRangeAttack() { // remove from parent transform.parent = null; transform.forward = Vector3.up; // apply rotation speed StartCoroutine("Rotate"); StartCoroutine("FallingDelayed"); // apply velocity m_Rigidbody.velocity = Camera.main.transform.forward * ThrowSpeed; m_Rigidbody.isKinematic = false; //deactivate animator m_Animator.enabled = false; m_WeaponState = E_WeaponState.THROWING; WeaponAudio.WooshLoopData.SetToAudioSource(ref m_AudioSource); m_AudioSource.Play(); }
public override string GetRollAnim(E_WeaponType weapon, E_WeaponState weaponState) { return(null); }
public override string GetMoveAnim(E_MotionType motion, E_MoveType move, E_WeaponType weapon, E_WeaponState weaponState) { return("walk"); }
public override string GetIdleActionAnim(E_WeaponType weapon, E_WeaponState weaponState) { return("tount"); }
public override string GetIdleAnim(E_WeaponType weapon, E_WeaponState weaponState) { return("idle"); }
public abstract string GetRollAnim(E_WeaponType weapon, E_WeaponState weaponState);
public override string GetMoveAnim(E_MotionType motion, E_MoveType move, E_WeaponType weapon, E_WeaponState weaponState) { if (E_WeaponState.NotInHands == weaponState) { if (E_MotionType.Walk == motion) { return("walk"); } return("run"); } if (E_MotionType.Walk == motion) { return("walkSword"); } return("runSword"); }
/// <summary> /// Gets the idle animation. /// 获取Idle动画名字,普通Idle,拿各种武器的Idle /// </summary> /// <returns>The idle animation name.</returns> public abstract string GetIdleAnim(E_WeaponType _weaponType, E_WeaponState _weaponState);
public override string GetMoveAnim(E_MotionType motion, E_MoveType move, E_WeaponType weapon, E_WeaponState weaponState) { if (weaponState == E_WeaponState.NotInHands) { if (motion != E_MotionType.Walk) { return("run"); } else { return("walk"); } } if (motion != E_MotionType.Walk) { return("runSword"); } return("walkSword"); }
public override string GetRollAnim(E_WeaponType weapon, E_WeaponState weaponState) { return("evadeSword"); }
public override string GetMoveAnim(E_MotionType motion, E_MoveType move, E_WeaponType weapon, E_WeaponState weaponState) { if (weaponState == E_WeaponState.NotInHands) { return("walk"); } else { if (motion == E_MotionType.Walk) { if (move == E_MoveType.Forward) { return("combatMoveF"); } else if (move == E_MoveType.Backward) { return("combatMoveB"); } else if (move == E_MoveType.StrafeRight) { return("combatMoveR"); } else { return("combatMoveL"); } } else { if (move == E_MoveType.Forward) { return("combatRunF"); } else if (move == E_MoveType.Backward) { return("combatRunB"); } } } return("idle"); }
public abstract string GetIdleActionAnim(E_WeaponType weapon, E_WeaponState weaponState);
public override string GetIdleAnim(E_WeaponType weapon, E_WeaponState weaponState) { throw new NotImplementedException(); }
public abstract string GetMoveAnim(E_MotionType motion, E_MoveType move, E_WeaponType weapon, E_WeaponState weaponState);