public void SetWeaponType(WeaponType weaponType) { switch (weaponType) { default: case WeaponType.Rifle: UnitAnim rifleReloadRightUnitAnim = UnitAnim.GetUnitAnim("dMarine_ReloadRifleRight").CloneDeep(); rifleReloadRightUnitAnim.SetFrameRateMod(1.4f); UnitAnim rifleReloadLeftUnitAnim = UnitAnim.GetUnitAnim("dMarine_ReloadRifleLeft").CloneDeep(); rifleReloadLeftUnitAnim.SetFrameRateMod(1.4f); unitSkeletonCompositeWeaponReload.SetAnims(rifleReloadRightUnitAnim, rifleReloadLeftUnitAnim); //unitSkeletonCompositeWeaponReload.SetAnims(UnitAnim.GetUnitAnim("dMarine_ReloadRifleRight"), UnitAnim.GetUnitAnim("dMarine_ReloadRifleLeft")); unitSkeletonCompositeWeapon.SetAnims(UnitAnim.GetUnitAnim("dMarine_AimWeaponRight"), UnitAnim.GetUnitAnim("dMarine_AimWeaponLeft"), UnitAnim.GetUnitAnim("dMarine_ShootWeaponRight"), UnitAnim.GetUnitAnim("dMarine_ShootWeaponLeft")); break; case WeaponType.Pistol: UnitAnim pistolReloadRightUnitAnim = UnitAnim.GetUnitAnim("Aim_PistolReloadRight").CloneDeep(); pistolReloadRightUnitAnim.SetFrameRateMod(1.4f); UnitAnim pistolReloadLeftUnitAnim = UnitAnim.GetUnitAnim("Aim_PistolReloadLeft").CloneDeep(); pistolReloadLeftUnitAnim.SetFrameRateMod(1.4f); unitSkeletonCompositeWeaponReload.SetAnims(pistolReloadRightUnitAnim, pistolReloadLeftUnitAnim); unitSkeletonCompositeWeapon.SetAnims(UnitAnim.GetUnitAnim("Aim_PistolRight"), UnitAnim.GetUnitAnim("Aim_PistolLeft"), UnitAnim.GetUnitAnim("Aim_PistolShootRight"), UnitAnim.GetUnitAnim("Aim_PistolShootLeft")); break; case WeaponType.Shotgun: unitSkeletonCompositeWeaponReload.SetAnims(UnitAnim.GetUnitAnim("Aim_ShotgunReloadRight"), UnitAnim.GetUnitAnim("Aim_ShotgunReloadLeft")); unitSkeletonCompositeWeapon.SetAnims(UnitAnim.GetUnitAnim("Aim_ShotgunRight"), UnitAnim.GetUnitAnim("Aim_ShotgunLeft"), UnitAnim.GetUnitAnim("Aim_ShotgunShootRight"), UnitAnim.GetUnitAnim("Aim_ShotgunShootLeft")); break; } canShoot = true; isReloading = false; unitSkeletonCompositeWeaponReload.SetInactive(); unitSkeletonCompositeWeapon.SetActive(); }