add some extra assets FX and SFX

This commit is contained in:
Robii Aragon
2026-03-29 23:03:14 -07:00
parent 6ef3eb1535
commit 24dc66a81e
10142 changed files with 2535978 additions and 36608 deletions

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Attachments/attachmentIconInfo.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Attachments/attachmentInfo.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Attachments/attachmentSlotInfo.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Attachments/laserAttachment.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Attachments/laserDotOnScreenSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -15,6 +15,8 @@ public class weaponAttachmentSystem : MonoBehaviour
public IKWeaponSystem IKWeaponManager;
public bool editingAttachments;
public bool editAttachmentsEnabled = true;
//UI Elements
public GameObject attachmentInfoGameObject;
@@ -68,6 +70,7 @@ public class weaponAttachmentSystem : MonoBehaviour
public bool showDebugPrint;
List<GameObject> attachmentIconGameObjectList = new List<GameObject> ();
bool chechAttachmentPlaces;
@@ -119,6 +122,8 @@ public class weaponAttachmentSystem : MonoBehaviour
Coroutine updateCoroutine;
bool attachmentComponentsInitialized;
private void InitializeAudioElements ()
{
@@ -151,7 +156,7 @@ public class weaponAttachmentSystem : MonoBehaviour
}
}
void Start ()
public void initializeAttachmentSystem ()
{
InitializeAudioElements ();
@@ -167,10 +172,53 @@ public class weaponAttachmentSystem : MonoBehaviour
weaponsManagerFound = true;
StartCoroutine (initializeAttachmentElements ());
if (gameObject.activeInHierarchy) {
StartCoroutine (initializeAttachmentElements ());
}
}
}
public void checkInitializeAttachmentElements ()
{
if (attachmentComponentsInitialized) {
return;
}
initializeAttachmentWithoutWait ();
}
IEnumerator initializeAttachmentElements ()
{
initializationInProcess = true;
initializationInStartCalled = true;
lastTimeInitializationCalled = Time.time;
yield return new WaitForSecondsRealtime (0.4f);
setAttachmentInitialState ();
initializationInProcess = false;
attachmentComponentsInitialized = true;
}
void initializeAttachmentWithoutWait ()
{
initializationInProcess = true;
initializationInStartCalled = true;
lastTimeInitializationCalled = Time.time;
setAttachmentInitialState ();
initializationInProcess = false;
attachmentComponentsInitialized = true;
}
public void instantiateAttachmentIcons ()
{
int attachmentActiveIndex = 0;
@@ -309,20 +357,6 @@ public class weaponAttachmentSystem : MonoBehaviour
}
}
IEnumerator initializeAttachmentElements ()
{
initializationInProcess = true;
initializationInStartCalled = true;
lastTimeInitializationCalled = Time.time;
yield return new WaitForSecondsRealtime (0.4f);
setAttachmentInitialState ();
initializationInProcess = false;
}
public void stopUpdateCoroutine ()
{
@@ -333,7 +367,7 @@ public class weaponAttachmentSystem : MonoBehaviour
IEnumerator updateSystemCoroutine ()
{
var waitTime = new WaitForFixedUpdate ();
var waitTime = new WaitForSeconds (0.00001f);
while (true) {
updateSystem ();
@@ -383,65 +417,7 @@ public class weaponAttachmentSystem : MonoBehaviour
void updateEditingAttachmentState ()
{
if (editingAttachments) {
if (canChangeAttachmentWithNumberKeys) {
for (int i = 0; i < currentAmountAttachments; i++) {
if (i <= 8 && Input.GetKeyDown ("" + (i + 1))) {
if (i < attachmentInfoList.Count) {
if (attachmentInfoList [i].attachmentPlaceEnabled) {
int currentIndex = attachmentInfoList [i].currentAttachmentSelectedIndex;
currentIndex++;
if (currentIndex > attachmentInfoList [i].attachmentPlaceInfoList.Count) {
currentIndex = 0;
}
if (currentIndex > 0) {
if (!attachmentInfoList [i].attachmentPlaceInfoList [currentIndex - 1].attachmentEnabled) {
int nextIndex = currentIndex;
int loop = 0;
int nextIndexToConfigure = -1;
while (nextIndex < attachmentInfoList [i].attachmentPlaceInfoList.Count) {
if (attachmentInfoList [i].attachmentPlaceInfoList [nextIndex].attachmentEnabled) {
//print (attachmentInfoList [i].attachmentPlaceInfoList [nextIndex].Name);
if (nextIndexToConfigure == -1) {
nextIndexToConfigure = nextIndex;
}
}
nextIndex++;
if (loop > 1000) {
print ("loop error");
break;
}
}
if (nextIndexToConfigure != -1) {
currentIndex = nextIndexToConfigure + 1;
if (currentIndex > attachmentInfoList [i].attachmentPlaceInfoList.Count) {
currentIndex = 0;
}
} else {
currentIndex = 0;
}
}
}
// print (currentIndex);
if (currentIndex == 0) {
checkPressedAttachmentButton (attachmentInfoList [i].attachmentIconManager.notAttachmentButton.slotButton);
} else {
checkPressedAttachmentButton (attachmentInfoList [i].attachmentPlaceInfoList [currentIndex - 1].attachmentSlotManager.slotButton);
}
}
}
}
}
}
checkAttachmentWithNumberKeys ();
if (showCurrentAttachmentHoverInfo && Time.time > lastTimeAttachmentsActive + 0.5f && !IKWeaponManager.moving) {
int touchCount = Input.touchCount;
@@ -515,6 +491,76 @@ public class weaponAttachmentSystem : MonoBehaviour
}
}
void checkAttachmentWithNumberKeys ()
{
if (canChangeAttachmentWithNumberKeys) {
int currentNumberInput = weaponsManager.checkNumberInput (10);
if (currentNumberInput > 0) {
currentNumberInput--;
if (currentNumberInput >= currentAmountAttachments || currentNumberInput < 0) {
return;
}
attachmentPlace currentPlace = attachmentInfoList [currentNumberInput];
if (currentPlace.attachmentPlaceEnabled) {
int currentIndex = currentPlace.currentAttachmentSelectedIndex;
currentIndex++;
if (currentIndex > currentPlace.attachmentPlaceInfoList.Count) {
currentIndex = 0;
}
if (currentIndex > 0) {
if (!currentPlace.attachmentPlaceInfoList [currentIndex - 1].attachmentEnabled) {
int nextIndex = currentIndex;
int loop = 0;
int nextIndexToConfigure = -1;
while (nextIndex < currentPlace.attachmentPlaceInfoList.Count) {
if (currentPlace.attachmentPlaceInfoList [nextIndex].attachmentEnabled) {
//print (attachmentInfoList [i].attachmentPlaceInfoList [nextIndex].Name);
if (nextIndexToConfigure == -1) {
nextIndexToConfigure = nextIndex;
}
}
nextIndex++;
if (loop > 1000) {
print ("loop error");
break;
}
}
if (nextIndexToConfigure != -1) {
currentIndex = nextIndexToConfigure + 1;
if (currentIndex > currentPlace.attachmentPlaceInfoList.Count) {
currentIndex = 0;
}
} else {
currentIndex = 0;
}
}
}
// print (currentIndex);
if (currentIndex == 0) {
checkPressedAttachmentButton (currentPlace.attachmentIconManager.notAttachmentButton.slotButton);
} else {
checkPressedAttachmentButton (currentPlace.attachmentPlaceInfoList [currentIndex - 1].attachmentSlotManager.slotButton);
}
}
}
}
}
public void activateAttachmentUIPanels ()
{
if (currentWeaponAttachmentsMenu.activeSelf != editingAttachments) {
@@ -775,6 +821,7 @@ public class weaponAttachmentSystem : MonoBehaviour
setAttachmentInitialState ();
}
public void setAttachmentInitialState ()
{
if (attachmentInitialized) {
@@ -783,6 +830,8 @@ public class weaponAttachmentSystem : MonoBehaviour
attachmentInitialized = true;
weaponSystem.initializeComponents ();
attachmentInfo attachmentActiveInfo = new attachmentInfo ();
for (int i = 0; i < attachmentInfoList.Count; i++) {
@@ -1434,6 +1483,14 @@ public class weaponAttachmentSystem : MonoBehaviour
public bool canBeOpened ()
{
if (!editAttachmentsEnabled) {
return false;
}
if (IKWeaponManager != null && !IKWeaponManager.checkIfWeaponUsesAttachment ()) {
return false;
}
if (canEditWeaponWithoutAttchments || attachmentsActiveInWeapon) {
return true;
}

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Attachments/weaponAttachmentSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Attachments/weaponsAttachmentUIManager.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/IKWeaponInfo.cs
uploadId: 814740
uploadId: 889948

View File

@@ -175,6 +175,8 @@ public class IKWeaponSystem : weaponObjectInfo
public weaponAttachmentSystem mainWeaponAttachmentSystem;
public bool weaponUsesAttachment;
public bool ignoreUseAttachmentSystem;
public bool jumpingOnProcess;
bool weaponInJumpStart;
bool weaponInJumpEnd;
@@ -792,9 +794,18 @@ public class IKWeaponSystem : weaponObjectInfo
if (weaponsManager.checkIfHideWeaponMeshWhenNotUsed (hideWeaponIfKeptInThirdPerson)) {
enableOrDisableWeaponMesh (false);
if (checkIfWeaponUsesAttachment ()) {
mainWeaponAttachmentSystem.checkInitializeAttachmentElements ();
}
}
}
public bool checkIfWeaponUsesAttachment ()
{
return weaponUsesAttachment && !ignoreUseAttachmentSystem;
}
public void setPlayerOnJumpStartState (bool state)
{
playerOnJumpStart = state;
@@ -938,6 +949,11 @@ public class IKWeaponSystem : weaponObjectInfo
return weaponSystemManager.getWeaponSystemAmmoName ();
}
public int getWeaponOriginalClipSize ()
{
return weaponSystemManager.getWeaponOriginalClipSize ();
}
public void setRemainAmmoAmount (int newRemainAmmoAmount)
{
weaponSystemManager.setRemainAmmoAmount (newRemainAmmoAmount);
@@ -5688,6 +5704,44 @@ public class IKWeaponSystem : weaponObjectInfo
}
}
public void resetWeaponPositionInAnyView ()
{
bool firstPersonActive = isPlayerCameraFirstPersonActive ();
Transform newParent = weaponsManager.getWeaponsParent ();
if (newParent == null) {
newParent = weaponsManager.getPlayerManagersParentGameObject ();
}
Transform newParentWeaponMesh = newParent;
if (usingDualWeapon) {
if (usingRightHandDualWeapon) {
if (firstPersonActive) {
newParentWeaponMesh = firstPersonWeaponInfo.rightHandDualWeaopnInfo.keepPosition;
} else {
newParentWeaponMesh = thirdPersonWeaponInfo.rightHandDualWeaopnInfo.keepPosition;
}
} else {
if (firstPersonActive) {
newParentWeaponMesh = firstPersonWeaponInfo.leftHandDualWeaponInfo.keepPosition;
} else {
newParentWeaponMesh = thirdPersonWeaponInfo.leftHandDualWeaponInfo.keepPosition;
}
}
} else {
if (firstPersonActive) {
newParentWeaponMesh = firstPersonWeaponInfo.keepPosition;
} else {
newParentWeaponMesh = thirdPersonWeaponInfo.keepPosition;
}
}
weaponTransform.localPosition = newParentWeaponMesh.localPosition;
weaponTransform.localRotation = newParentWeaponMesh.localRotation;
}
public void setWeaponHasRecoilState (bool state)
{
thirdPersonWeaponInfo.weaponHasRecoil = state;
@@ -6688,6 +6742,116 @@ public class IKWeaponSystem : weaponObjectInfo
weaponSystemManager.enableOrDisableWeaponMesh (state);
}
public void setWeaponMeshScale (float newValue)
{
weaponSystemManager.setWeaponMeshScale (newValue);
}
public void adjustAllFireWeaponTransformReferencePosition (float newValue)
{
thirdPersonWeaponInfo.aimPosition.localPosition *= newValue;
thirdPersonWeaponInfo.walkPosition.localPosition *= newValue;
thirdPersonWeaponInfo.aimRecoilPosition.localPosition *= newValue;
if (thirdPersonWeaponInfo.surfaceCollisionPosition != null) {
thirdPersonWeaponInfo.surfaceCollisionPosition.localPosition *= newValue;
}
if (thirdPersonWeaponInfo.surfaceCollisionRayPosition != null) {
thirdPersonWeaponInfo.surfaceCollisionRayPosition.localPosition *= newValue;
}
if (thirdPersonWeaponInfo.weaponPositionInHandForDeactivateIK != null) {
thirdPersonWeaponInfo.weaponPositionInHandForDeactivateIK.localPosition *= newValue;
}
if (thirdPersonWeaponInfo.weaponPivotPoint != null) {
thirdPersonWeaponInfo.weaponPivotPoint.localPosition *= newValue;
}
if (thirdPersonWeaponInfo.weaponRotationPointHeadLookTarget != null) {
thirdPersonWeaponInfo.weaponRotationPointHeadLookTarget.localPosition *= newValue;
}
currentKeepPath = thirdPersonWeaponInfo.keepPath;
for (int j = 0; j < currentKeepPath.Count; j++) {
if (currentKeepPath [j] != null) {
if (currentKeepPath [j] != thirdPersonWeaponInfo.walkPosition) {
currentKeepPath [j].localPosition *= newValue;
}
}
}
for (int i = 0; i < thirdPersonWeaponInfo.handsInfo.Count; i++) {
for (int j = 0; j < thirdPersonWeaponInfo.handsInfo [i].wayPoints.Count; j++) {
if (thirdPersonWeaponInfo.handsInfo [i].wayPoints [j] != null &&
thirdPersonWeaponInfo.handsInfo [i].wayPoints [j] != thirdPersonWeaponInfo.handsInfo [i].position) {
thirdPersonWeaponInfo.handsInfo [i].wayPoints [j].localPosition *= newValue;
}
}
}
//public Transform aimPosition;
//public Transform walkPosition;
//public Transform keepPosition;
//public Transform aimRecoilPosition;
//public Transform walkRecoilPosition;
//public Transform surfaceCollisionPosition;
//public Transform surfaceCollisionRayPosition;
//public Transform lowerWeaponPosition;
//public Transform runPosition;
//public Transform jumpStartPosition;
//public Transform jumpEndPosition;
//public Transform meleeAttackPosition;
//public Transform meleeAttackRaycastPosition;
//public Transform editAttachmentPosition;
//public Transform attachmentCameraPosition;
//public Transform leftHandEditPosition;
//public Transform leftHandParent;
//public Transform extraLeftHandMeshParent;
//public Transform secondPositionForHand;
//public Transform sightPosition;
//public Transform sightRecoilPosition;
//public List<Transform> deactivateIKDrawPath = new List<Transform> ();
//public Transform weaponPositionInHandForDeactivateIK;
//public List<Transform> keepPath = new List<Transform> ();
//public Transform weaponRotationPoint;
//public Transform weaponRotationPointHolder;
//public Transform weaponRotationPointHeadLookTarget;
//public Transform weaponPivotPoint;
//public Transform crouchPosition;
//public Transform crouchRecoilPosition;
}
public void setHandTransform (Transform rightHand, Transform leftHand, Transform newRightHandMountPoint, Transform newLeftHandMountPoint)
{
for (int j = 0; j < thirdPersonWeaponInfo.handsInfo.Count; j++) {
@@ -7422,7 +7586,7 @@ public class IKWeaponSystem : weaponObjectInfo
weaponSystemManager.setCurrentWeaponState (state);
if (currentWeapon) {
if (weaponUsesAttachment) {
if (checkIfWeaponUsesAttachment ()) {
mainWeaponAttachmentSystem.checkIfAttachmentSystemInitialized ();
}
} else {
@@ -7490,6 +7654,13 @@ public class IKWeaponSystem : weaponObjectInfo
return hideWeaponIfKeptInThirdPerson;
}
public void initializeAttachmentSystem ()
{
if (checkIfWeaponUsesAttachment ()) {
mainWeaponAttachmentSystem.initializeAttachmentSystem ();
}
}
public bool pickupAttachment (string attachmentName)
{
if (mainWeaponAttachmentSystem != null) {

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/IKWeaponSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -6,478 +6,515 @@ using UnityEngine.UI;
public class attrackObjectsSystem : MonoBehaviour
{
[Header ("Main Settings")]
[Space]
[Header ("Main Settings")]
[Space]
public bool attractionEnabled;
public bool attractionEnabled;
public bool attractionApplyForce = true;
public bool attractionActive;
public float attractionRadius = 20;
public bool attractionApplyForce = true;
public float attractionRadius = 20;
public LayerMask layerToSearch;
public LayerMask layerToSearch;
public float attractionVelocity = 10;
public float attractionForce = 1000;
public ForceMode forceMode;
[Space]
public float maxThrowForce = 3500;
public float increaseThrowForceSpeed = 1500;
public float attractionVelocity = 10;
public float attractionForce = 1000;
public ForceMode forceMode;
public List<string> tagToLocate = new List<string> ();
public float maxThrowForce = 3500;
public float increaseThrowForceSpeed = 1500;
public LayerMask layerToDamage;
public List<string> tagToLocate = new List<string> ();
[Space]
[Header ("Remote Events Settings")]
[Space]
public LayerMask layerToDamage;
public bool useRemoteEventOnObjectsFound;
public List<string> remoteEventNameListOnGrabObject = new List<string> ();
public List<string> remoteEventNameListOnDropObject = new List<string> ();
[Space]
[Header ("Remote Events Settings")]
[Space]
[Space]
[Header ("Debug")]
[Space]
public bool useRemoteEventOnObjectsFound;
public List<string> remoteEventNameListOnGrabObject = new List<string> ();
public List<string> remoteEventNameListOnDropObject = new List<string> ();
public bool carryingObjects;
[Space]
[Header ("Debug")]
[Space]
[Space]
[Header ("Events Settings")]
[Space]
public bool carryingObjects;
public bool attractionActive;
public UnityEvent eventsOnActivateAttraction;
public UnityEvent eventOnDeactivateAttraction;
[Space]
[Header ("Events Settings")]
[Space]
[Space]
[Header ("Components")]
[Space]
public UnityEvent eventsOnActivateAttraction;
public UnityEvent eventOnDeactivateAttraction;
public Slider powerSlider;
public Transform mainCameraTransform;
public Transform attractionPosition;
public Collider playerCollider;
public GameObject playerGameObject;
[Space]
[Header ("Components")]
[Space]
public playerWeaponSystem mainPlayerWeaponSystem;
public Slider powerSlider;
public Transform mainCameraTransform;
public Transform attractionPosition;
public Collider playerCollider;
public GameObject playerGameObject;
float currentForceToLaunchObjects;
public playerWeaponSystem mainPlayerWeaponSystem;
Rigidbody currentRigidbody;
float currentForceToLaunchObjects;
Vector3 attractDirection;
Rigidbody currentRigidbody;
Vector3 currentPosition;
Vector3 attractDirection;
RaycastHit hit;
Vector3 currentPosition;
List<grabbedObject> grabbedObjectList = new List<grabbedObject> ();
RaycastHit hit;
float lastTimeActivateAttraction;
List<grabbedObject> grabbedObjectList = new List<grabbedObject> ();
Vector3 nextObjectHeldPosition;
Vector3 currentObjectHeldPosition;
float lastTimeActivateAttraction;
Coroutine grabObjectsCoroutine;
Vector3 nextObjectHeldPosition;
Vector3 currentObjectHeldPosition;
bool componentsInitialized;
Coroutine grabObjectsCoroutine;
bool componentsInitialized;
void Awake ()
{
if (mainCameraTransform == null) {
mainCameraTransform = transform;
}
Coroutine updateCoroutine;
if (playerGameObject == null) {
playerGameObject = gameObject;
}
}
void FixedUpdate ()
{
if (attractionActive) {
if (!carryingObjects) {
return;
}
void Awake ()
{
if (mainCameraTransform == null) {
mainCameraTransform = transform;
}
currentPosition = attractionPosition.position;
if (playerGameObject == null) {
playerGameObject = gameObject;
}
}
for (int i = 0; i < grabbedObjectList.Count; i++) {
if (grabbedObjectList [i].objectToMove != null) {
currentRigidbody = grabbedObjectList [i].mainRigidbody;
if (currentRigidbody != null) {
public void stopUpdateCoroutine ()
{
if (updateCoroutine != null) {
StopCoroutine (updateCoroutine);
}
}
if (attractionApplyForce) {
attractDirection = currentPosition - currentRigidbody.position;
currentRigidbody.AddForce (attractDirection.normalized * (attractionForce * currentRigidbody.mass * Time.fixedDeltaTime), forceMode);
} else {
nextObjectHeldPosition = currentPosition + attractionPosition.forward;
currentObjectHeldPosition = currentRigidbody.position;
IEnumerator updateSystemCoroutine ()
{
var waitTime = new WaitForFixedUpdate ();
currentRigidbody.linearVelocity = (nextObjectHeldPosition - currentObjectHeldPosition) * attractionVelocity;
}
}
}
}
}
}
while (true) {
updateSystem ();
public void setAttractionEnabledState (bool state)
{
attractionEnabled = state;
}
yield return waitTime;
}
}
public void checkGrabObject ()
{
if (grabObjectsCoroutine != null) {
StopCoroutine (grabObjectsCoroutine);
}
void updateSystem ()
{
if (attractionActive) {
grabObjectsCoroutine = StartCoroutine (checkGrabObjectCoroutine ());
}
if (!carryingObjects) {
return;
}
IEnumerator checkGrabObjectCoroutine ()
{
yield return new WaitForSeconds (0.05f);
currentPosition = attractionPosition.position;
if (attractionEnabled && !carryingObjects) {
lastTimeActivateAttraction = Time.time;
int grabbedObjectListCount = grabbedObjectList.Count;
initializeComponents ();
for (int i = 0; i < grabbedObjectListCount; i++) {
if (grabbedObjectList [i].objectToMove != null) {
currentRigidbody = grabbedObjectList [i].mainRigidbody;
attractionActive = true;
if (currentRigidbody != null) {
grabCloseObjects ();
if (attractionApplyForce) {
attractDirection = currentPosition - currentRigidbody.position;
if (carryingObjects) {
eventsOnActivateAttraction.Invoke ();
}
}
}
currentRigidbody.AddForce (attractDirection.normalized * (attractionForce * currentRigidbody.mass * Time.fixedDeltaTime), forceMode);
} else {
nextObjectHeldPosition = currentPosition + attractionPosition.forward;
public void inputGrabObjects ()
{
checkGrabObject ();
}
currentObjectHeldPosition = currentRigidbody.position;
public void inputHoldToLaunchObject ()
{
if (!attractionEnabled) {
return;
}
currentRigidbody.linearVelocity = (nextObjectHeldPosition - currentObjectHeldPosition) * attractionVelocity;
}
}
}
}
}
}
if (carryingObjects) {
if (Time.time > lastTimeActivateAttraction + 0.5f) {
addForceToLaunchObjects ();
}
}
}
public void setAttractionEnabledState (bool state)
{
attractionEnabled = state;
public void inputReleaseToLaunchObject ()
{
if (!attractionEnabled) {
return;
}
if (!attractionEnabled) {
updateSystemCoroutine ();
}
}
if (carryingObjects) {
if (Time.time > lastTimeActivateAttraction + 0.5f) {
dropObjects ();
public void checkGrabObject ()
{
if (grabObjectsCoroutine != null) {
StopCoroutine (grabObjectsCoroutine);
}
attractionActive = false;
grabObjectsCoroutine = StartCoroutine (checkGrabObjectCoroutine ());
}
eventOnDeactivateAttraction.Invoke ();
}
}
}
IEnumerator checkGrabObjectCoroutine ()
{
yield return new WaitForSeconds (0.05f);
public void grabCloseObjects ()
{
//if the player has not grabbedObjects, store them
if (grabbedObjectList.Count == 0) {
//check in a radius, the close objects which can be grabbed
currentPosition = attractionPosition.position;
if (attractionEnabled && !carryingObjects) {
lastTimeActivateAttraction = Time.time;
int ignoreRaycastLayerIndex = LayerMask.NameToLayer ("Ignore Raycast");
initializeComponents ();
Collider[] objects = Physics.OverlapSphere (currentPosition, attractionRadius, layerToSearch);
foreach (Collider currentCollider in objects) {
Rigidbody currentRigidbody = currentCollider.GetComponent<Rigidbody> ();
attractionActive = true;
if (tagToLocate.Contains (currentCollider.tag) && currentRigidbody != null) {
if (currentRigidbody.isKinematic) {
currentRigidbody.isKinematic = false;
}
updateCoroutine = StartCoroutine (updateSystemCoroutine ());
grabbedObject newGrabbedObject = new grabbedObject ();
//removed tag and layer after store them, so the camera can still use raycast properly
grabCloseObjects ();
GameObject currentObject = currentCollider.gameObject;
newGrabbedObject.objectToMove = currentObject;
newGrabbedObject.objectTag = currentObject.tag;
newGrabbedObject.objectLayer = currentObject.layer;
newGrabbedObject.mainRigidbody = currentRigidbody;
if (carryingObjects) {
eventsOnActivateAttraction.Invoke ();
}
}
}
if (useRemoteEventOnObjectsFound) {
remoteEventSystem currentRemoteEventSystem = currentObject.GetComponent<remoteEventSystem> ();
public void inputGrabObjects ()
{
checkGrabObject ();
}
if (currentRemoteEventSystem != null) {
for (int i = 0; i < remoteEventNameListOnGrabObject.Count; i++) {
public void inputHoldToLaunchObject ()
{
if (!attractionEnabled) {
return;
}
currentRemoteEventSystem.callRemoteEvent (remoteEventNameListOnGrabObject [i]);
}
}
}
if (carryingObjects) {
if (Time.time > lastTimeActivateAttraction + 0.5f) {
addForceToLaunchObjects ();
}
}
}
currentObject.tag = "Untagged";
public void inputReleaseToLaunchObject ()
{
if (!attractionEnabled) {
return;
}
currentObject.layer = ignoreRaycastLayerIndex;
if (carryingObjects) {
if (Time.time > lastTimeActivateAttraction + 0.5f) {
dropObjects ();
currentRigidbody.useGravity = false;
attractionActive = false;
//get the distance from every object to left and right side of the player, to set every side as parent of every object
//disable collisions between the player and the objects, to avoid issues
if (playerCollider != null) {
Physics.IgnoreCollision (currentCollider, playerCollider, true);
}
stopUpdateCoroutine ();
//if any object grabbed has its own gravity, paused the script to move the object properly
artificialObjectGravity currentArtificialObjectGravity = currentObject.GetComponent<artificialObjectGravity> ();
eventOnDeactivateAttraction.Invoke ();
}
}
}
if (currentArtificialObjectGravity != null) {
currentArtificialObjectGravity.setActiveState (false);
}
grabObjectProperties currentGrabObjectProperties = currentObject.GetComponent<grabObjectProperties> ();
if (currentGrabObjectProperties != null) {
currentGrabObjectProperties.checkEventsOnGrabObject ();
}
public void grabCloseObjects ()
{
//if the player has not grabbedObjects, store them
if (grabbedObjectList.Count == 0) {
//check in a radius, the close objects which can be grabbed
currentPosition = attractionPosition.position;
grabbedObjectState currentGrabbedObjectState = currentObject.GetComponent<grabbedObjectState> ();
int ignoreRaycastLayerIndex = LayerMask.NameToLayer ("Ignore Raycast");
if (currentGrabbedObjectState == null) {
currentGrabbedObjectState = currentObject.AddComponent<grabbedObjectState> ();
}
Collider [] objects = Physics.OverlapSphere (currentPosition, attractionRadius, layerToSearch);
foreach (Collider currentCollider in objects) {
objectToPlaceSystem currentObjectToPlaceSystem = currentObject.GetComponent<objectToPlaceSystem> ();
Rigidbody currentRigidbody = currentCollider.GetComponent<Rigidbody> ();
if (currentObjectToPlaceSystem != null) {
currentObjectToPlaceSystem.setObjectInGrabbedState (true);
}
if (tagToLocate.Contains (currentCollider.tag) && currentRigidbody != null) {
if (currentRigidbody.isKinematic) {
currentRigidbody.isKinematic = false;
}
//if any object is pickable and is inside an opened chest, activate its trigger or if it has been grabbed by the player, remove of the list
pickUpObject currentPickUpObject = currentObject.GetComponent<pickUpObject> ();
grabbedObject newGrabbedObject = new grabbedObject ();
//removed tag and layer after store them, so the camera can still use raycast properly
if (currentPickUpObject) {
currentPickUpObject.activateObjectTrigger ();
}
GameObject currentObject = currentCollider.gameObject;
newGrabbedObject.objectToMove = currentObject;
newGrabbedObject.objectTag = currentObject.tag;
newGrabbedObject.objectLayer = currentObject.layer;
newGrabbedObject.mainRigidbody = currentRigidbody;
deviceStringAction currentDeviceStringAction = currentObject.GetComponentInChildren<deviceStringAction> ();
if (useRemoteEventOnObjectsFound) {
remoteEventSystem currentRemoteEventSystem = currentObject.GetComponent<remoteEventSystem> ();
if (currentDeviceStringAction != null) {
currentDeviceStringAction.setIconEnabledState (false);
}
if (currentRemoteEventSystem != null) {
for (int i = 0; i < remoteEventNameListOnGrabObject.Count; i++) {
if (currentGrabbedObjectState != null) {
currentGrabbedObjectState.setCurrentHolder (gameObject);
currentRemoteEventSystem.callRemoteEvent (remoteEventNameListOnGrabObject [i]);
}
}
}
currentGrabbedObjectState.setGrabbedState (true);
}
currentObject.tag = "Untagged";
grabbedObjectList.Add (newGrabbedObject);
}
}
currentObject.layer = ignoreRaycastLayerIndex;
//if there are not any object close to the player, cancel
if (grabbedObjectList.Count > 0) {
carryingObjects = true;
} else {
attractionActive = false;
}
currentRigidbody.useGravity = false;
powerSlider.maxValue = maxThrowForce;
//get the distance from every object to left and right side of the player, to set every side as parent of every object
//disable collisions between the player and the objects, to avoid issues
if (playerCollider != null) {
Physics.IgnoreCollision (currentCollider, playerCollider, true);
}
currentForceToLaunchObjects = 0;
}
}
//if any object grabbed has its own gravity, paused the script to move the object properly
artificialObjectGravity currentArtificialObjectGravity = currentObject.GetComponent<artificialObjectGravity> ();
//drop or throw the current grabbed objects
public void dropObjects ()
{
//get the point at which the camera is looking, to throw the objects in that direction
Vector3 hitDirection = Vector3.zero;
if (currentArtificialObjectGravity != null) {
currentArtificialObjectGravity.setActiveState (false);
}
bool surfaceFound = false;
grabObjectProperties currentGrabObjectProperties = currentObject.GetComponent<grabObjectProperties> ();
if (Physics.Raycast (mainCameraTransform.position, mainCameraTransform.forward, out hit, Mathf.Infinity, layerToDamage)) {
if (hit.collider != playerCollider) {
surfaceFound = true;
} else {
if (Physics.Raycast (hit.point + mainCameraTransform.forward, mainCameraTransform.forward, out hit, Mathf.Infinity, layerToDamage)) {
surfaceFound = true;
}
}
}
if (currentGrabObjectProperties != null) {
currentGrabObjectProperties.checkEventsOnGrabObject ();
}
if (surfaceFound) {
hitDirection = hit.point;
}
grabbedObjectState currentGrabbedObjectState = currentObject.GetComponent<grabbedObjectState> ();
for (int j = 0; j < grabbedObjectList.Count; j++) {
dropObject (grabbedObjectList [j], hitDirection);
}
if (currentGrabbedObjectState == null) {
currentGrabbedObjectState = currentObject.AddComponent<grabbedObjectState> ();
}
carryingObjects = false;
grabbedObjectList.Clear ();
objectToPlaceSystem currentObjectToPlaceSystem = currentObject.GetComponent<objectToPlaceSystem> ();
powerSlider.value = 0;
}
if (currentObjectToPlaceSystem != null) {
currentObjectToPlaceSystem.setObjectInGrabbedState (true);
}
public void addForceToLaunchObjects ()
{
if (currentForceToLaunchObjects < maxThrowForce) {
//enable the power slider in the center of the screen
currentForceToLaunchObjects += Time.deltaTime * increaseThrowForceSpeed;
//if any object is pickable and is inside an opened chest, activate its trigger or if it has been grabbed by the player, remove of the list
pickUpObject currentPickUpObject = currentObject.GetComponent<pickUpObject> ();
if (currentForceToLaunchObjects > 300) {
powerSlider.value = currentForceToLaunchObjects;
}
}
}
if (currentPickUpObject) {
currentPickUpObject.activateObjectTrigger ();
}
public void dropObject (grabbedObject currentGrabbedObject, Vector3 launchDirection)
{
GameObject currentObject = currentGrabbedObject.objectToMove;
deviceStringAction currentDeviceStringAction = currentObject.GetComponentInChildren<deviceStringAction> ();
Rigidbody currentRigidbody = currentGrabbedObject.mainRigidbody;
if (currentDeviceStringAction != null) {
currentDeviceStringAction.setIconEnabledState (false);
}
if (useRemoteEventOnObjectsFound) {
remoteEventSystem currentRemoteEventSystem = currentObject.GetComponent<remoteEventSystem> ();
if (currentGrabbedObjectState != null) {
currentGrabbedObjectState.setCurrentHolder (gameObject);
if (currentRemoteEventSystem != null) {
for (int i = 0; i < remoteEventNameListOnDropObject.Count; i++) {
currentGrabbedObjectState.setGrabbedState (true);
}
currentRemoteEventSystem.callRemoteEvent (remoteEventNameListOnDropObject [i]);
}
}
}
grabbedObjectList.Add (newGrabbedObject);
}
}
currentObject.transform.SetParent (null);
//if there are not any object close to the player, cancel
if (grabbedObjectList.Count > 0) {
carryingObjects = true;
} else {
attractionActive = false;
currentObject.tag = currentGrabbedObject.objectTag;
currentObject.layer = currentGrabbedObject.objectLayer;
stopUpdateCoroutine ();
}
//drop the objects, because the grab objects button has been pressed quickly
if (currentForceToLaunchObjects < 300) {
if (playerCollider != null) {
Physics.IgnoreCollision (currentObject.GetComponent<Collider> (), playerCollider, false);
}
}
//launch the objects according to the amount of time that the player has held the buttton
if (currentForceToLaunchObjects > 300) {
//if the objects are launched, add the script launchedObject, to damage any enemy that the object would touch
currentObject.AddComponent<launchedObjects> ().setCurrentPlayerAndCollider (playerGameObject, playerCollider);
powerSlider.maxValue = maxThrowForce;
//if there are any collider in from of the camera, use the hit point, else, use the camera direciton
if (launchDirection != Vector3.zero) {
Vector3 throwDirection = launchDirection - currentObject.transform.position;
throwDirection = throwDirection / throwDirection.magnitude;
currentRigidbody.AddForce (throwDirection * currentForceToLaunchObjects * currentRigidbody.mass);
} else {
currentRigidbody.AddForce (mainCameraTransform.TransformDirection (Vector3.forward) * currentForceToLaunchObjects * currentRigidbody.mass);
}
}
//set again the custom gravity of the object
artificialObjectGravity currentArtificialObjectGravity = currentObject.GetComponent<artificialObjectGravity> ();
currentForceToLaunchObjects = 0;
}
}
if (currentArtificialObjectGravity != null) {
currentArtificialObjectGravity.setActiveState (true);
}
grabObjectProperties currentGrabObjectProperties = currentObject.GetComponent<grabObjectProperties> ();
if (currentGrabObjectProperties != null) {
currentGrabObjectProperties.checkEventsOnDropObject ();
}
deviceStringAction currentDeviceStringAction = currentObject.GetComponentInChildren<deviceStringAction> ();
//drop or throw the current grabbed objects
public void dropObjects ()
{
//get the point at which the camera is looking, to throw the objects in that direction
Vector3 hitDirection = Vector3.zero;
if (currentDeviceStringAction != null) {
currentDeviceStringAction.setIconEnabledState (true);
}
objectToPlaceSystem currentObjectToPlaceSystem = currentObject.GetComponent<objectToPlaceSystem> ();
if (currentObjectToPlaceSystem != null) {
currentObjectToPlaceSystem.setObjectInGrabbedState (false);
}
bool surfaceFound = false;
grabbedObjectState currentGrabbedObjectState = currentObject.GetComponent<grabbedObjectState> ();
if (Physics.Raycast (mainCameraTransform.position, mainCameraTransform.forward, out hit, Mathf.Infinity, layerToDamage)) {
if (hit.collider != playerCollider) {
surfaceFound = true;
} else {
if (Physics.Raycast (hit.point + mainCameraTransform.forward, mainCameraTransform.forward, out hit, Mathf.Infinity, layerToDamage)) {
surfaceFound = true;
}
}
}
if (currentGrabbedObjectState != null) {
bool currentObjectWasInsideGravityRoom = currentGrabbedObjectState.isInsideZeroGravityRoom ();
if (surfaceFound) {
hitDirection = hit.point;
}
currentGrabbedObjectState.checkGravityRoomState ();
for (int j = 0; j < grabbedObjectList.Count; j++) {
dropObject (grabbedObjectList [j], hitDirection);
}
currentGrabbedObjectState.setGrabbedState (false);
carryingObjects = false;
grabbedObjectList.Clear ();
if (!currentObjectWasInsideGravityRoom) {
currentGrabbedObjectState.removeGrabbedObjectComponent ();
powerSlider.value = 0;
}
currentRigidbody.useGravity = true;
}
}
}
public void addForceToLaunchObjects ()
{
if (currentForceToLaunchObjects < maxThrowForce) {
//enable the power slider in the center of the screen
currentForceToLaunchObjects += Time.deltaTime * increaseThrowForceSpeed;
public void checkIfDropObject (GameObject objectToCheck)
{
for (int j = 0; j < grabbedObjectList.Count; j++) {
if (grabbedObjectList [j].objectToMove == objectToCheck) {
dropObject (grabbedObjectList [j], Vector3.zero);
if (currentForceToLaunchObjects > 300) {
grabbedObjectList [j].objectToMove = null;
powerSlider.value = currentForceToLaunchObjects;
}
}
}
return;
}
}
}
public void dropObject (grabbedObject currentGrabbedObject, Vector3 launchDirection)
{
GameObject currentObject = currentGrabbedObject.objectToMove;
void initializeComponents ()
{
if (componentsInitialized) {
return;
}
Rigidbody currentRigidbody = currentGrabbedObject.mainRigidbody;
if (mainPlayerWeaponSystem != null) {
playerGameObject = mainPlayerWeaponSystem.getPlayerWeaponsManger ().gameObject;
if (useRemoteEventOnObjectsFound) {
remoteEventSystem currentRemoteEventSystem = currentObject.GetComponent<remoteEventSystem> ();
playerComponentsManager mainPlayerComponentsManager = playerGameObject.GetComponent<playerComponentsManager> ();
if (currentRemoteEventSystem != null) {
for (int i = 0; i < remoteEventNameListOnDropObject.Count; i++) {
if (mainPlayerComponentsManager != null) {
playerCollider = mainPlayerComponentsManager.getPlayerController ().getMainCollider ();
currentRemoteEventSystem.callRemoteEvent (remoteEventNameListOnDropObject [i]);
}
}
}
mainCameraTransform = mainPlayerComponentsManager.getPlayerCamera ().getCameraTransform ();
}
}
currentObject.transform.SetParent (null);
componentsInitialized = true;
}
currentObject.tag = currentGrabbedObject.objectTag;
currentObject.layer = currentGrabbedObject.objectLayer;
[System.Serializable]
public class grabbedObject
{
public GameObject objectToMove;
public string objectTag;
public int objectLayer;
public Rigidbody mainRigidbody;
}
//drop the objects, because the grab objects button has been pressed quickly
if (currentForceToLaunchObjects < 300) {
if (playerCollider != null) {
Physics.IgnoreCollision (currentObject.GetComponent<Collider> (), playerCollider, false);
}
}
//launch the objects according to the amount of time that the player has held the buttton
if (currentForceToLaunchObjects > 300) {
//if the objects are launched, add the script launchedObject, to damage any enemy that the object would touch
currentObject.AddComponent<launchedObjects> ().setCurrentPlayerAndCollider (playerGameObject, playerCollider);
//if there are any collider in from of the camera, use the hit point, else, use the camera direciton
if (launchDirection != Vector3.zero) {
Vector3 throwDirection = launchDirection - currentObject.transform.position;
throwDirection = throwDirection / throwDirection.magnitude;
currentRigidbody.AddForce (throwDirection * currentForceToLaunchObjects * currentRigidbody.mass);
} else {
currentRigidbody.AddForce (mainCameraTransform.TransformDirection (Vector3.forward) * currentForceToLaunchObjects * currentRigidbody.mass);
}
}
//set again the custom gravity of the object
artificialObjectGravity currentArtificialObjectGravity = currentObject.GetComponent<artificialObjectGravity> ();
if (currentArtificialObjectGravity != null) {
currentArtificialObjectGravity.setActiveState (true);
}
grabObjectProperties currentGrabObjectProperties = currentObject.GetComponent<grabObjectProperties> ();
if (currentGrabObjectProperties != null) {
currentGrabObjectProperties.checkEventsOnDropObject ();
}
deviceStringAction currentDeviceStringAction = currentObject.GetComponentInChildren<deviceStringAction> ();
if (currentDeviceStringAction != null) {
currentDeviceStringAction.setIconEnabledState (true);
}
objectToPlaceSystem currentObjectToPlaceSystem = currentObject.GetComponent<objectToPlaceSystem> ();
if (currentObjectToPlaceSystem != null) {
currentObjectToPlaceSystem.setObjectInGrabbedState (false);
}
grabbedObjectState currentGrabbedObjectState = currentObject.GetComponent<grabbedObjectState> ();
if (currentGrabbedObjectState != null) {
bool currentObjectWasInsideGravityRoom = currentGrabbedObjectState.isInsideZeroGravityRoom ();
currentGrabbedObjectState.checkGravityRoomState ();
currentGrabbedObjectState.setGrabbedState (false);
if (!currentObjectWasInsideGravityRoom) {
currentGrabbedObjectState.removeGrabbedObjectComponent ();
currentRigidbody.useGravity = true;
}
}
}
public void checkIfDropObject (GameObject objectToCheck)
{
for (int j = 0; j < grabbedObjectList.Count; j++) {
if (grabbedObjectList [j].objectToMove == objectToCheck) {
dropObject (grabbedObjectList [j], Vector3.zero);
grabbedObjectList [j].objectToMove = null;
return;
}
}
}
void initializeComponents ()
{
if (componentsInitialized) {
return;
}
if (mainPlayerWeaponSystem != null) {
playerGameObject = mainPlayerWeaponSystem.getPlayerWeaponsManger ().gameObject;
playerComponentsManager mainPlayerComponentsManager = playerGameObject.GetComponent<playerComponentsManager> ();
if (mainPlayerComponentsManager != null) {
playerCollider = mainPlayerComponentsManager.getPlayerController ().getMainCollider ();
mainCameraTransform = mainPlayerComponentsManager.getPlayerCamera ().getCameraTransform ();
}
}
componentsInitialized = true;
}
[System.Serializable]
public class grabbedObject
{
public GameObject objectToMove;
public string objectTag;
public int objectLayer;
public Rigidbody mainRigidbody;
}
}

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/New Weapon Behaviors/attrackObjectsSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/New Weapon Behaviors/dragObjectSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/New Weapon Behaviors/flamethrowerWeapon.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/New Weapon Behaviors/flashlight.cs
uploadId: 814740
uploadId: 889948

View File

@@ -444,6 +444,16 @@ public class gravityGun : MonoBehaviour
}
}
objectToPlaceSystem currentObjectToPlaceSystem = objectHeld.GetComponent<objectToPlaceSystem> ();
if (currentObjectToPlaceSystem != null) {
if (currentObjectToPlaceSystem.isAdjustingObjectToPlaceInProcess ()) {
objectHeld = null;
return;
}
}
if (currentGrabObjectProperties != null) {
if (currentGrabObjectProperties.useExtraGrabDistance) {
currentGrabExtraDistance = currentGrabObjectProperties.getExtraGrabDistance ();
@@ -499,8 +509,6 @@ public class gravityGun : MonoBehaviour
currentGrabObjectEventSystem.callEventOnGrab ();
}
objectToPlaceSystem currentObjectToPlaceSystem = objectHeld.GetComponent<objectToPlaceSystem> ();
if (currentObjectToPlaceSystem != null) {
currentObjectToPlaceSystem.setObjectInGrabbedState (true);
}
@@ -656,6 +664,8 @@ public class gravityGun : MonoBehaviour
}
}
objectToPlaceSystem currentObjectToPlaceSystem = null;
if (objectHeld != null) {
//set the tag of the object that had before grab it, and if the object has its own gravity, enable again
if (grabbedObjectTagLayerStored) {
@@ -735,7 +745,7 @@ public class gravityGun : MonoBehaviour
}
}
objectToPlaceSystem currentObjectToPlaceSystem = objectHeld.GetComponent<objectToPlaceSystem> ();
currentObjectToPlaceSystem = objectHeld.GetComponent<objectToPlaceSystem> ();
if (currentObjectToPlaceSystem != null) {
currentObjectToPlaceSystem.setObjectInGrabbedState (false);
@@ -762,6 +772,10 @@ public class gravityGun : MonoBehaviour
if (showDebugPrint) {
print ("drop object");
}
if (currentObjectToPlaceSystem != null) {
currentObjectToPlaceSystem.checkObjectsAround ();
}
}
public void checkJointsInObject (GameObject objectToThrow, float force)

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/New Weapon Behaviors/gravityGun.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/New Weapon Behaviors/healerWeapon.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/New Weapon Behaviors/plasmaCutterSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -12,7 +12,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/New Weapon Behaviors/simpleChainSaw.cs
uploadId: 814740
uploadId: 889948

View File

@@ -417,6 +417,8 @@ public class sliceObject : MonoBehaviour
currentSurfaceToSlice.checkEventBeforeSlice ();
currentSurfaceToSlice.checkEventsOnIgnoreDestroyOriginalObject ();
currentSurfaceToSlice.getMainSimpleSliceSystem ().activateSlice (objectCollider,
positionInWorldSpace, normalInWorldSpace, slicePosition, updateLastObjectSpeed, lastSpeed);
@@ -447,6 +449,8 @@ public class sliceObject : MonoBehaviour
currentSurfaceToSlice.checkEventBeforeSlice ();
currentSurfaceToSlice.checkEventsOnIgnoreDestroyOriginalObject ();
obj = currentSurfaceToSlice.getMainSurfaceToSlice ();
// slice the provided object using the transforms of this object
@@ -603,6 +607,11 @@ public class sliceObject : MonoBehaviour
// obj.SetActive (false);
lastTimeSlice = Time.time;
if (currentSurfaceToSlice.useEventToSendNewSlicedParts) {
currentSurfaceToSlice.eventToSendNewSlicedParts.Invoke (object1);
currentSurfaceToSlice.eventToSendNewSlicedParts.Invoke (object2);
}
}
}
}

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/New Weapon Behaviors/sliceObject.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/New Weapon Behaviors/smartphoneDevice.cs
uploadId: 814740
uploadId: 889948

View File

@@ -91,7 +91,7 @@ public class surfaceToSlice : MonoBehaviour
public float timeScale = 0.2f;
[Space]
[Header ("Debug")]
[Header ("Other Settings")]
[Space]
public bool destroySlicedPartsAfterDelay;
@@ -119,6 +119,16 @@ public class surfaceToSlice : MonoBehaviour
public bool useEventBeforeCut;
public UnityEvent eventBeforeCut;
[Space]
public bool ignoreDestroyOriginalObject;
public UnityEvent eventsOnIgnoreDestroyOriginalObject;
[Space]
public bool useEventToSendNewSlicedParts;
public eventParameters.eventToCallWithGameObject eventToSendNewSlicedParts;
float lastTimeSliced;
@@ -127,6 +137,13 @@ public class surfaceToSlice : MonoBehaviour
bool mainDestroyGameObjectAssigned;
public void checkEventsOnIgnoreDestroyOriginalObject ()
{
if (ignoreDestroyOriginalObject) {
eventsOnIgnoreDestroyOriginalObject.Invoke ();
}
}
public void checkEventBeforeSlice ()
{
if (useEventBeforeCut) {
@@ -309,6 +326,13 @@ public class surfaceToSlice : MonoBehaviour
}
}
public void setMainSimpleSliceSystemCheckingNotNull (GameObject newObject)
{
setMainSimpleSliceSystem (newObject);
cutSurfaceEnabled = (mainSimpleSliceSystem != null);
}
public void setDestructionPending (bool state)
{
if (!mainSimpleSliceSystemAssigned) {

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/New Weapon Behaviors/surfaceToSlice.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/New Weapon Behaviors/vacuumGun.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/New Weapon Behaviors/weaponLaser.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Projectiles/arrowProjectile.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Projectiles/audioClipBip.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Projectiles/dissolveProjectile.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Projectiles/laserMine.cs
uploadId: 814740
uploadId: 889948

View File

@@ -263,6 +263,8 @@ public class plasmaCutterProjectile : projectileSystem
currentSurfaceToSlice.checkEventBeforeSlice ();
currentSurfaceToSlice.checkEventsOnIgnoreDestroyOriginalObject ();
currentSurfaceToSlice.getMainSimpleSliceSystem ().activateSlice (objectCollider, positionInWorldSpace,
normalInWorldSpace, slicePosition, updateLastObjectSpeed, lastSpeed);
@@ -284,6 +286,8 @@ public class plasmaCutterProjectile : projectileSystem
currentSurfaceToSlice.checkEventBeforeSlice ();
currentSurfaceToSlice.checkEventsOnIgnoreDestroyOriginalObject ();
objectToCheck = currentSurfaceToSlice.getMainSurfaceToSlice ();
// slice the provided objectToCheck ect using the transforms of this object
@@ -416,6 +420,11 @@ public class plasmaCutterProjectile : projectileSystem
}
objectToCheck.SetActive (false);
if (currentSurfaceToSlice.useEventToSendNewSlicedParts) {
currentSurfaceToSlice.eventToSendNewSlicedParts.Invoke (object1);
currentSurfaceToSlice.eventToSendNewSlicedParts.Invoke (object2);
}
}
}
}

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Projectiles/plasmaCutterProjectile.cs
uploadId: 814740
uploadId: 889948

View File

@@ -27,6 +27,8 @@ public class projectileInfo
public bool useFakeProjectileTrails;
public bool ignoreUseTrailRenderer;
public float projectileDamage;
public float projectileSpeed;
public float impactForceApplied;
@@ -197,6 +199,8 @@ public class projectileInfo
useFakeProjectileTrails = newInfo.useFakeProjectileTrails;
ignoreUseTrailRenderer = newInfo.ignoreUseTrailRenderer;
projectileDamage = newInfo.projectileDamage;
projectileSpeed = newInfo.projectileSpeed;
impactForceApplied = newInfo.impactForceApplied;

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Projectiles/projectileInfo.cs
uploadId: 814740
uploadId: 889948

View File

@@ -126,6 +126,10 @@ public class projectileSystem : MonoBehaviour
public bool projectileInitialized;
bool ignoreUseTrailRenderer;
Transform currentTargetTransform;
Vector3 targetPosition;
@@ -985,6 +989,8 @@ public class projectileSystem : MonoBehaviour
noImpactDisableTimer = currentProjectileInfo.noImpactDisableTimer;
ignoreUseTrailRenderer = currentProjectileInfo.ignoreUseTrailRenderer;
lastTimeFired = Time.time;
}
@@ -1485,6 +1491,10 @@ public class projectileSystem : MonoBehaviour
public void enableOrDisableMainTrailRenderer (bool state)
{
if (ignoreUseTrailRenderer) {
return;
}
getProjectileTrailRenderer ();
if (mainTrailRendererAssigned) {
@@ -1661,6 +1671,10 @@ public class projectileSystem : MonoBehaviour
void getProjectileTrailRenderer ()
{
if (ignoreUseTrailRenderer) {
return;
}
if (!mainTrailRendererAssigned) {
mainTrailRendererAssigned = mainTrailRenderer != null;
@@ -1783,8 +1797,10 @@ public class projectileSystem : MonoBehaviour
setProjectileParent (null);
}
if (mainTrailRendererAssigned) {
mainTrailRenderer.Clear ();
if (!ignoreUseTrailRenderer) {
if (mainTrailRendererAssigned) {
mainTrailRenderer.Clear ();
}
}
impactParticlesAssigned = false;

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Projectiles/projectileSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Projectiles/spearProjectile.cs
uploadId: 814740
uploadId: 889948

View File

@@ -40,6 +40,10 @@ public class taserProjectile : projectileSystem
setProjectileUsedState (true);
setProjectileScorch ();
//creatImpactParticles ();
//set the bullet kinematic
objectToDamage = col.GetComponent<Collider> ().gameObject;

View File

@@ -12,7 +12,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Projectiles/taserProjectile.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Scriptable Objects/objectTransformData.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Scriptable Objects/objectTransformInfo.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/addGrenadeToThrowAwayFromCharacter.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/armorSurfaceSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/arrowManager.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/bowHolderSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/bowSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -12,7 +12,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/dynamicReticleSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/fakeProjectileTrailSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -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> ();

View File

@@ -9,7 +9,8 @@ DefaultImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/playerWeaponSystem.cs.bak
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/playerWeaponSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -884,7 +884,7 @@ public class playerWeaponsManager : MonoBehaviour
!currentIKWeapon.isReloadingWeapon () &&
!weaponsAreMoving ()) {
int currentNumberInput = playerInput.checkNumberInput (weaponsSlotsAmount);
int currentNumberInput = checkNumberInput (weaponsSlotsAmount);
if (currentNumberInput > -1) {
if (canUseInput ()) {
@@ -2718,6 +2718,11 @@ public class playerWeaponsManager : MonoBehaviour
}
}
public int checkNumberInput (int numberAmount)
{
return playerInput.checkNumberInput (numberAmount);
}
public bool isPlayerOnGround ()
{
return playerOnGround;
@@ -3997,11 +4002,47 @@ public class playerWeaponsManager : MonoBehaviour
return "";
}
public string getWeaponAmmoNameByWeaponName (string weaponName)
{
updateWeaponListCount ();
for (int k = 0; k < weaponListCount; k++) {
if (showDebugLog) {
print (weaponsList [k].getWeaponName () + " " + weaponName);
}
if (weaponsList [k].getWeaponName ().Equals (weaponName)) {
return weaponsList [k].getWeaponAmmoName ();
}
}
return "";
}
public string getCurrentWeaponName ()
{
return currentWeaponName;
}
public int getWeaponOriginalClipSize (string weaponName)
{
updateWeaponListCount ();
for (int k = 0; k < weaponListCount; k++) {
if (showDebugLog) {
print (weaponsList [k].getWeaponName () + " " + weaponName);
}
if (weaponsList [k].getWeaponName ().Equals (weaponName)) {
return weaponsList [k].getWeaponOriginalClipSize ();
}
}
return -1;
}
public bool canWeaponsBeStolenFromCharacter ()
{
return weaponsCanBeStolenFromCharacter;
@@ -4796,6 +4837,19 @@ public class playerWeaponsManager : MonoBehaviour
}
}
public void updateWeaponsParentsInRuntime (Transform parent, Animator mainAnimtor)
{
updateWeaponListCount ();
for (int k = 0; k < weaponListCount; k++) {
IKWeaponSystem currentWeapon = weaponsList [k];
currentWeapon.setHandTransform (rightHandTransform, leftHandTransform, rightHandMountPoint, leftHandMountPoint);
currentWeapon.getWeaponSystemManager ().updateWeaponParentInRuntime (parent, mainAnimtor);
}
}
public void checkWeaponStateOnEmptyAmmo ()
{
if (removeCurrentWeaponAsNotUsableIfAmmoEmptyEnabled) {
@@ -5109,6 +5163,10 @@ public class playerWeaponsManager : MonoBehaviour
targetRotation = 0;
} else {
targetRotation = newWeapon.extraRotation;
if (!ignoreNewAnimatorWeaponIDSettings && newWeapon.setNewAnimatorWeaponID) {
targetRotation = 0;
}
}
setUpperBodyBendingMultiplier = newWeapon.setUpperBodyBendingMultiplier;
@@ -5242,6 +5300,11 @@ public class playerWeaponsManager : MonoBehaviour
return ignoreNewAnimatorWeaponIDSettings;
}
public void setIgnoreNewAnimatorWeaponIDSettingsState (bool state)
{
ignoreNewAnimatorWeaponIDSettings = state;
}
//used in third person to enable or disable the player's spine rotation
public void activateOrDeactivateAimMode (bool state)
{
@@ -7314,6 +7377,47 @@ public class playerWeaponsManager : MonoBehaviour
originalWeaponsRotationFirstPerson = weaponsTransformInFirstPerson.localRotation;
}
public void resetWeaponsTransformInThirdPersonToPlayerPosition ()
{
weaponsTransformInThirdPerson.position = transform.position;
weaponsTransformInThirdPerson.rotation = transform.rotation;
}
public void resetWeaponsParentToPlayerPosition ()
{
weaponsParent.position = transform.position;
weaponsParent.rotation = transform.rotation;
}
public void updateWeaponsParentAndLocalPosition ()
{
bool isFirstPerson = isFirstPersonActive ();
if (isFirstPerson) {
weaponsParent.SetParent (firstPersonParent);
//weaponsParent.localRotation = originalWeaponsRotationFirstPerson;
//weaponsParent.localPosition = originalWeaponsPositionFirstPerson;
} else {
if (fullBodyAwarenessActive) {
weaponsParent.SetParent (currentPivotCameraTransform);
weaponsParent.localRotation = Quaternion.identity;
weaponsParent.localPosition = fullBodyAwarenessWeaponsParentOffsetPosition;
} else {
weaponsParent.SetParent (thirdPersonParent);
//weaponsParent.localPosition = originalWeaponsPositionThirdPerson;
//weaponsParent.localRotation = originalWeaponsRotationThirdPerson;
}
}
if (Application.isPlaying) {
getComponents ();
}
}
public Transform getTemporalParentForWeapons ()
{
return temporalParentForWeapons;
@@ -7455,6 +7559,10 @@ public class playerWeaponsManager : MonoBehaviour
updateWeaponListCount ();
string ignoreRaycastLayer = "Ignore Raycast";
int ignoreRaycastLayerIndex = LayerMask.NameToLayer (ignoreRaycastLayer);
for (int k = 0; k < weaponListCount; k++) {
playerWeaponSystem currentPlayerWeaponSystem = weaponsList [k].getWeaponSystemManager ();
@@ -7462,8 +7570,9 @@ public class playerWeaponsManager : MonoBehaviour
if (!isFullBodyAwarenessActive () && !playerCameraManager.isFullBodyAwarenessEnabled ()) {
Component [] components = currentPlayerWeaponSystem.weaponSettings.weaponMesh.GetComponentsInChildren (typeof (Transform));
foreach (Transform child in components) {
if (!child.gameObject.layer.Equals (newLayerIndex)) {
if (!child.gameObject.layer.Equals (newLayerIndex) && !child.gameObject.layer.Equals (ignoreRaycastLayerIndex)) {
child.gameObject.layer = newLayerIndex;
}
}
@@ -7527,15 +7636,21 @@ public class playerWeaponsManager : MonoBehaviour
string newLayer = "Default";
int newLayerIndex = LayerMask.NameToLayer (newLayer);
if (firstPersonActive) {
newLayer = weaponsLayer;
}
int newLayerIndex = LayerMask.NameToLayer (newLayer);
string ignoreRaycastLayer = "Ignore Raycast";
int ignoreRaycastLayerIndex = LayerMask.NameToLayer (ignoreRaycastLayer);
Component [] components = weaponPart.GetComponentsInChildren (typeof (Transform));
foreach (Component c in components) {
if (!c.gameObject.layer.Equals (newLayerIndex)) {
if (!c.gameObject.layer.Equals (newLayerIndex) && !c.gameObject.layer.Equals (ignoreRaycastLayerIndex)) {
c.gameObject.layer = newLayerIndex;
}
}
@@ -10100,6 +10215,13 @@ public class playerWeaponsManager : MonoBehaviour
}
}
public void stopAimIfActive ()
{
if (isAimingWeapons ()) {
setAimWeaponState (false);
}
}
public void setAimWeaponState (bool aimingWeapon)
{
setAimModeInputPressedState (aimingWeapon);
@@ -11320,6 +11442,14 @@ public class playerWeaponsManager : MonoBehaviour
//EDITOR FUNCTIONS
public void setIgnoreNewAnimatorWeaponIDSettingsStateFromEditor (bool state)
{
setIgnoreNewAnimatorWeaponIDSettingsState (state);
updateComponent (true);
}
public void instantiateUsableWeaponPrefabInfoListFromEditor ()
{
if (useUsableWeaponPrefabInfoList) {
@@ -11710,15 +11840,20 @@ public class playerWeaponsManager : MonoBehaviour
for (int k = 0; k < weaponListCount; k++) {
if (weaponsList [k] != null) {
weaponTransformInfoSystem currentweaponTransformInfoSystem = weaponsList [k].gameObject.GetComponent<weaponTransformInfoSystem> ();
weaponTransformInfoSystem currentWeaponTransformInfoSystem = weaponsList [k].gameObject.GetComponent<weaponTransformInfoSystem> ();
if (currentweaponTransformInfoSystem != null) {
currentweaponTransformInfoSystem.setCurrentOffsetParentOnThirdPersonWithOffsetValue (currentOffsetParentThirdPerson);
if (currentWeaponTransformInfoSystem != null) {
currentWeaponTransformInfoSystem.setCurrentOffsetParentOnThirdPersonWithOffsetValue (currentOffsetParentThirdPerson);
}
}
}
}
public void setCurrentOffsetParentThirdPersonValues (Vector3 newValue)
{
currentOffsetParentThirdPerson = newValue;
}
public void adjustDrawKeepPositionToWeaponPositionOnAllWeapons ()
{
weaponListCount = weaponsList.Count;
@@ -11734,6 +11869,29 @@ public class playerWeaponsManager : MonoBehaviour
}
}
public void setWeaponMeshScaleOnAllWeapons (float newValue)
{
weaponListCount = weaponsList.Count;
for (int k = 0; k < weaponListCount; k++) {
if (weaponsList [k] != null) {
weaponsList [k].setWeaponMeshScale (newValue);
}
}
}
public void adjustAllFireWeaponTransformReferencePositionOnAllWeapons (float newValue)
{
weaponListCount = weaponsList.Count;
for (int k = 0; k < weaponListCount; k++) {
if (weaponsList [k] != null) {
weaponsList [k].adjustAllFireWeaponTransformReferencePosition (newValue);
}
}
}
public void setWeaponsHUDEnabledStateFromEditor (bool state)
{
setWeaponsHUDEnabledState (state);

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/playerWeaponsManager.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/projectileImpactSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/projectilesOnCharacterBodyManager.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/simpleSniperSightSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/simpleWeaponSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/throwGrenadeSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/weaponAmmoUsingPlayerStat.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/weaponAnimatorSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/weaponBuilder.cs
uploadId: 814740
uploadId: 889948

View File

@@ -29,6 +29,8 @@ public class weaponInfo
public bool useFakeProjectileTrails;
public bool ignoreUseTrailRenderer;
public bool fireWeaponForward;
public bool useRaycastCheckingOnRigidbody;

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/weaponInfo.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/weaponListManager.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/weaponObjectInfo.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/weaponPartstToRemoveOnPickupCreation.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/weaponShellSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/weaponSlotElement.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/weaponSwayInfo.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/weaponSystem.cs
uploadId: 814740
uploadId: 889948

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/weaponTransformData.cs
uploadId: 814740
uploadId: 889948

View File

@@ -146,11 +146,15 @@ public class weaponTransformInfoSystem : MonoBehaviour
Vector3 weaponPosition = mainWeaponTransform.position;
Quaternion weaponRotation = mainWeaponTransform.rotation;
currentIKWeaponSystem.thirdPersonWeaponInfo.keepPosition.position = weaponPosition;
currentIKWeaponSystem.thirdPersonWeaponInfo.keepPosition.rotation = weaponRotation;
if (currentIKWeaponSystem.thirdPersonWeaponInfo.keepPosition != null) {
currentIKWeaponSystem.thirdPersonWeaponInfo.keepPosition.position = weaponPosition;
currentIKWeaponSystem.thirdPersonWeaponInfo.keepPosition.rotation = weaponRotation;
}
currentIKWeaponSystem.firstPersonWeaponInfo.keepPosition.position = weaponPosition;
currentIKWeaponSystem.firstPersonWeaponInfo.keepPosition.rotation = weaponRotation;
if (currentIKWeaponSystem.firstPersonWeaponInfo.keepPosition != null) {
currentIKWeaponSystem.firstPersonWeaponInfo.keepPosition.position = weaponPosition;
currentIKWeaponSystem.firstPersonWeaponInfo.keepPosition.rotation = weaponRotation;
}
}
GKC_Utils.updateDirtyScene ("Adjust Draw Keep Position To Weapon Position ", gameObject);

View File

@@ -13,7 +13,8 @@ MonoImporter:
AssetOrigin:
serializedVersion: 1
productId: 40995
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
packageVersion: 3.77g
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
2.5D
packageVersion: 3.77h
assetPath: Assets/Game Kit Controller/Scripts/Weapons/weaponTransformInfoSystem.cs
uploadId: 814740
uploadId: 889948