add some extra assets FX and SFX
This commit is contained in:
@@ -254,6 +254,7 @@ public class playerWeaponSystem : MonoBehaviour
|
||||
AudioClip customImpactSoundEffect;
|
||||
bool usingCustomImpactSoundEffectActive;
|
||||
|
||||
Transform keepPositionsParentTransform;
|
||||
|
||||
void Awake ()
|
||||
{
|
||||
@@ -286,6 +287,8 @@ public class playerWeaponSystem : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
//print ("initializeComponents " + getWeaponSystemName ());
|
||||
|
||||
gameObject.name += " (" + getWeaponSystemName () + ") ";
|
||||
currentWeaponEffectsSource = weaponEffectsSource;
|
||||
|
||||
@@ -307,7 +310,7 @@ public class playerWeaponSystem : MonoBehaviour
|
||||
|
||||
GameObject keepPositionsParent = new GameObject ();
|
||||
|
||||
Transform keepPositionsParentTransform = keepPositionsParent.transform;
|
||||
keepPositionsParentTransform = keepPositionsParent.transform;
|
||||
keepPositionsParentTransform.SetParent (weaponParent);
|
||||
keepPositionsParentTransform.name = getWeaponSystemName () + " Keep Positions Parent";
|
||||
keepPositionsParentTransform.localScale = Vector3.one;
|
||||
@@ -379,6 +382,8 @@ public class playerWeaponSystem : MonoBehaviour
|
||||
projectilePositionCount = weaponSettings.projectilePosition.Count;
|
||||
|
||||
componentsInitialized = true;
|
||||
|
||||
IKWeaponManager.initializeAttachmentSystem ();
|
||||
}
|
||||
|
||||
void OnEnable ()
|
||||
@@ -1576,6 +1581,8 @@ public class playerWeaponSystem : MonoBehaviour
|
||||
|
||||
newProjectileInfo.useFakeProjectileTrails = weaponSettings.useFakeProjectileTrails;
|
||||
|
||||
newProjectileInfo.ignoreUseTrailRenderer = weaponSettings.ignoreUseTrailRenderer;
|
||||
|
||||
newProjectileInfo.useRaycastCheckingOnRigidbody = weaponSettings.useRaycastCheckingOnRigidbody;
|
||||
newProjectileInfo.customRaycastCheckingRate = weaponSettings.customRaycastCheckingRate;
|
||||
newProjectileInfo.customRaycastCheckingDistance = weaponSettings.customRaycastCheckingDistance;
|
||||
@@ -2977,6 +2984,11 @@ public class playerWeaponSystem : MonoBehaviour
|
||||
return weaponSettings.clipSize;
|
||||
}
|
||||
|
||||
public int getWeaponOriginalClipSize ()
|
||||
{
|
||||
return originalClipSize;
|
||||
}
|
||||
|
||||
void setWeaponClipSizeValue (int newValue)
|
||||
{
|
||||
weaponSettings.clipSize = newValue;
|
||||
@@ -3514,12 +3526,17 @@ public class playerWeaponSystem : MonoBehaviour
|
||||
|
||||
public void enableOrDisableWeaponMesh (bool state)
|
||||
{
|
||||
//print ("mesh state "+gameObject.name + " " + state);
|
||||
//print ("mesh state " + gameObject.name + " " + state);
|
||||
if (weaponSettings.weaponMesh.activeSelf != state) {
|
||||
weaponSettings.weaponMesh.SetActive (state);
|
||||
}
|
||||
}
|
||||
|
||||
public void setWeaponMeshScale (float newValue)
|
||||
{
|
||||
weaponSettings.weaponMesh.transform.localScale = Vector3.one * newValue;
|
||||
}
|
||||
|
||||
public void placeMagazineInPlayerHand (bool state)
|
||||
{
|
||||
if (weaponSettings.clipModel != null) {
|
||||
@@ -3745,11 +3762,30 @@ public class playerWeaponSystem : MonoBehaviour
|
||||
|
||||
if (newMountPointTransform != null) {
|
||||
weaponSettings.weaponParent = newMountPointTransform;
|
||||
} else {
|
||||
print ("not found mount point for " + getWeaponSystemName () + " " + mountPointNameForWeaponParent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateWeaponParentInRuntime (Transform parent, Animator mainAnimtor)
|
||||
{
|
||||
setWeaponParent (parent, mainAnimtor);
|
||||
|
||||
if (Application.isPlaying) {
|
||||
transform.SetParent (weaponSettings.weaponParent);
|
||||
|
||||
if (keepPositionsParentTransform != null) {
|
||||
keepPositionsParentTransform.SetParent (weaponSettings.weaponParent);
|
||||
keepPositionsParentTransform.localPosition = Vector3.zero;
|
||||
keepPositionsParentTransform.localRotation = Quaternion.identity;
|
||||
}
|
||||
|
||||
IKWeaponManager.resetWeaponPositionInAnyView ();
|
||||
}
|
||||
}
|
||||
|
||||
public void getWeaponComponents ()
|
||||
{
|
||||
IKWeaponManager = transform.parent.GetComponent<IKWeaponSystem> ();
|
||||
|
||||
Reference in New Issue
Block a user