Пример #1
0
    void SwitchAnimator(E_WEAPONTYPE _Type)
    {
        RuntimeAnimatorController anim = FindAnimator(_Type.ToString());

        if (anim)
        {
            m_Animator.runtimeAnimatorController = anim;
        }
    }
Пример #2
0
    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);
    }
Пример #3
0
    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));
        }
    }
Пример #4
0
    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);
    }
Пример #5
0
 public AudioClip GetPlayerAttackmonetClip(E_WEAPONTYPE _Type)
 {
     return(m_ListPlayerAttackMomentClip[(int)_Type]);
 }
Пример #6
0
 public void PlayAttackMomentSound(E_WEAPONTYPE _Type)
 {
     m_ListAudio[0].PlayOneShot(m_ListPlayerAttackMomentClip[(int)_Type]);
 }