void SwitchAnimator(E_WEAPONTYPE _Type) { RuntimeAnimatorController anim = FindAnimator(_Type.ToString()); if (anim) { m_Animator.runtimeAnimatorController = anim; } }
public void AttachWeapon(string _WeaponPath, E_WEAPONTYPE _WeaponType) { if (m_RightHandAxis == null) { return; } m_PhotonView.RPC("AttachWeapon_RPC", Photon.Pun.RpcTarget.AllBuffered, _WeaponPath, (int)_WeaponType); }
void SwitchAnimator(E_WEAPONTYPE _Type) { m_WeaponType = _Type; m_AttackSound = SoundManager.Instance.GetPlayerAttackmonetClip(m_WeaponType); RuntimeAnimatorController anim = FindAnimator(_Type.ToString()); if (anim) { StartCoroutine(C_SwitchAnimator(anim)); } }
public void SetPerviewWeapon(string _WeaponPath, E_WEAPONTYPE _WeaponType) { if (m_AttachRightHandPoint.childCount > 0) { for (int i = 0; i < m_AttachRightHandPoint.childCount; ++i) { Destroy(m_AttachRightHandPoint.GetChild(i).gameObject); } } if (_WeaponPath != "") { GameObject weapon = Instantiate(Resources.Load <GameObject>(_WeaponPath)); if (weapon) { weapon.transform.SetParent(m_AttachRightHandPoint); weapon.transform.localPosition = Vector3.zero; weapon.transform.localRotation = Quaternion.identity; weapon.transform.transform.localScale = Vector3.one; } } SwitchAnimator((E_WEAPONTYPE)_WeaponType); }
public AudioClip GetPlayerAttackmonetClip(E_WEAPONTYPE _Type) { return(m_ListPlayerAttackMomentClip[(int)_Type]); }
public void PlayAttackMomentSound(E_WEAPONTYPE _Type) { m_ListAudio[0].PlayOneShot(m_ListPlayerAttackMomentClip[(int)_Type]); }