Example #1
0
    void FireSync(int m_type, Vector3 hitPosition)
    {
        if (CurrenGun == null)
        {
            return;
        }
        GunType t = (GunType)(m_type);

        switch (t)
        {
        case GunType.Machinegun:
            CurrenGun.Fire(hitPosition);
            m_PlayerAnimation.PlayFireAnimation(GunType.Machinegun);
            break;

        case GunType.Pistol:
            CurrenGun.Fire(hitPosition);
            m_PlayerAnimation.PlayFireAnimation(GunType.Pistol);
            break;

        case GunType.Burst:
        case GunType.Sniper:
        case GunType.Shotgun:
            CurrenGun.Fire(hitPosition);
            break;

        case GunType.Knife:
            CurrenGun.KnifeFire();    //if you need add your custom fire launcher in networkgun
            m_PlayerAnimation.PlayFireAnimation(GunType.Knife);
            break;

        default:
            Debug.LogWarning("Not defined weapon type to sync bullets.");
            break;
        }
    }