add some extra assets FX and SFX
This commit is contained in:
@@ -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/Player/AddPlayerSpawned.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Animator IK/IKFootSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Animator IK/IKSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Animator IK/OnAnimatorIKComponent.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Animator IK/handsOnMeleeWeaponIKSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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/Player/Animator IK/handsOnSurfaceIKSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Animator IK/simpleIKHand.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -0,0 +1,495 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
|
||||
public class adjustCharacterHeightSystem : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public bool adjustCharacterHeight;
|
||||
public float characterHeight = 2;
|
||||
|
||||
public bool setCharacterModelScale;
|
||||
public float characterModelScale = 1;
|
||||
|
||||
public bool resetMountPointLocalPositions;
|
||||
|
||||
[Space]
|
||||
|
||||
public float capsuleHeight = 2;
|
||||
public float capsuleRadius = 0.3f;
|
||||
public float capsuleHeightOnCrouch = 1;
|
||||
|
||||
[Space]
|
||||
|
||||
public float characterRadius;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool enableHeadTrack;
|
||||
|
||||
[Space]
|
||||
[Header ("Camera Settings")]
|
||||
[Space]
|
||||
|
||||
public List<cameraStateHeightInfo> cameraStateHeightInfoList = new List<cameraStateHeightInfo> ();
|
||||
|
||||
[Space]
|
||||
[Header ("Character Transform Parts Settings")]
|
||||
[Space]
|
||||
|
||||
public List<transformPartInfo> transformPartInfoList = new List<transformPartInfo> ();
|
||||
|
||||
[Space]
|
||||
[Header ("Fire Weapons Settings")]
|
||||
[Space]
|
||||
|
||||
public bool applyScaleToFireWeapons;
|
||||
public float scaleForFireWeapons;
|
||||
|
||||
public Vector3 offsetParentThirdPerson;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool setFixedOffsetParentThirdPerson;
|
||||
public Vector3 fixedOffsetParentThirdPerson;
|
||||
|
||||
[Space]
|
||||
|
||||
public float fireWeaponTransformReferenceScale = 1;
|
||||
|
||||
[Space]
|
||||
[Header ("Melee Weapons Settings")]
|
||||
[Space]
|
||||
|
||||
public bool applyScaleToMeleeWapons;
|
||||
public float scaleForMeleeWeapons;
|
||||
|
||||
public bool placeTriggerInFrontOfCharacterOnAllMeleeAttacks;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool useExtraTriggerMultiplierScaleOnAllMeleeAttacksActive;
|
||||
public float extraTriggerMultiplierScaleOnAllMeleeAttacksAmount;
|
||||
|
||||
[Space]
|
||||
[Header ("Close Combat Settings")]
|
||||
[Space]
|
||||
|
||||
public bool setNewCloseCombatTriggerRadius;
|
||||
public float newCloseCombatTriggerRadius;
|
||||
|
||||
public bool placeTriggerInFrontOfCharacterOnAllCloseCombatAttacks;
|
||||
|
||||
[Space]
|
||||
[Header ("AI Settings")]
|
||||
[Space]
|
||||
|
||||
public bool characterIsAI;
|
||||
public bool characterUsesExtraColliders;
|
||||
public List<Collider> extraColliderList = new List<Collider> ();
|
||||
|
||||
[Space]
|
||||
|
||||
public bool useNewMinDistanceToTarget;
|
||||
public float newMinDistanceToEnemyUsingCloseCombat;
|
||||
public float newMinDistanceToCloseCombat;
|
||||
|
||||
[Space]
|
||||
|
||||
public float newMinDistanceToMelee;
|
||||
|
||||
public float newMinDistanceToEnemyUsingMelee;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool setNewAgentRadius;
|
||||
public float newAgentRadius;
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
|
||||
public playerComponentsManager mainPlayerComponentsManager;
|
||||
public playerController mainPlayerController;
|
||||
public playerCamera mainPlayerCamera;
|
||||
public playerWeaponsManager mainPlayerWeaponsManager;
|
||||
public meleeWeaponsGrabbedManager mainMeleeWeaponsGrabbedManager;
|
||||
public bodyMountPointsSystem mainBodyMountPointSystem;
|
||||
public buildPlayer mainBuildPlayer;
|
||||
public headTrack mainHeadTrack;
|
||||
public IKSystem mainIKSystem;
|
||||
public health mainHealth;
|
||||
public closeCombatSystem mainCloseCombatSystem;
|
||||
|
||||
public findObjectivesSystem mainFindObjectivesSystem;
|
||||
public AINavMesh mainAINavmesh;
|
||||
|
||||
bool adjustingHeighValueOnRuntimeActive;
|
||||
|
||||
bool applicationisPlaying;
|
||||
|
||||
|
||||
void Start ()
|
||||
{
|
||||
if (characterUsesExtraColliders) {
|
||||
int extraColliderListCount = extraColliderList.Count;
|
||||
|
||||
for (int i = 0; i < extraColliderListCount; i++) {
|
||||
mainPlayerController.setIgnoreCollisionOnExternalCollider (extraColliderList [i], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void adjustHeightValueInRuntime ()
|
||||
{
|
||||
updateApplicationisPlayingValue ();
|
||||
|
||||
adjustingHeighValueOnRuntimeActive = true;
|
||||
|
||||
adjustHeightValue ();
|
||||
|
||||
adjustCameraStates ();
|
||||
|
||||
adjustFireWeaponsScale ();
|
||||
|
||||
if (setFixedOffsetParentThirdPerson) {
|
||||
Vector3 previousOffsetParentThirdPerson = offsetParentThirdPerson;
|
||||
|
||||
offsetParentThirdPerson = fixedOffsetParentThirdPerson;
|
||||
|
||||
adjustFireWeaponsOffset ();
|
||||
|
||||
adjustFireWeaponsTransformReferences ();
|
||||
|
||||
offsetParentThirdPerson = previousOffsetParentThirdPerson;
|
||||
}
|
||||
|
||||
adjustingHeighValueOnRuntimeActive = false;
|
||||
}
|
||||
|
||||
|
||||
public void adjustHeightValue ()
|
||||
{
|
||||
getComponents ();
|
||||
|
||||
bool resetWeaponsTransformResult = false;
|
||||
|
||||
if (setCharacterModelScale) {
|
||||
//unpack the character to avoid issues with the prefab
|
||||
if (!adjustingHeighValueOnRuntimeActive) {
|
||||
GKC_Utils.unpackPrefabObjectByCheckingTransformRoot (mainPlayerController.gameObject);
|
||||
}
|
||||
|
||||
//put all the internal objects that are inside the body into a temporal transform
|
||||
mainBodyMountPointSystem.removeCharacterBodyMountPointsToTemporalParent (transform);
|
||||
|
||||
Transform mainCOMTransform = mainIKSystem.getIKBodyCOM ();
|
||||
|
||||
Transform characterCOMChild = null;
|
||||
|
||||
if (mainCOMTransform != null && mainCOMTransform.childCount > 0) {
|
||||
characterCOMChild = mainCOMTransform.GetChild (0);
|
||||
}
|
||||
|
||||
if (characterCOMChild != null) {
|
||||
characterCOMChild.localScale = Vector3.one * characterModelScale;
|
||||
}
|
||||
|
||||
//put back all the mount points back to the character's body
|
||||
mainBodyMountPointSystem.setCharacterBodyMountPointsInfoList ();
|
||||
|
||||
mainPlayerController.setCharacterCustomScale (characterModelScale);
|
||||
|
||||
resetWeaponsTransformResult = true;
|
||||
}
|
||||
|
||||
if (adjustCharacterHeight) {
|
||||
resetWeaponsTransformResult = true;
|
||||
}
|
||||
|
||||
if (resetMountPointLocalPositions) {
|
||||
mainBodyMountPointSystem.resetCharacterBodyMountPointsLocalPositions ();
|
||||
}
|
||||
|
||||
adjustTransformParts ();
|
||||
|
||||
if (resetWeaponsTransformResult) {
|
||||
mainPlayerWeaponsManager.resetWeaponsParentToPlayerPosition ();
|
||||
mainPlayerWeaponsManager.resetWeaponsTransformInThirdPersonToPlayerPosition ();
|
||||
}
|
||||
|
||||
mainPlayerController.setPlayerCapsuleColliderRadius (capsuleRadius);
|
||||
|
||||
mainPlayerController.setPlayerColliderCapsuleScaleWithCenterAsRadius (capsuleHeight);
|
||||
|
||||
mainPlayerController.setCapsuleHeightOnCrouch (capsuleHeightOnCrouch);
|
||||
|
||||
mainPlayerController.setCharacterRadius (characterRadius);
|
||||
|
||||
if (enableHeadTrack) {
|
||||
mainHeadTrack.setHeadTrackEnabledState (true);
|
||||
}
|
||||
|
||||
if (characterIsAI) {
|
||||
if (setNewAgentRadius) {
|
||||
NavMeshAgent currenAgent = mainAINavmesh.getAgent ();
|
||||
|
||||
currenAgent.radius = newAgentRadius;
|
||||
|
||||
currenAgent.height = characterHeight;
|
||||
}
|
||||
}
|
||||
|
||||
if (characterUsesExtraColliders) {
|
||||
int extraColliderListCount = extraColliderList.Count;
|
||||
|
||||
int characterLayer = mainPlayerController.getCharacterLayer ();
|
||||
|
||||
for (int i = 0; i < extraColliderListCount; i++) {
|
||||
mainPlayerController.addOrRemoveExtraColliders (extraColliderList [i], true);
|
||||
|
||||
extraColliderList [i].gameObject.layer = characterLayer;
|
||||
|
||||
mainCloseCombatSystem.addOrRemoveObjectToIgnoreByHitTriggers (extraColliderList [i].gameObject, true);
|
||||
|
||||
characterDamageReceiver currentDamageReceiverToCheck = extraColliderList [i].GetComponent<characterDamageReceiver> ();
|
||||
|
||||
if (currentDamageReceiverToCheck != null) {
|
||||
currentDamageReceiverToCheck.setCharacter (mainPlayerController.gameObject, mainHealth);
|
||||
|
||||
mainHealth.addDamageReceiverGameObjectList (currentDamageReceiverToCheck.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
if (adjustingHeighValueOnRuntimeActive) {
|
||||
for (int i = 0; i < extraColliderListCount; i++) {
|
||||
mainPlayerController.setIgnoreCollisionOnExternalCollider (extraColliderList [i], true);
|
||||
}
|
||||
}
|
||||
|
||||
mainAINavmesh.setCheckForExtraCollidersOnOwnerIfDetectedStateFromEditor (true);
|
||||
|
||||
mainFindObjectivesSystem.setCheckForExtraCollidersOnOwnerIfDetectedStateFromEditor (true);
|
||||
}
|
||||
|
||||
if (setNewCloseCombatTriggerRadius) {
|
||||
mainCloseCombatSystem.updateHitCombatTriggerRadius (newCloseCombatTriggerRadius);
|
||||
}
|
||||
|
||||
if (useNewMinDistanceToTarget) {
|
||||
if (newMinDistanceToEnemyUsingCloseCombat > 0) {
|
||||
mainFindObjectivesSystem.setNewMinDistanceToEnemyUsingCloseCombat (newMinDistanceToEnemyUsingCloseCombat);
|
||||
}
|
||||
|
||||
if (newMinDistanceToCloseCombat > 0) {
|
||||
mainFindObjectivesSystem.setNewMinDistanceToCloseCombat (newMinDistanceToCloseCombat);
|
||||
}
|
||||
|
||||
if (newMinDistanceToMelee > 0) {
|
||||
mainFindObjectivesSystem.setNewMinDistanceToMelee (newMinDistanceToMelee);
|
||||
}
|
||||
|
||||
if (newMinDistanceToEnemyUsingMelee > 0) {
|
||||
mainFindObjectivesSystem.setMinDistanceToEnemyUsingMelee (newMinDistanceToEnemyUsingMelee);
|
||||
}
|
||||
}
|
||||
|
||||
mainHealth.setSliderOffset (characterHeight + 0.5f);
|
||||
|
||||
if (applyScaleToMeleeWapons) {
|
||||
mainMeleeWeaponsGrabbedManager.setWeaponMeshScaleOnAllWeapons (scaleForMeleeWeapons);
|
||||
}
|
||||
|
||||
if (placeTriggerInFrontOfCharacterOnAllMeleeAttacks) {
|
||||
mainMeleeWeaponsGrabbedManager.setPlaceTriggerInFrontOfCharacterOnAllAttacksState (true);
|
||||
}
|
||||
|
||||
if (placeTriggerInFrontOfCharacterOnAllCloseCombatAttacks) {
|
||||
mainCloseCombatSystem.setPlaceTriggerInFrontOfCharacterOnAllAttacksState (true);
|
||||
}
|
||||
|
||||
if (useExtraTriggerMultiplierScaleOnAllMeleeAttacksActive) {
|
||||
mainMeleeWeaponsGrabbedManager.setExtraTriggerMultiplierScaleOnAllMeleeAttacksActiveState (true, extraTriggerMultiplierScaleOnAllMeleeAttacksAmount);
|
||||
}
|
||||
|
||||
if (!adjustingHeighValueOnRuntimeActive) {
|
||||
updateComponent ();
|
||||
|
||||
print ("Height values adjusted on Character " + gameObject.name);
|
||||
}
|
||||
}
|
||||
|
||||
void adjustTransformParts ()
|
||||
{
|
||||
for (int i = 0; i < transformPartInfoList.Count; i++) {
|
||||
|
||||
transformPartInfo currentPart = transformPartInfoList [i];
|
||||
|
||||
Vector3 newPosition = currentPart.transformPart.position;
|
||||
|
||||
float newYValue = (characterHeight * currentPart.defaultHeightPercentage) / 100;
|
||||
|
||||
newPosition = new Vector3 (newPosition.x, newYValue, newPosition.z);
|
||||
|
||||
currentPart.transformPart.position = newPosition;
|
||||
}
|
||||
}
|
||||
|
||||
public void adjustFireWeaponsScale ()
|
||||
{
|
||||
if (applyScaleToFireWeapons) {
|
||||
mainPlayerWeaponsManager.setWeaponMeshScaleOnAllWeapons (scaleForFireWeapons);
|
||||
|
||||
if (!adjustingHeighValueOnRuntimeActive) {
|
||||
updateComponent ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void adjustFireWeaponsOffset ()
|
||||
{
|
||||
mainPlayerWeaponsManager.setCurrentOffsetParentThirdPersonValues (offsetParentThirdPerson);
|
||||
|
||||
mainPlayerWeaponsManager.setCurrentOffsetParentOnThirdPersonOnAllWeapons ();
|
||||
|
||||
mainPlayerWeaponsManager.adjustDrawKeepPositionToWeaponPositionOnAllWeapons ();
|
||||
|
||||
if (!adjustingHeighValueOnRuntimeActive) {
|
||||
updateComponent ();
|
||||
}
|
||||
}
|
||||
|
||||
public void adjustFireWeaponsTransformReferences ()
|
||||
{
|
||||
mainPlayerWeaponsManager.adjustAllFireWeaponTransformReferencePositionOnAllWeapons (fireWeaponTransformReferenceScale);
|
||||
|
||||
if (!adjustingHeighValueOnRuntimeActive) {
|
||||
updateComponent ();
|
||||
}
|
||||
}
|
||||
|
||||
public void adjustCameraStates ()
|
||||
{
|
||||
int cameraIndex = 0;
|
||||
|
||||
for (int i = 0; i < cameraStateHeightInfoList.Count; i++) {
|
||||
|
||||
cameraStateHeightInfo currentState = cameraStateHeightInfoList [i];
|
||||
|
||||
cameraIndex = mainPlayerCamera.playerCameraStates.FindIndex (s => s.Name.Equals (currentState.cameraStateName));
|
||||
|
||||
if (cameraIndex > -1) {
|
||||
float newYValue = (characterHeight * currentState.defaultPivotHeightPercentage) / 100;
|
||||
|
||||
mainPlayerCamera.playerCameraStates [cameraIndex].pivotPositionOffset.y = newYValue;
|
||||
|
||||
if (adjustingHeighValueOnRuntimeActive) {
|
||||
mainPlayerCamera.updateCameraStateValuesOnEditor (cameraIndex);
|
||||
}
|
||||
|
||||
if (!adjustingHeighValueOnRuntimeActive) {
|
||||
print ("Camera State " + currentState.cameraStateName + " update with " + newYValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cameraIndex = mainPlayerCamera.playerCameraStates.FindIndex (s => s.Name.Equals (mainPlayerCamera.getCurrentStateName ()));
|
||||
|
||||
if (cameraIndex > -1) {
|
||||
mainPlayerCamera.getPivotCameraTransform ().localPosition = mainPlayerCamera.playerCameraStates [cameraIndex].pivotPositionOffset;
|
||||
|
||||
if (adjustingHeighValueOnRuntimeActive) {
|
||||
mainPlayerCamera.updateCameraStateValuesOnEditor (cameraIndex);
|
||||
}
|
||||
}
|
||||
|
||||
if (!adjustingHeighValueOnRuntimeActive) {
|
||||
updateComponent ();
|
||||
}
|
||||
}
|
||||
|
||||
void updateComponent ()
|
||||
{
|
||||
GKC_Utils.updateComponent (this);
|
||||
|
||||
GKC_Utils.updateDirtyScene ("Update Character Height/Scale", gameObject);
|
||||
}
|
||||
|
||||
void getComponents ()
|
||||
{
|
||||
if (mainPlayerComponentsManager != null) {
|
||||
if (mainPlayerController == null) {
|
||||
mainPlayerController = mainPlayerComponentsManager.getPlayerController ();
|
||||
}
|
||||
|
||||
if (mainPlayerCamera == null) {
|
||||
mainPlayerCamera = mainPlayerComponentsManager.getPlayerCamera ();
|
||||
}
|
||||
|
||||
if (mainPlayerWeaponsManager == null) {
|
||||
mainPlayerWeaponsManager = mainPlayerComponentsManager.getPlayerWeaponsManager ();
|
||||
}
|
||||
|
||||
if (mainBodyMountPointSystem == null) {
|
||||
mainBodyMountPointSystem = mainPlayerComponentsManager.getBodyMountPointsSystem ();
|
||||
}
|
||||
|
||||
if (mainBuildPlayer == null) {
|
||||
mainBuildPlayer = mainPlayerComponentsManager.getBuildPlayer ();
|
||||
}
|
||||
|
||||
if (mainHeadTrack == null) {
|
||||
mainHeadTrack = mainPlayerComponentsManager.getHeadTrack ();
|
||||
}
|
||||
|
||||
if (mainIKSystem == null) {
|
||||
mainIKSystem = mainPlayerComponentsManager.getIKSystem ();
|
||||
}
|
||||
|
||||
if (mainHealth == null) {
|
||||
mainHealth = mainPlayerComponentsManager.getHealth ();
|
||||
}
|
||||
|
||||
if (mainCloseCombatSystem == null) {
|
||||
mainCloseCombatSystem = mainPlayerComponentsManager.getCloseCombatSystem ();
|
||||
}
|
||||
|
||||
if (mainFindObjectivesSystem == null) {
|
||||
mainFindObjectivesSystem = mainPlayerComponentsManager.getFindObjectivesSystem ();
|
||||
}
|
||||
|
||||
if (mainAINavmesh == null) {
|
||||
mainAINavmesh = mainFindObjectivesSystem.getAINavMesh ();
|
||||
}
|
||||
|
||||
if (mainMeleeWeaponsGrabbedManager == null) {
|
||||
mainMeleeWeaponsGrabbedManager = mainPlayerComponentsManager.getMeleeWeaponsGrabbedManager ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void updateApplicationisPlayingValue ()
|
||||
{
|
||||
applicationisPlaying = Application.isPlaying;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class transformPartInfo
|
||||
{
|
||||
public Transform transformPart;
|
||||
|
||||
public float defaultHeightPercentage;
|
||||
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class cameraStateHeightInfo
|
||||
{
|
||||
public string cameraStateName;
|
||||
|
||||
public float defaultPivotHeightPercentage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2dfbf4ca959f0b648b83d9aa02f7fea3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Player/Character Builder/adjustCharacterHeightSystem.cs
|
||||
uploadId: 889948
|
||||
@@ -41,6 +41,39 @@ public class bodyMountPointsSystem : MonoBehaviour
|
||||
public GameObject mountPointObjectReferencePrefab;
|
||||
|
||||
|
||||
public void removeCharacterBodyMountPointsToTemporalParent (Transform newParent)
|
||||
{
|
||||
for (int i = 0; i < bodyMountPointInfoList.Count; i++) {
|
||||
|
||||
bodyMountPointInfo currentBodyMountPointInfo = bodyMountPointInfoList [i];
|
||||
|
||||
for (int j = 0; j < currentBodyMountPointInfo.objectPointInfoList.Count; j++) {
|
||||
objectPointInfo currentObjectPointInfo = currentBodyMountPointInfo.objectPointInfoList [j];
|
||||
|
||||
if (currentObjectPointInfo.objectTransform != null) {
|
||||
currentObjectPointInfo.objectTransform.SetParent (newParent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void resetCharacterBodyMountPointsLocalPositions ()
|
||||
{
|
||||
for (int i = 0; i < bodyMountPointInfoList.Count; i++) {
|
||||
|
||||
bodyMountPointInfo currentBodyMountPointInfo = bodyMountPointInfoList [i];
|
||||
|
||||
for (int j = 0; j < currentBodyMountPointInfo.objectPointInfoList.Count; j++) {
|
||||
objectPointInfo currentObjectPointInfo = currentBodyMountPointInfo.objectPointInfoList [j];
|
||||
|
||||
if (currentObjectPointInfo.objectTransform != null) {
|
||||
currentObjectPointInfo.objectTransform.localPosition = Vector3.zero;
|
||||
currentObjectPointInfo.objectTransform.localRotation = Quaternion.identity;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setCharacterBodyMountPointsInfoList ()
|
||||
{
|
||||
for (int i = 0; i < bodyMountPointInfoList.Count; i++) {
|
||||
@@ -63,24 +96,34 @@ public class bodyMountPointsSystem : MonoBehaviour
|
||||
|
||||
if (currentBodyMountPointInfo.useCustomBoneTransform) {
|
||||
currentBone = currentBodyMountPointInfo.customBoneTransform;
|
||||
|
||||
if (currentBone != null) {
|
||||
if (!currentBone.IsChildOf (mainAnimator.transform)) {
|
||||
print ("transform assigned is not part of the current animator, recalculating " + currentBone.name);
|
||||
|
||||
currentBone = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (currentBone == null) {
|
||||
currentBone = mainAnimator.GetBoneTransform (currentBodyMountPointInfo.boneToAttach);
|
||||
}
|
||||
|
||||
if (currentBone == null) {
|
||||
currentBone = mainAnimator.GetBoneTransform (currentBodyMountPointInfo.alternativeBoneToAttach);
|
||||
}
|
||||
|
||||
if (currentBone == null) {
|
||||
currentBone = mainAnimator.GetBoneTransform (HumanBodyBones.Hips);
|
||||
if (mainAnimator.isHuman) {
|
||||
if (currentBone == null) {
|
||||
currentBone = mainAnimator.GetBoneTransform (currentBodyMountPointInfo.boneToAttach);
|
||||
}
|
||||
|
||||
if (currentBone == null) {
|
||||
currentBone = mainAnimator.transform;
|
||||
currentBone = mainAnimator.GetBoneTransform (currentBodyMountPointInfo.alternativeBoneToAttach);
|
||||
}
|
||||
|
||||
print ("WARNING: No bone found on character body elements list for " + currentBodyMountPointInfo.Name + "" +
|
||||
" setting that character element inside the character model " + currentBone.name);
|
||||
if (currentBone == null) {
|
||||
currentBone = mainAnimator.GetBoneTransform (HumanBodyBones.Hips);
|
||||
|
||||
if (currentBone == null) {
|
||||
currentBone = mainAnimator.transform;
|
||||
|
||||
print ("WARNING: No bone found on character body elements list for " + currentBodyMountPointInfo.Name + "" +
|
||||
" setting that character element inside the character model " + currentBone.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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/Player/Character Builder/bodyMountPointsSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -133,6 +133,81 @@ public class buildPlayer : MonoBehaviour
|
||||
|
||||
bool checkUnpackCharacterPrefabActive;
|
||||
|
||||
bool replacingCharacterModelInRuntimeActive;
|
||||
|
||||
bool applicationisPlaying;
|
||||
|
||||
bool setNewChestUpVectorValueActive;
|
||||
Vector3 newChestUpVectorValue;
|
||||
|
||||
|
||||
public void setNewCharacterModelToReplaceInRuntime (GameObject newObject)
|
||||
{
|
||||
if (newObject == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
newCharacterModel = newObject;
|
||||
|
||||
//assign the new character model and the bones for the mount points manually from its character info
|
||||
}
|
||||
|
||||
public void buildCharacterInRuntime ()
|
||||
{
|
||||
updateApplicationisPlayingValue ();
|
||||
|
||||
replacingCharacterModelInRuntimeActive = true;
|
||||
|
||||
ignoreApplyCharacterSettings = true;
|
||||
|
||||
if (!applicationisPlaying) {
|
||||
checkUnpackCharacterPrefab ();
|
||||
}
|
||||
|
||||
buildCharacter ();
|
||||
|
||||
ignoreApplyCharacterSettings = false;
|
||||
|
||||
replacingCharacterModelInRuntimeActive = false;
|
||||
|
||||
|
||||
//disable the destroy current character model and the usage of character settings
|
||||
|
||||
//it will need that each component that access to the character model gets the info updated
|
||||
|
||||
//the ragdoll creator should be avoided, as each model would have its ragdoll created, the system will check for the
|
||||
//ragdoll elements inside and assign if already exists
|
||||
|
||||
//check for other objects that check for bone references on start, like head collision
|
||||
}
|
||||
|
||||
public void checkElementsBeforeReplacingCharacterModelInRuntime ()
|
||||
{
|
||||
updateApplicationisPlayingValue ();
|
||||
|
||||
if (applicationisPlaying) {
|
||||
GKC_Utils.checkPlayerStates (player);
|
||||
}
|
||||
}
|
||||
|
||||
public void checkElementsAfterReplacingCharacterModelInRuntime ()
|
||||
{
|
||||
updateApplicationisPlayingValue ();
|
||||
|
||||
if (applicationisPlaying) {
|
||||
weaponsManager.resetWeaponsTransformInThirdPersonToPlayerPosition ();
|
||||
|
||||
weaponsManager.resetWeaponsParentToPlayerPosition ();
|
||||
|
||||
weaponsManager.updateWeaponsParentAndLocalPosition ();
|
||||
}
|
||||
|
||||
Transform temporalChestBone = upperBodyRotationManager.getChestTransform ();
|
||||
|
||||
upperBodyRotationManager.calculateCharacterRotationValues ();
|
||||
|
||||
weaponsManager.updateWeaponsParentsInRuntime (temporalChestBone, newModelAnimator);
|
||||
}
|
||||
|
||||
public void buildCharacterByButton ()
|
||||
{
|
||||
@@ -155,23 +230,61 @@ public class buildPlayer : MonoBehaviour
|
||||
void checkUnpackCharacterPrefab ()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
|
||||
currentPlayerComponentsManager = player.GetComponent<playerComponentsManager> ();
|
||||
|
||||
playerControllerManager = currentPlayerComponentsManager.getPlayerController ();
|
||||
|
||||
bool characterIsAI = playerControllerManager.isCharacterUsedByAI ();
|
||||
|
||||
bool checkPrefabResult = false;
|
||||
|
||||
GameObject mainParentGameObject = null;
|
||||
|
||||
if (transform.parent != null) {
|
||||
if (transform.root != null) {
|
||||
GameObject mainParentGameObject = transform.root.gameObject;
|
||||
print ("checking unpack character " + transform.parent.name);
|
||||
|
||||
if (PrefabUtility.GetCorrespondingObjectFromSource (mainParentGameObject)) {
|
||||
//GKC_Utils.setActiveGameObjectInEditorWithoutCheckNull (null);
|
||||
Transform currentTransformRoot = transform.root;
|
||||
|
||||
print ("Character parent is currently a prefab, unpacking before creating new character\n");
|
||||
if (currentTransformRoot != null) {
|
||||
if (characterIsAI) {
|
||||
currentTransformRoot = transform;
|
||||
|
||||
print (PrefabUtility.GetCorrespondingObjectFromSource (mainParentGameObject).name);
|
||||
|
||||
PrefabUtility.UnpackPrefabInstance (mainParentGameObject, PrefabUnpackMode.Completely, InteractionMode.UserAction);
|
||||
} else {
|
||||
print ("Character parent prefab not found, continuing creating new character process\n");
|
||||
print ("character is AI, the root is this object " + currentTransformRoot.name);
|
||||
}
|
||||
}
|
||||
|
||||
print ("checking unpack character " + currentTransformRoot.name);
|
||||
|
||||
mainParentGameObject = currentTransformRoot.gameObject;
|
||||
|
||||
checkPrefabResult = true;
|
||||
}
|
||||
} else {
|
||||
Transform currentTransformRoot = transform.root;
|
||||
|
||||
if (currentTransformRoot != null) {
|
||||
print ("checking unpack character " + currentTransformRoot.name);
|
||||
|
||||
mainParentGameObject = currentTransformRoot.gameObject;
|
||||
|
||||
checkPrefabResult = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (checkPrefabResult && mainParentGameObject != null) {
|
||||
print ("unpack check condition found, checking result");
|
||||
|
||||
if (PrefabUtility.GetCorrespondingObjectFromSource (mainParentGameObject)) {
|
||||
//GKC_Utils.setActiveGameObjectInEditorWithoutCheckNull (null);
|
||||
|
||||
print ("Character parent is currently a prefab, unpacking before creating new character\n");
|
||||
|
||||
print (PrefabUtility.GetCorrespondingObjectFromSource (mainParentGameObject).name);
|
||||
|
||||
PrefabUtility.UnpackPrefabInstance (mainParentGameObject, PrefabUnpackMode.Completely, InteractionMode.UserAction);
|
||||
} else {
|
||||
print ("Character parent prefab not found, continuing creating new character process\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -318,12 +431,19 @@ public class buildPlayer : MonoBehaviour
|
||||
(leftToes != null);
|
||||
}
|
||||
|
||||
void updateApplicationisPlayingValue ()
|
||||
{
|
||||
applicationisPlaying = Application.isPlaying;
|
||||
}
|
||||
|
||||
//set all the objects inside the character's body
|
||||
public void buildCharacter ()
|
||||
{
|
||||
updateApplicationisPlayingValue ();
|
||||
|
||||
//it only works in the editor mode, checking the game is not running
|
||||
if (!Application.isPlaying) {
|
||||
if (!assignNewModelManually) {
|
||||
if (!applicationisPlaying || replacingCharacterModelInRuntimeActive) {
|
||||
if (!assignNewModelManually && !replacingCharacterModelInRuntimeActive) {
|
||||
getCharacterBones ();
|
||||
}
|
||||
|
||||
@@ -337,11 +457,13 @@ public class buildPlayer : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
print ("\n\n");
|
||||
print ("CREATING NEW CHARACTER");
|
||||
print ("\n\n");
|
||||
if (!applicationisPlaying) {
|
||||
print ("\n\n");
|
||||
print ("CREATING NEW CHARACTER");
|
||||
print ("\n\n");
|
||||
}
|
||||
|
||||
if (assignNewModelManually) {
|
||||
if (assignNewModelManually || replacingCharacterModelInRuntimeActive) {
|
||||
newModelAnimator = newCharacterModel.GetComponent<Animator> ();
|
||||
|
||||
newCharacterModel.transform.position = currentCharacterModel.transform.position;
|
||||
@@ -383,7 +505,11 @@ public class buildPlayer : MonoBehaviour
|
||||
|
||||
playerCOM = IKManager.getIKBodyCOM ();
|
||||
|
||||
currentCharacterModel.transform.SetParent (null);
|
||||
if (replacingCharacterModelInRuntimeActive) {
|
||||
currentCharacterModel.transform.SetParent (transform);
|
||||
} else {
|
||||
currentCharacterModel.transform.SetParent (null);
|
||||
}
|
||||
|
||||
newCharacterModel.transform.SetParent (playerCOM);
|
||||
|
||||
@@ -404,7 +530,9 @@ public class buildPlayer : MonoBehaviour
|
||||
|
||||
setIKUpperBodyComponents ();
|
||||
|
||||
setMapSystemComponents ();
|
||||
if (!replacingCharacterModelInRuntimeActive) {
|
||||
setMapSystemComponents ();
|
||||
}
|
||||
|
||||
setHealthWeakSpots ();
|
||||
|
||||
@@ -418,18 +546,22 @@ public class buildPlayer : MonoBehaviour
|
||||
|
||||
setCharacterCustomizationManager ();
|
||||
|
||||
if (buildPlayerType) {
|
||||
print ("\n\n");
|
||||
if (buildPlayerType && !replacingCharacterModelInRuntimeActive) {
|
||||
if (!applicationisPlaying) {
|
||||
print ("\n\n");
|
||||
|
||||
print ("Creating new player, adding all main managers into scene");
|
||||
print ("Creating new player, adding all main managers into scene");
|
||||
|
||||
print ("\n\n");
|
||||
print ("\n\n");
|
||||
}
|
||||
|
||||
GKC_Utils.addAllMainManagersToScene ();
|
||||
}
|
||||
|
||||
if (ignoreApplyCharacterSettings) {
|
||||
print ("Character settings not applied due to use the manual build with the ignore option active");
|
||||
if (!applicationisPlaying) {
|
||||
print ("Character settings not applied due to use the manual build with the ignore option active");
|
||||
}
|
||||
|
||||
} else {
|
||||
adjustSettings ();
|
||||
@@ -443,7 +575,15 @@ public class buildPlayer : MonoBehaviour
|
||||
checkUnpackCharacterPrefabActive = false;
|
||||
}
|
||||
|
||||
DestroyImmediate (currentCharacterModel);
|
||||
if (replacingCharacterModelInRuntimeActive) {
|
||||
currentCharacterModel.SetActive (false);
|
||||
|
||||
if (applicationisPlaying) {
|
||||
playerControllerManager.resetAnimatorEvenIfFullBodyAwarenessActive ();
|
||||
}
|
||||
} else {
|
||||
DestroyImmediate (currentCharacterModel);
|
||||
}
|
||||
|
||||
currentCharacterModel = newCharacterModel;
|
||||
|
||||
@@ -451,9 +591,7 @@ public class buildPlayer : MonoBehaviour
|
||||
|
||||
newModelAnimator.enabled = false;
|
||||
|
||||
// DestroyImmediate (newModelAnimator);
|
||||
|
||||
if (isInstantiated) {
|
||||
if (isInstantiated && !replacingCharacterModelInRuntimeActive) {
|
||||
placeCharacterInCameraPosition ();
|
||||
}
|
||||
|
||||
@@ -477,16 +615,20 @@ public class buildPlayer : MonoBehaviour
|
||||
|
||||
newCharacterModel = null;
|
||||
|
||||
eventOnCreatePlayer.Invoke ();
|
||||
if (!replacingCharacterModelInRuntimeActive) {
|
||||
eventOnCreatePlayer.Invoke ();
|
||||
}
|
||||
|
||||
if (currentCharacterModel != null) {
|
||||
eventToSendNewPlayerModel.Invoke (currentCharacterModel);
|
||||
}
|
||||
|
||||
updateComponent ();
|
||||
if (!replacingCharacterModelInRuntimeActive || !applicationisPlaying) {
|
||||
updateComponent ();
|
||||
|
||||
print ("IMPORTANT: Character created successfully. Remember to check the component Upper Body Rotation System, in Player Controller gameObject. In that inspector, check the value " +
|
||||
"Chest Up Vector and adjust it if the player spine behaves strange when aiming a weapon in third person. You can find a better explanation in the documentation");
|
||||
print ("IMPORTANT: Character created successfully. Remember to check the component Upper Body Rotation System, in Player Controller gameObject. In that inspector, check the value " +
|
||||
"Chest Up Vector and adjust it if the player spine behaves strange when aiming a weapon in third person. You can find a better explanation in the documentation");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -539,6 +681,12 @@ public class buildPlayer : MonoBehaviour
|
||||
if (ragdollActivatorManager != null) {
|
||||
ragdollActivatorManager.setCharacterBody (newCharacterModel, newModelAnimator);
|
||||
}
|
||||
|
||||
if (replacingCharacterModelInRuntimeActive) {
|
||||
ragdollBuilderManager.setRagdollCollidersState (false);
|
||||
|
||||
ragdollActivatorManager.enableOrDisableRagdollPhysics (false);
|
||||
}
|
||||
}
|
||||
|
||||
void setIKFootElements ()
|
||||
@@ -556,6 +704,8 @@ public class buildPlayer : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
updateApplicationisPlayingValue ();
|
||||
|
||||
checkUnpackCharacterPrefab ();
|
||||
|
||||
currentPlayerComponentsManager = player.GetComponent<playerComponentsManager> ();
|
||||
@@ -577,6 +727,13 @@ public class buildPlayer : MonoBehaviour
|
||||
updateComponent ();
|
||||
}
|
||||
|
||||
public void setCustomChestUpVectorValue (Vector3 newValue)
|
||||
{
|
||||
newChestUpVectorValue = newValue;
|
||||
|
||||
setNewChestUpVectorValueActive = (newChestUpVectorValue != -Vector3.one);
|
||||
}
|
||||
|
||||
void setIKUpperBodyComponents ()
|
||||
{
|
||||
upperBodyRotationManager.setSpineTransform (spine);
|
||||
@@ -586,19 +743,33 @@ public class buildPlayer : MonoBehaviour
|
||||
|
||||
localDirection = new Vector3 (Mathf.RoundToInt (localDirection.x), Mathf.RoundToInt (localDirection.y), Mathf.RoundToInt (localDirection.z));
|
||||
|
||||
if (setNewChestUpVectorValueActive) {
|
||||
localDirection = newChestUpVectorValue;
|
||||
|
||||
setNewChestUpVectorValueActive = false;
|
||||
}
|
||||
|
||||
upperBodyRotationManager.setNewChestUpVectorValue (localDirection);
|
||||
|
||||
Transform currentMountPointChest = mainBodyMountPointsSystem.getHumanBoneMountPointTransformByName (mainChestMountPointName);
|
||||
|
||||
if (currentMountPointChest != null) {
|
||||
print ("Chest bones names " + currentMountPointChest.name + " " + chest.name);
|
||||
if (!applicationisPlaying) {
|
||||
print ("Chest bones names " + currentMountPointChest.name + " " + chest.name);
|
||||
}
|
||||
|
||||
if (currentMountPointChest != chest) {
|
||||
mainBodyMountPointsSystem.setCustomBoneMountPointTransformByName (mainChestMountPointName, chest, true);
|
||||
|
||||
mainBodyMountPointsSystem.setIndividualCharacterBodyMountPointInfoByName (mainChestMountPointName);
|
||||
|
||||
print ("New Chest Bone assigned on mount point system\n\n");
|
||||
if (!applicationisPlaying) {
|
||||
print ("New Chest Bone assigned on mount point system\n\n");
|
||||
}
|
||||
} else {
|
||||
if (!applicationisPlaying) {
|
||||
print ("Chest bone hasn't changed on mount point, all is properly update");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -609,6 +780,7 @@ public class buildPlayer : MonoBehaviour
|
||||
mapSystemManager.searchBuildingList ();
|
||||
}
|
||||
}
|
||||
|
||||
void setHealthWeakSpots ()
|
||||
{
|
||||
if (!buildPlayerType) {
|
||||
@@ -637,10 +809,12 @@ public class buildPlayer : MonoBehaviour
|
||||
weaponsManager.setLeftHandTransform (leftHand);
|
||||
}
|
||||
|
||||
weaponsManager.setWeaponList ();
|
||||
if (!replacingCharacterModelInRuntimeActive) {
|
||||
weaponsManager.setWeaponList ();
|
||||
|
||||
if (!hasWeaponsEnabled) {
|
||||
weaponsManager.enableOrDisableWeaponsList (false);
|
||||
if (!hasWeaponsEnabled) {
|
||||
weaponsManager.enableOrDisableWeaponsList (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -674,9 +848,7 @@ public class buildPlayer : MonoBehaviour
|
||||
playerCullingSystem currentPlayerCullingSystem = playerCameraGameObject.GetComponent<playerCullingSystem> ();
|
||||
|
||||
if (currentPlayerCullingSystem != null && currentSkinnedMeshRenderer != null) {
|
||||
currentPlayerCullingSystem.playerGameObjectList.Clear ();
|
||||
|
||||
currentPlayerCullingSystem.playerGameObjectList.Add (currentSkinnedMeshRenderer.gameObject);
|
||||
currentPlayerCullingSystem.setNewPlayerGameObject (currentSkinnedMeshRenderer.gameObject);
|
||||
|
||||
currentPlayerCullingSystem.storePlayerRendererFromEditor ();
|
||||
}
|
||||
@@ -690,11 +862,16 @@ public class buildPlayer : MonoBehaviour
|
||||
characterCustomizationManager currentCharacterCustomizationManager = GetComponentInChildren<characterCustomizationManager> ();
|
||||
|
||||
if (currentCharacterCustomizationManager != null) {
|
||||
currentInventoryCharacterCustomizationSystem.mainCharacterCustomizationManager = currentCharacterCustomizationManager;
|
||||
currentInventoryCharacterCustomizationSystem.setNewCharacterCustomizationManager (currentCharacterCustomizationManager);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public GameObject getPlayerGameObject ()
|
||||
{
|
||||
return player;
|
||||
}
|
||||
|
||||
public void setCharacterValuesAndAdjustSettingsExternally (bool characterHasBeenPreInstantiatedOnEditorValue,
|
||||
bool characterIsAI,
|
||||
bool configuredAsEnemy,
|
||||
|
||||
@@ -11,7 +11,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/Player/Character Builder/buildPlayer.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class characterModelElementInfo : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Setting")]
|
||||
[Space]
|
||||
|
||||
public bool setNewHeightOnCharacter;
|
||||
|
||||
[Space]
|
||||
[Header ("Other Settings")]
|
||||
[Space]
|
||||
|
||||
public bool setNewAnimator;
|
||||
public RuntimeAnimatorController newRuntimeAnimatorController;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool setNewChestUpVectorValueOnRuntime;
|
||||
|
||||
public Vector3 chestUpVector;
|
||||
|
||||
[Space]
|
||||
[Header ("Armor Cloth Data Settings")]
|
||||
[Space]
|
||||
|
||||
public bool setNewArmorClothData;
|
||||
|
||||
public armorClothPieceTemplateData mainArmorClothPieceTemplateData;
|
||||
|
||||
[Space]
|
||||
[Space]
|
||||
|
||||
public fullArmorClothTemplateData mainFullArmorClothTemplateData;
|
||||
|
||||
[Space]
|
||||
[Space]
|
||||
|
||||
public characterAspectCustomizationTemplateData mainCharacterAspectCustomizationTemplateData;
|
||||
|
||||
[Space]
|
||||
[Space]
|
||||
|
||||
public bool setNewArmorClothSet;
|
||||
|
||||
public characterAspectCustomizationTemplate initialCharacterAspectCustomizationTemplate;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool setRandomArmorClothSet;
|
||||
|
||||
public List<characterAspectCustomizationTemplate> characterAspectCustomizationTemplateList = new List<characterAspectCustomizationTemplate> ();
|
||||
|
||||
|
||||
[Space]
|
||||
[Header ("Character Elements")]
|
||||
[Space]
|
||||
|
||||
public Transform head;
|
||||
public Transform neck;
|
||||
public Transform chest;
|
||||
public Transform spine;
|
||||
|
||||
public Transform hips;
|
||||
|
||||
public Transform rightLowerArm;
|
||||
public Transform leftLowerArm;
|
||||
public Transform rightHand;
|
||||
public Transform leftHand;
|
||||
|
||||
public Transform rightLowerLeg;
|
||||
public Transform leftLowerLeg;
|
||||
public Transform rightFoot;
|
||||
public Transform leftFoot;
|
||||
public Transform rightToes;
|
||||
public Transform leftToes;
|
||||
|
||||
[Space]
|
||||
[Header ("Ragdoll Elements")]
|
||||
[Space]
|
||||
|
||||
public bool setRagdollBonesManually;
|
||||
|
||||
public Transform rightUpperArm;
|
||||
public Transform leftUpperArm;
|
||||
|
||||
public Transform rightUpperLeg;
|
||||
public Transform leftUpperLeg;
|
||||
|
||||
public Transform middleSpine;
|
||||
public Transform pelvis;
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
|
||||
public GameObject characterGameObject;
|
||||
|
||||
public Animator mainAnimator;
|
||||
|
||||
|
||||
public void getCharacterElements ()
|
||||
{
|
||||
getCharacterBones ();
|
||||
|
||||
updateComponent ();
|
||||
}
|
||||
|
||||
public void getCharacterBones ()
|
||||
{
|
||||
if (mainAnimator == null) {
|
||||
mainAnimator = GetComponent<Animator> ();
|
||||
|
||||
if (mainAnimator == null) {
|
||||
Debug.Log ("WARNING: There is not an animator component in this model, make sure to attach that component before create a new character");
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
head = mainAnimator.GetBoneTransform (HumanBodyBones.Head);
|
||||
neck = mainAnimator.GetBoneTransform (HumanBodyBones.Neck);
|
||||
|
||||
if (neck == null) {
|
||||
if (head != null) {
|
||||
neck = head.parent;
|
||||
} else {
|
||||
Debug.Log ("WARNING: no head found, assign it manually to make sure all of them are configured correctly");
|
||||
}
|
||||
}
|
||||
|
||||
chest = mainAnimator.GetBoneTransform (HumanBodyBones.Chest);
|
||||
spine = mainAnimator.GetBoneTransform (HumanBodyBones.Spine);
|
||||
|
||||
if (spine != null) {
|
||||
if (chest != null) {
|
||||
if (spine != chest.parent) {
|
||||
spine = chest.parent;
|
||||
}
|
||||
} else {
|
||||
Debug.Log ("WARNING: no chest found, assign it manually to make sure all of them are configured correctly");
|
||||
}
|
||||
} else {
|
||||
Debug.Log ("WARNING: no spine found, assign it manually to make sure all of them are configured correctly");
|
||||
}
|
||||
|
||||
hips = mainAnimator.GetBoneTransform (HumanBodyBones.Hips);
|
||||
|
||||
rightLowerArm = mainAnimator.GetBoneTransform (HumanBodyBones.RightLowerArm);
|
||||
leftLowerArm = mainAnimator.GetBoneTransform (HumanBodyBones.LeftLowerArm);
|
||||
rightHand = mainAnimator.GetBoneTransform (HumanBodyBones.RightHand);
|
||||
leftHand = mainAnimator.GetBoneTransform (HumanBodyBones.LeftHand);
|
||||
|
||||
rightLowerLeg = mainAnimator.GetBoneTransform (HumanBodyBones.RightLowerLeg);
|
||||
leftLowerLeg = mainAnimator.GetBoneTransform (HumanBodyBones.LeftLowerLeg);
|
||||
rightFoot = mainAnimator.GetBoneTransform (HumanBodyBones.RightFoot);
|
||||
leftFoot = mainAnimator.GetBoneTransform (HumanBodyBones.LeftFoot);
|
||||
rightToes = mainAnimator.GetBoneTransform (HumanBodyBones.RightToes);
|
||||
leftToes = mainAnimator.GetBoneTransform (HumanBodyBones.LeftToes);
|
||||
}
|
||||
|
||||
void updateComponent ()
|
||||
{
|
||||
GKC_Utils.updateComponent (this);
|
||||
|
||||
GKC_Utils.updateDirtyScene ("Update Character Model Info", gameObject);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 17b721e525ae0964abfa73f722765eac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Player/Character Builder/characterModelElementInfo.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,389 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
public class characterModelListManager : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Setting")]
|
||||
[Space]
|
||||
|
||||
public string currentCharacterModelName;
|
||||
|
||||
[Space]
|
||||
|
||||
public List<characterModelInfo> characterModelInfoList = new List<characterModelInfo> ();
|
||||
|
||||
[Space]
|
||||
|
||||
public bool setCharacterModelOnStart;
|
||||
|
||||
public string characterModelOnStartName;
|
||||
|
||||
public bool useRandomCharacterModelOnStart;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool ignoreSetInitialArmorClothSetOnChangeModel;
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public bool showDebugPrint;
|
||||
|
||||
public int currentCharacterModelIndex;
|
||||
|
||||
public int currentCharacterModelID;
|
||||
|
||||
[Space]
|
||||
[Header ("Event Settings")]
|
||||
[Space]
|
||||
|
||||
public bool useEventOnReplaceCharacterModel;
|
||||
public UnityEvent eventOnReplaceCharacterModel;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool useEventToSendCurrentCharacterModelSelected;
|
||||
public eventParameters.eventToCallWithGameObject eventToSendCurrentCharacterModelSelected;
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
|
||||
public buildPlayer mainBuildPlayer;
|
||||
public bodyMountPointsSystem mainBodyMountPointsSystem;
|
||||
public RuntimeAnimatorController originalRuntimeAnimatorController;
|
||||
public playerController mainPlayerController;
|
||||
public playerComponentsManager mainPlayerComponentsManager;
|
||||
|
||||
public ragdollBuilder mainRagdollBuilder;
|
||||
|
||||
|
||||
bool mainBuildPlayerLocated;
|
||||
|
||||
int previousCharacterModelIndex = -1;
|
||||
|
||||
void Start ()
|
||||
{
|
||||
if (setCharacterModelOnStart) {
|
||||
StartCoroutine (setCharacterModelOnStartCoroutine ());
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator setCharacterModelOnStartCoroutine ()
|
||||
{
|
||||
yield return new WaitForSeconds (0.01f);
|
||||
|
||||
string modelNameToUse = characterModelOnStartName;
|
||||
|
||||
if (useRandomCharacterModelOnStart) {
|
||||
int randomIndex = Random.Range (0, characterModelInfoList.Count);
|
||||
|
||||
modelNameToUse = characterModelInfoList [randomIndex].Name;
|
||||
}
|
||||
|
||||
replaceCharacterModel (modelNameToUse);
|
||||
}
|
||||
|
||||
public int getCurrentCharacterModelID ()
|
||||
{
|
||||
if (mainPlayerController != null) {
|
||||
return mainPlayerController.getCharacterModelID ();
|
||||
}
|
||||
|
||||
return currentCharacterModelID;
|
||||
}
|
||||
|
||||
public void replaceCharacterModelByID (int id)
|
||||
{
|
||||
int listIndex = characterModelInfoList.FindIndex (s => s.characterModelID.Equals (id));
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("replaceCharacterModelByID " + id + " " + listIndex);
|
||||
}
|
||||
|
||||
if (listIndex > -1) {
|
||||
replaceCharacterModel (characterModelInfoList [listIndex].Name);
|
||||
}
|
||||
}
|
||||
|
||||
public void replaceCharacterModel ()
|
||||
{
|
||||
//add a check to see if the play is active or not, to allow the change also on editor time, out of play mode
|
||||
|
||||
replaceCharacterModel (currentCharacterModelName);
|
||||
}
|
||||
|
||||
public void replaceCharacterModel (string name)
|
||||
{
|
||||
if (name == null || name == "") {
|
||||
return;
|
||||
}
|
||||
|
||||
int listIndex = characterModelInfoList.FindIndex (s => s.Name.Equals (name));
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("checking character name " + name + " " + listIndex);
|
||||
}
|
||||
|
||||
if (listIndex > -1) {
|
||||
if (currentCharacterModelIndex == listIndex) {
|
||||
print ("character model selected is already the current one, cancelling");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (previousCharacterModelIndex > -1) {
|
||||
characterModelInfo previousCharacterModelInfo = characterModelInfoList [previousCharacterModelIndex];
|
||||
|
||||
if (previousCharacterModelInfo.characterGameObject != null) {
|
||||
if (previousCharacterModelInfo.useEventOnSelectCharacterModel) {
|
||||
previousCharacterModelInfo.eventOnChangeToAnotherCharacterModel.Invoke ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
previousCharacterModelIndex = currentCharacterModelIndex;
|
||||
|
||||
currentCharacterModelIndex = listIndex;
|
||||
|
||||
characterModelInfo currentCharacterModelInfo = characterModelInfoList [currentCharacterModelIndex];
|
||||
|
||||
if (currentCharacterModelInfo.characterGameObject == null) {
|
||||
currentCharacterModelInfo.characterGameObject = (GameObject)Instantiate (currentCharacterModelInfo.characterPrefab);
|
||||
}
|
||||
|
||||
characterModelElementInfo currentCharacterModelElementInfo = currentCharacterModelInfo.characterGameObject.GetComponent<characterModelElementInfo> ();
|
||||
|
||||
if (currentCharacterModelElementInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!currentCharacterModelInfo.characterGameObject.activeSelf) {
|
||||
currentCharacterModelInfo.characterGameObject.SetActive (true);
|
||||
}
|
||||
|
||||
currentCharacterModelID = currentCharacterModelInfo.characterModelID;
|
||||
|
||||
currentCharacterModelElementInfo.mainAnimator.enabled = true;
|
||||
|
||||
|
||||
mainBuildPlayerLocated = mainBuildPlayer != null;
|
||||
|
||||
bool applicationisPlaying = Application.isPlaying;
|
||||
|
||||
if (mainBuildPlayerLocated) {
|
||||
inventoryCharacterCustomizationSystem currentInventoryCharacterCustomizationSystem = mainPlayerComponentsManager.getInventoryCharacterCustomizationSystem ();
|
||||
|
||||
if (currentInventoryCharacterCustomizationSystem != null) {
|
||||
if (applicationisPlaying) {
|
||||
currentInventoryCharacterCustomizationSystem.unequipAllCurrentArmorCloth ();
|
||||
}
|
||||
}
|
||||
|
||||
mainPlayerController.setCharacterModelID (currentCharacterModelInfo.characterModelID);
|
||||
|
||||
if (currentCharacterModelElementInfo.setNewAnimator) {
|
||||
mainPlayerController.setNewRuntimeAnimatorController (currentCharacterModelElementInfo.newRuntimeAnimatorController);
|
||||
} else {
|
||||
if (originalRuntimeAnimatorController != null) {
|
||||
mainPlayerController.setNewRuntimeAnimatorController (originalRuntimeAnimatorController);
|
||||
}
|
||||
}
|
||||
|
||||
mainRagdollBuilder.setCheckIfRagdollComponentsAlreadyAddedOnModelActiveState (true);
|
||||
|
||||
if (currentCharacterModelElementInfo.setRagdollBonesManually) {
|
||||
mainRagdollBuilder.setIgnoreStoreBonesByGetBoneTransformActiveState (true);
|
||||
|
||||
mainRagdollBuilder.setCharacterBones (currentCharacterModelElementInfo.head,
|
||||
currentCharacterModelElementInfo.rightLowerArm,
|
||||
currentCharacterModelElementInfo.leftLowerArm,
|
||||
currentCharacterModelElementInfo.rightUpperArm,
|
||||
currentCharacterModelElementInfo.leftUpperArm,
|
||||
currentCharacterModelElementInfo.middleSpine,
|
||||
currentCharacterModelElementInfo.pelvis,
|
||||
currentCharacterModelElementInfo.rightUpperLeg,
|
||||
currentCharacterModelElementInfo.leftUpperLeg,
|
||||
currentCharacterModelElementInfo.rightLowerLeg,
|
||||
currentCharacterModelElementInfo.leftLowerLeg);
|
||||
}
|
||||
|
||||
mainBuildPlayer.checkElementsBeforeReplacingCharacterModelInRuntime ();
|
||||
|
||||
mainBuildPlayer.setNewCharacterModelToReplaceInRuntime (currentCharacterModelInfo.characterGameObject);
|
||||
|
||||
mainBuildPlayer.setCharacterBones (
|
||||
currentCharacterModelElementInfo.head,
|
||||
currentCharacterModelElementInfo.neck,
|
||||
currentCharacterModelElementInfo.chest,
|
||||
currentCharacterModelElementInfo.spine,
|
||||
|
||||
currentCharacterModelElementInfo.hips,
|
||||
|
||||
currentCharacterModelElementInfo.rightLowerArm,
|
||||
currentCharacterModelElementInfo.leftLowerArm,
|
||||
currentCharacterModelElementInfo.rightHand,
|
||||
currentCharacterModelElementInfo.leftHand,
|
||||
|
||||
currentCharacterModelElementInfo.rightLowerLeg,
|
||||
currentCharacterModelElementInfo.leftLowerLeg,
|
||||
currentCharacterModelElementInfo.rightFoot,
|
||||
currentCharacterModelElementInfo.leftFoot,
|
||||
currentCharacterModelElementInfo.rightToes,
|
||||
currentCharacterModelElementInfo.leftToes);
|
||||
|
||||
if (currentCharacterModelElementInfo.setNewChestUpVectorValueOnRuntime) {
|
||||
mainBuildPlayer.setCustomChestUpVectorValue (currentCharacterModelElementInfo.chestUpVector);
|
||||
}
|
||||
|
||||
mainBuildPlayer.buildCharacterInRuntime ();
|
||||
|
||||
mainBuildPlayer.checkElementsAfterReplacingCharacterModelInRuntime ();
|
||||
|
||||
|
||||
if (currentCharacterModelElementInfo.setNewHeightOnCharacter) {
|
||||
if (currentCharacterModelInfo.mainAdjustCharacterHeightSystem != null) {
|
||||
currentCharacterModelInfo.mainAdjustCharacterHeightSystem.adjustHeightValueInRuntime ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (currentInventoryCharacterCustomizationSystem != null) {
|
||||
currentInventoryCharacterCustomizationSystem.updateCharacterTransform ();
|
||||
|
||||
currentInventoryCharacterCustomizationSystem.updateCheckAssignCharacterAspectCustomizationUISystem ();
|
||||
|
||||
if (currentCharacterModelElementInfo.setNewArmorClothData) {
|
||||
currentInventoryCharacterCustomizationSystem.setNewArmorClothPieceTemplateData (currentCharacterModelElementInfo.mainArmorClothPieceTemplateData);
|
||||
currentInventoryCharacterCustomizationSystem.setNewFullArmorClothTemplateData (currentCharacterModelElementInfo.mainFullArmorClothTemplateData);
|
||||
}
|
||||
|
||||
bool setNewArmorClothSet = currentCharacterModelElementInfo.setNewArmorClothSet;
|
||||
|
||||
if (ignoreSetInitialArmorClothSetOnChangeModel) {
|
||||
currentInventoryCharacterCustomizationSystem.setInitialArmorClothPieceListState (false);
|
||||
} else {
|
||||
currentInventoryCharacterCustomizationSystem.setInitialArmorClothPieceListState (setNewArmorClothSet);
|
||||
}
|
||||
|
||||
currentInventoryCharacterCustomizationSystem.setUseCharacterAspectCustomizationTemplateState (setNewArmorClothSet);
|
||||
|
||||
if (setNewArmorClothSet) {
|
||||
currentInventoryCharacterCustomizationSystem.setInitialCharacterAspectCustomizationTemplate (
|
||||
currentCharacterModelElementInfo.initialCharacterAspectCustomizationTemplate);
|
||||
|
||||
bool setRandomArmorClothSet = currentCharacterModelElementInfo.setRandomArmorClothSet;
|
||||
|
||||
currentInventoryCharacterCustomizationSystem.setUseRandomCharacterAspectCustomizationTemplateState (setRandomArmorClothSet);
|
||||
|
||||
if (setRandomArmorClothSet) {
|
||||
currentInventoryCharacterCustomizationSystem.setCharacterAspectCustomizationTemplateList (
|
||||
currentCharacterModelElementInfo.characterAspectCustomizationTemplateList);
|
||||
}
|
||||
|
||||
if (applicationisPlaying) {
|
||||
currentInventoryCharacterCustomizationSystem.checkSetInitialArmorClothList ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mainRagdollBuilder.setCheckIfRagdollComponentsAlreadyAddedOnModelActiveState (false);
|
||||
|
||||
mainRagdollBuilder.setIgnoreStoreBonesByGetBoneTransformActiveState (false);
|
||||
} else {
|
||||
for (int i = 0; i < characterModelInfoList.Count; i++) {
|
||||
if (i != currentCharacterModelIndex) {
|
||||
characterModelInfo characterInfo = characterModelInfoList [i];
|
||||
|
||||
if (characterInfo.characterGameObject != null) {
|
||||
if (characterInfo.characterGameObject.activeSelf) {
|
||||
characterInfo.characterGameObject.SetActive (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (useEventOnReplaceCharacterModel) {
|
||||
eventOnReplaceCharacterModel.Invoke ();
|
||||
}
|
||||
|
||||
if (useEventToSendCurrentCharacterModelSelected) {
|
||||
eventToSendCurrentCharacterModelSelected.Invoke (currentCharacterModelInfo.characterGameObject);
|
||||
}
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("selecting " + currentCharacterModelInfo.Name);
|
||||
}
|
||||
|
||||
if (currentCharacterModelInfo.useEventOnSelectCharacterModel) {
|
||||
currentCharacterModelInfo.eventOnSelectCharacterModel.Invoke ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setNextCharacterModel ()
|
||||
{
|
||||
setNextOrPreviousCharacterModel (true);
|
||||
}
|
||||
|
||||
public void setPreviousCharacterModel ()
|
||||
{
|
||||
setNextOrPreviousCharacterModel (false);
|
||||
}
|
||||
|
||||
public void setNextOrPreviousCharacterModel (bool state)
|
||||
{
|
||||
if (state) {
|
||||
currentCharacterModelIndex++;
|
||||
|
||||
if (currentCharacterModelIndex >= characterModelInfoList.Count) {
|
||||
currentCharacterModelIndex = 0;
|
||||
}
|
||||
} else {
|
||||
currentCharacterModelIndex--;
|
||||
|
||||
if (currentCharacterModelIndex < 0) {
|
||||
currentCharacterModelIndex = characterModelInfoList.Count - 1;
|
||||
}
|
||||
}
|
||||
|
||||
string characterModelNameToUse = characterModelInfoList [currentCharacterModelIndex].Name;
|
||||
|
||||
currentCharacterModelIndex = -1;
|
||||
|
||||
replaceCharacterModel (characterModelNameToUse);
|
||||
}
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public class characterModelInfo
|
||||
{
|
||||
[Header ("Main Setting")]
|
||||
[Space]
|
||||
|
||||
public string Name;
|
||||
|
||||
public int characterModelID;
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
|
||||
public GameObject characterPrefab;
|
||||
public GameObject characterGameObject;
|
||||
|
||||
public adjustCharacterHeightSystem mainAdjustCharacterHeightSystem;
|
||||
|
||||
[Space]
|
||||
[Header ("Event Settings")]
|
||||
[Space]
|
||||
|
||||
public bool useEventOnSelectCharacterModel;
|
||||
public UnityEvent eventOnSelectCharacterModel;
|
||||
public UnityEvent eventOnChangeToAnotherCharacterModel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bbb9bb4b290d1ce4c9608f2960e9051c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Player/Character Builder/characterModelListManager.cs
|
||||
uploadId: 889948
|
||||
@@ -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/Player/Character Builder/characterSettingsTemplate.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -85,6 +85,9 @@ public class ragdollBuilder : MonoBehaviour
|
||||
int direction;
|
||||
|
||||
|
||||
bool checkIfRagdollComponentsAlreadyAddedOnModelActive;
|
||||
|
||||
|
||||
public void getCharacterBonesFromEditor ()
|
||||
{
|
||||
getCharacterBones ();
|
||||
@@ -97,33 +100,69 @@ public class ragdollBuilder : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void setCharacterBones (Transform newHead,
|
||||
|
||||
Transform newRightElbow,
|
||||
Transform newLeftElbow,
|
||||
Transform newRightArm,
|
||||
Transform newLeftArm,
|
||||
|
||||
Transform newMiddleSpine,
|
||||
Transform newPelvis,
|
||||
|
||||
Transform newRightHips,
|
||||
Transform newLeftHips,
|
||||
Transform newRightKnee,
|
||||
Transform newLeftKnee)
|
||||
{
|
||||
|
||||
head = newHead;
|
||||
|
||||
rightElbow = newRightElbow;
|
||||
leftElbow = newLeftElbow;
|
||||
rightArm = newRightArm;
|
||||
leftArm = newLeftArm;
|
||||
|
||||
middleSpine = newMiddleSpine;
|
||||
pelvis = newPelvis;
|
||||
|
||||
rightHips = newRightHips;
|
||||
leftHips = newLeftHips;
|
||||
rightKnee = newRightKnee;
|
||||
leftKnee = newLeftKnee;
|
||||
}
|
||||
|
||||
bool ignoreStoreBonesByGetBoneTransformActive;
|
||||
|
||||
public void getCharacterBones ()
|
||||
{
|
||||
if (animator != null) {
|
||||
|
||||
bonesTransforms.Clear ();
|
||||
|
||||
pelvis = animator.GetBoneTransform (HumanBodyBones.Hips);
|
||||
if (!ignoreStoreBonesByGetBoneTransformActive) {
|
||||
pelvis = animator.GetBoneTransform (HumanBodyBones.Hips);
|
||||
|
||||
leftHips = animator.GetBoneTransform (HumanBodyBones.LeftUpperLeg);
|
||||
leftHips = animator.GetBoneTransform (HumanBodyBones.LeftUpperLeg);
|
||||
|
||||
leftKnee = animator.GetBoneTransform (HumanBodyBones.LeftLowerLeg);
|
||||
leftKnee = animator.GetBoneTransform (HumanBodyBones.LeftLowerLeg);
|
||||
|
||||
rightHips = animator.GetBoneTransform (HumanBodyBones.RightUpperLeg);
|
||||
rightHips = animator.GetBoneTransform (HumanBodyBones.RightUpperLeg);
|
||||
|
||||
rightKnee = animator.GetBoneTransform (HumanBodyBones.RightLowerLeg);
|
||||
rightKnee = animator.GetBoneTransform (HumanBodyBones.RightLowerLeg);
|
||||
|
||||
leftArm = animator.GetBoneTransform (HumanBodyBones.LeftUpperArm);
|
||||
leftArm = animator.GetBoneTransform (HumanBodyBones.LeftUpperArm);
|
||||
|
||||
leftElbow = animator.GetBoneTransform (HumanBodyBones.LeftLowerArm);
|
||||
leftElbow = animator.GetBoneTransform (HumanBodyBones.LeftLowerArm);
|
||||
|
||||
rightArm = animator.GetBoneTransform (HumanBodyBones.RightUpperArm);
|
||||
rightArm = animator.GetBoneTransform (HumanBodyBones.RightUpperArm);
|
||||
|
||||
rightElbow = animator.GetBoneTransform (HumanBodyBones.RightLowerArm);
|
||||
rightElbow = animator.GetBoneTransform (HumanBodyBones.RightLowerArm);
|
||||
|
||||
middleSpine = animator.GetBoneTransform (HumanBodyBones.Chest);
|
||||
middleSpine = animator.GetBoneTransform (HumanBodyBones.Chest);
|
||||
|
||||
head = animator.GetBoneTransform (HumanBodyBones.Head);
|
||||
head = animator.GetBoneTransform (HumanBodyBones.Head);
|
||||
}
|
||||
|
||||
//add every bone to a list
|
||||
addBonesTransforms ();
|
||||
@@ -277,7 +316,9 @@ public class ragdollBuilder : MonoBehaviour
|
||||
|
||||
GKC_Utils.updateComponent (mainRagdollActivator);
|
||||
|
||||
print ("Ragdoll Activator components assigned and updated");
|
||||
if (!Application.isPlaying) {
|
||||
print ("Ragdoll Activator components assigned and updated");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,7 +371,23 @@ public class ragdollBuilder : MonoBehaviour
|
||||
{
|
||||
Vector3 center = Vector3.zero;
|
||||
|
||||
removeRagdoll ();
|
||||
bool ignoreAddRagdollComponentsResult = false;
|
||||
|
||||
if (checkIfRagdollComponentsAlreadyAddedOnModelActive) {
|
||||
//check if the model has ragdoll elements on it already
|
||||
|
||||
if (pelvis != null) {
|
||||
if (pelvis.gameObject.GetComponent<BoxCollider> () != null) {
|
||||
ignoreAddRagdollComponentsResult = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//print ("ignoreAddRagdollComponentsResult " + ignoreAddRagdollComponentsResult);
|
||||
|
||||
if (!ignoreAddRagdollComponentsResult) {
|
||||
removeRagdoll ();
|
||||
}
|
||||
|
||||
for (int i = 0; i < bones.Count; i++) {
|
||||
//create capsule colliders
|
||||
@@ -376,7 +433,13 @@ public class ragdollBuilder : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
CapsuleCollider collider = bones [i].boneTransform.gameObject.AddComponent<CapsuleCollider> ();
|
||||
CapsuleCollider collider = null;
|
||||
|
||||
if (ignoreAddRagdollComponentsResult) {
|
||||
collider = bones [i].boneTransform.gameObject.GetComponent<CapsuleCollider> ();
|
||||
} else {
|
||||
collider = bones [i].boneTransform.gameObject.AddComponent<CapsuleCollider> ();
|
||||
}
|
||||
|
||||
collider.direction = direction;
|
||||
center = Vector3.zero;
|
||||
@@ -387,18 +450,31 @@ public class ragdollBuilder : MonoBehaviour
|
||||
}
|
||||
|
||||
//add rigidbodies
|
||||
bones [i].boneRigidbody = bones [i].boneTransform.gameObject.AddComponent<Rigidbody> ();
|
||||
if (ignoreAddRagdollComponentsResult) {
|
||||
bones [i].boneRigidbody = bones [i].boneTransform.gameObject.GetComponent<Rigidbody> ();
|
||||
} else {
|
||||
bones [i].boneRigidbody = bones [i].boneTransform.gameObject.AddComponent<Rigidbody> ();
|
||||
}
|
||||
|
||||
bones [i].boneRigidbody.mass = bones [i].mass;
|
||||
|
||||
//build joints
|
||||
if (bones [i].parent != null) {
|
||||
CharacterJoint joint = bones [i].boneTransform.gameObject.AddComponent<CharacterJoint> ();
|
||||
CharacterJoint joint = null;
|
||||
|
||||
if (ignoreAddRagdollComponentsResult) {
|
||||
joint = bones [i].boneTransform.gameObject.GetComponent<CharacterJoint> ();
|
||||
} else {
|
||||
joint = bones [i].boneTransform.gameObject.AddComponent<CharacterJoint> ();
|
||||
}
|
||||
|
||||
bones [i].joint = joint;
|
||||
|
||||
//configure joint connections
|
||||
joint.axis = getDirectionAxis (bones [i].boneTransform.InverseTransformDirection (bones [i].axis));
|
||||
joint.swingAxis = getDirectionAxis (bones [i].boneTransform.InverseTransformDirection (bones [i].swingAxis));
|
||||
joint.anchor = Vector3.zero;
|
||||
|
||||
joint.connectedBody = bones [i].parent.boneTransform.GetComponent<Rigidbody> ();
|
||||
|
||||
//configure jount limits
|
||||
@@ -417,20 +493,40 @@ public class ragdollBuilder : MonoBehaviour
|
||||
|
||||
//add box colliders to the hips and spine
|
||||
Bounds boxColliderInfo;
|
||||
BoxCollider boxCollider;
|
||||
BoxCollider boxCollider = null;
|
||||
|
||||
boxColliderInfo = adjustColliderScale (getColliderSize (pelvis), pelvis, middleSpine, false);
|
||||
boxCollider = pelvis.gameObject.AddComponent<BoxCollider> ();
|
||||
|
||||
if (ignoreAddRagdollComponentsResult) {
|
||||
boxCollider = pelvis.gameObject.GetComponent<BoxCollider> ();
|
||||
} else {
|
||||
boxCollider = pelvis.gameObject.AddComponent<BoxCollider> ();
|
||||
}
|
||||
|
||||
boxCollider.center = boxColliderInfo.center;
|
||||
boxCollider.size = boxColliderInfo.size * spineScale;
|
||||
|
||||
boxColliderInfo = adjustColliderScale (getColliderSize (middleSpine), middleSpine, middleSpine, true);
|
||||
boxCollider = middleSpine.gameObject.AddComponent<BoxCollider> ();
|
||||
|
||||
if (ignoreAddRagdollComponentsResult) {
|
||||
boxCollider = middleSpine.gameObject.GetComponent<BoxCollider> ();
|
||||
} else {
|
||||
boxCollider = middleSpine.gameObject.AddComponent<BoxCollider> ();
|
||||
}
|
||||
|
||||
boxCollider.center = boxColliderInfo.center;
|
||||
boxCollider.size = boxColliderInfo.size * spineScale;
|
||||
|
||||
//add head collider
|
||||
float radius = (GKC_Utils.distance (rightArm.transform.position, leftArm.transform.position)) / 4;
|
||||
SphereCollider sphere = head.gameObject.AddComponent<SphereCollider> ();
|
||||
SphereCollider sphere = null;
|
||||
|
||||
if (ignoreAddRagdollComponentsResult) {
|
||||
sphere = head.gameObject.GetComponent<SphereCollider> ();
|
||||
} else {
|
||||
sphere = head.gameObject.AddComponent<SphereCollider> ();
|
||||
}
|
||||
|
||||
sphere.radius = radius;
|
||||
center = Vector3.zero;
|
||||
|
||||
@@ -638,6 +734,16 @@ public class ragdollBuilder : MonoBehaviour
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setCheckIfRagdollComponentsAlreadyAddedOnModelActiveState (bool state)
|
||||
{
|
||||
checkIfRagdollComponentsAlreadyAddedOnModelActive = state;
|
||||
}
|
||||
|
||||
public void setIgnoreStoreBonesByGetBoneTransformActiveState (bool state)
|
||||
{
|
||||
ignoreStoreBonesByGetBoneTransformActive = state;
|
||||
}
|
||||
|
||||
public void getAnimator (Animator anim)
|
||||
{
|
||||
animator = anim;
|
||||
@@ -651,6 +757,8 @@ public class ragdollBuilder : MonoBehaviour
|
||||
void updateComponent ()
|
||||
{
|
||||
GKC_Utils.updateComponent (this);
|
||||
|
||||
GKC_Utils.updateDirtyScene ("Update Ragdoll Builder", gameObject);
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
|
||||
@@ -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/Player/Character Builder/ragdollBuilder.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -48,10 +48,21 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
public bool useTimeBulletDuration;
|
||||
public float timeBulletDuration;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool useEventsOnTimeBullet;
|
||||
public UnityEvent eventOnTimeBulletStart;
|
||||
public UnityEvent eventOnTimeBulletEnd;
|
||||
|
||||
[Space]
|
||||
[Header ("Time Bullet Animation Settings")]
|
||||
[Space]
|
||||
|
||||
public bool setUnscaledTimeOnAnimator;
|
||||
|
||||
public bool setCharacterAnimationSpeed;
|
||||
public float characterAnimationSpeed = 1.6f;
|
||||
|
||||
[Space]
|
||||
[Header ("Physics Settings")]
|
||||
[Space]
|
||||
@@ -79,7 +90,7 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
public string horizontalAnimatorName = "Horizontal Action";
|
||||
public string verticalAnimatorName = "Vertical Action";
|
||||
|
||||
public float delayToResumeAfterGetUp = 1;
|
||||
//public float delayToResumeAfterGetUp = 1.2f;
|
||||
|
||||
[Space]
|
||||
[Header ("Third Person Camera State Settings")]
|
||||
@@ -119,6 +130,10 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
|
||||
public bool groundDetectedAfterJump;
|
||||
|
||||
public bool isFullBodyAwarenessActive;
|
||||
|
||||
public float bodyWeight;
|
||||
|
||||
[Space]
|
||||
[Header ("Events Settings")]
|
||||
[Space]
|
||||
@@ -126,11 +141,20 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
public UnityEvent eventOnStart;
|
||||
public UnityEvent eventOnEnd;
|
||||
|
||||
[Space]
|
||||
|
||||
public UnityEvent eventOnGetUpForward;
|
||||
public UnityEvent eventOnGetUpBackward;
|
||||
public UnityEvent eventOnGetUpRight;
|
||||
public UnityEvent eventOnGetUpLeft;
|
||||
|
||||
[Space]
|
||||
|
||||
public UnityEvent eventOnGetUpForwardFromBack;
|
||||
public UnityEvent eventOnGetUpBackwardFromBack;
|
||||
public UnityEvent eventOnGetUpRightFromBack;
|
||||
public UnityEvent eventOnGetUpLeftFromBack;
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
@@ -155,6 +179,8 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
|
||||
public Transform playerTransform;
|
||||
|
||||
|
||||
|
||||
Vector3 lookDirection;
|
||||
|
||||
Vector2 mouseAxisValues;
|
||||
@@ -177,7 +203,7 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
|
||||
string previousCameraState;
|
||||
|
||||
float bodyWeight;
|
||||
string defaultThirdPersonStateName = "";
|
||||
|
||||
Vector3 lastJumpDirection;
|
||||
|
||||
@@ -199,33 +225,32 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
verticalAnimatorID = Animator.StringToHash (verticalAnimatorName);
|
||||
}
|
||||
|
||||
void Update ()
|
||||
{
|
||||
if (movementActive) {
|
||||
if (!activateGetUp) {
|
||||
lookDirectionTarget = mainCameraTransform.position + mainCameraTransform.forward * lookDirectionForwardOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FixedUpdate ()
|
||||
{
|
||||
if (movementActive) {
|
||||
if (activateGetUp) {
|
||||
if (Time.unscaledTime > delayToResumeAfterGetUp + lastTimeGetup) {
|
||||
disableMovement ();
|
||||
//if (Time.unscaledTime > delayToResumeAfterGetUp + lastTimeGetup) {
|
||||
// disableMovement ();
|
||||
//}
|
||||
|
||||
if (Time.unscaledTime > 0.3f + lastTimeGetup) {
|
||||
if (!mainPlayerController.isActionActive () && Time.time > mainPlayerController.getLastTimeActionActive () + 0.04f) {
|
||||
disableMovement ();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Vector3 aimDirection = mainCameraTransform.forward;
|
||||
if (!isFullBodyAwarenessActive) {
|
||||
Vector3 aimDirection = mainCameraTransform.forward;
|
||||
|
||||
aimDirection.y = 0f;
|
||||
aimDirection.y = 0f;
|
||||
|
||||
aimDirection = aimDirection.normalized;
|
||||
aimDirection = aimDirection.normalized;
|
||||
|
||||
aimDirection = playerTransform.InverseTransformDirection (aimDirection);
|
||||
aimDirection = playerTransform.InverseTransformDirection (aimDirection);
|
||||
|
||||
mainAnimator.SetFloat (horizontalAnimatorID, aimDirection.x);
|
||||
mainAnimator.SetFloat (verticalAnimatorID, aimDirection.z);
|
||||
mainAnimator.SetFloat (horizontalAnimatorID, aimDirection.x);
|
||||
mainAnimator.SetFloat (verticalAnimatorID, aimDirection.z);
|
||||
}
|
||||
|
||||
if (mainPlayerController.isPlayerOnGround ()) {
|
||||
if (Time.unscaledTime > minWaitToCheckOnGroundState + lastTimeMovementActive) {
|
||||
@@ -253,7 +278,7 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
|
||||
if (useEventsOnTimeBullet && timeBulletActive) {
|
||||
if (Time.unscaledTime > lastTimeMovementActive + timeBulletDuration) {
|
||||
// print (Time.unscaledTime + " " + (lastTimeMovementActive + timeBulletDuration));
|
||||
//print (Time.unscaledTime + " " + (lastTimeMovementActive + timeBulletDuration));
|
||||
|
||||
checkTimeBullet (false);
|
||||
}
|
||||
@@ -262,6 +287,68 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
}
|
||||
}
|
||||
|
||||
public override void updateOnAnimatorIKState ()
|
||||
{
|
||||
if (!updateIKEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
//if (isFullBodyAwarenessActive) {
|
||||
// return;
|
||||
//}
|
||||
|
||||
if (movementActive) {
|
||||
if (!activateGetUp) {
|
||||
lookDirectionTarget = mainCameraTransform.position + mainCameraTransform.forward * lookDirectionForwardOffset;
|
||||
}
|
||||
}
|
||||
|
||||
if (isFullBodyAwarenessActive) {
|
||||
mainAnimator.SetLookAtWeight (bodyWeight, 1, 1.0f, 1.0f, 0.7f);
|
||||
} else {
|
||||
mainAnimator.SetLookAtWeight (bodyWeight, 0.5f, 1.0f, 1.0f, 0.7f);
|
||||
}
|
||||
|
||||
mainAnimator.SetLookAtPosition (lookDirectionTarget);
|
||||
|
||||
if (activateGetUp || jumpCoroutineActive) {
|
||||
bodyWeight = Mathf.Lerp (0, bodyWeight, currentTimeForRisingHands / bodyWeightLerpSpeed);
|
||||
} else {
|
||||
bodyWeight = Mathf.Lerp (1, bodyWeight, currentTimeForRisingHands / bodyWeightLerpSpeed);
|
||||
}
|
||||
|
||||
if (activateGetUp || jumpCoroutineActive) {
|
||||
if (!armsIKActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentTimeForRisingHands > 0) {
|
||||
currentTimeForRisingHands -= Time.unscaledDeltaTime;
|
||||
|
||||
currentArmsWeight = Mathf.Lerp (0, armsWeight, currentTimeForRisingHands / timeForRaisingHands);
|
||||
} else {
|
||||
currentTimeForRisingHands = 0;
|
||||
|
||||
currentArmsWeight = 0;
|
||||
|
||||
armsIKActive = false;
|
||||
}
|
||||
|
||||
} else {
|
||||
armsIKActive = true;
|
||||
|
||||
if (currentTimeForRisingHands < timeForRaisingHands) {
|
||||
currentTimeForRisingHands += Time.unscaledDeltaTime;
|
||||
|
||||
currentArmsWeight = Mathf.Lerp (0, armsWeight, currentTimeForRisingHands / timeForRaisingHands);
|
||||
} else {
|
||||
currentTimeForRisingHands = timeForRaisingHands;
|
||||
|
||||
currentArmsWeight = armsWeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setMovementActiveState (bool state)
|
||||
{
|
||||
if (!movementEnabled) {
|
||||
@@ -291,14 +378,36 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
|
||||
checkTimeBullet (true);
|
||||
} else {
|
||||
bool gettingUpFromBellyResult = false;
|
||||
|
||||
float bodyAngle = Vector3.SignedAngle (playerTransform.forward, mainCameraTransform.forward, playerTransform.up);
|
||||
|
||||
if (Mathf.Abs (bodyAngle) < 100) {
|
||||
gettingUpFromBellyResult = true;
|
||||
}
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("gettingUpFromBellyResult " + gettingUpFromBellyResult + " " + Mathf.Abs (bodyAngle));
|
||||
}
|
||||
|
||||
bool lookingForward = false;
|
||||
|
||||
Vector3 movementDirection = playerTransform.forward;
|
||||
|
||||
if (!gettingUpFromBellyResult) {
|
||||
movementDirection *= -1;
|
||||
}
|
||||
|
||||
if (playerInput.getPlayerMovementAxis () != Vector2.zero) {
|
||||
movementDirection = mainPlayerController.getMoveInputDirection ();
|
||||
}
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("movementDirection " + movementDirection);
|
||||
print ("getPlayerMovementAxis " + playerInput.getPlayerMovementAxis ());
|
||||
print ("getMoveInputDirection " + mainPlayerController.getMoveInputDirection ());
|
||||
}
|
||||
|
||||
float angle = Vector3.SignedAngle (movementDirection, mainCameraTransform.forward, playerTransform.up);
|
||||
|
||||
float ABSAngle = Mathf.Abs (angle);
|
||||
@@ -319,24 +428,62 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
|
||||
mainAnimator.SetInteger (actionIDAnimatorID, 0);
|
||||
|
||||
if (lookingForward) {
|
||||
if (ABSAngle < 45) {
|
||||
eventOnGetUpForward.Invoke ();
|
||||
} else if (angle < 0) {
|
||||
eventOnGetUpRight.Invoke ();
|
||||
if (gettingUpFromBellyResult) {
|
||||
if (lookingForward) {
|
||||
if (ABSAngle < 45) {
|
||||
eventOnGetUpForward.Invoke ();
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("activating event on right");
|
||||
if (showDebugPrint) {
|
||||
print ("activating event on forward");
|
||||
}
|
||||
} else if (angle < 0) {
|
||||
eventOnGetUpRight.Invoke ();
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("activating event on right");
|
||||
}
|
||||
} else {
|
||||
eventOnGetUpLeft.Invoke ();
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("activating event on left");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
eventOnGetUpLeft.Invoke ();
|
||||
eventOnGetUpBackward.Invoke ();
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("activating event on left");
|
||||
print ("activating event on backward");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
eventOnGetUpBackward.Invoke ();
|
||||
if (lookingForward) {
|
||||
if (ABSAngle < 45) {
|
||||
eventOnGetUpForwardFromBack.Invoke ();
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("activating event on forward");
|
||||
}
|
||||
} else if (angle < 0) {
|
||||
eventOnGetUpRightFromBack.Invoke ();
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("activating event on right");
|
||||
}
|
||||
} else {
|
||||
eventOnGetUpLeftFromBack.Invoke ();
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("activating event on left");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
eventOnGetUpBackwardFromBack.Invoke ();
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("activating event on backward");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkTimeBullet (false);
|
||||
@@ -344,6 +491,18 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
lastJumpDirection = Vector3.zero;
|
||||
}
|
||||
|
||||
if (setUnscaledTimeOnAnimator) {
|
||||
mainPlayerController.setAnimatorUnscaledTimeState (state);
|
||||
}
|
||||
|
||||
if (setCharacterAnimationSpeed) {
|
||||
if (state) {
|
||||
mainPlayerController.setReducedVelocity (characterAnimationSpeed);
|
||||
} else {
|
||||
mainPlayerController.setNormalVelocity ();
|
||||
}
|
||||
}
|
||||
|
||||
groundDetectedAfterJump = false;
|
||||
|
||||
//desactivar el salto y demas acciones que no se puedan hacer, quizas algunas cosas de las armas
|
||||
@@ -388,7 +547,7 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
{
|
||||
jumpCoroutineActive = true;
|
||||
|
||||
yield return new WaitForSeconds (rollOnStartDuration);
|
||||
yield return new WaitForSecondsRealtime (rollOnStartDuration);
|
||||
|
||||
jumpCoroutineActive = false;
|
||||
|
||||
@@ -451,6 +610,8 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
{
|
||||
bool isFirstPersonActive = mainPlayerController.isPlayerOnFirstPerson ();
|
||||
|
||||
isFullBodyAwarenessActive = mainPlayerCamera.isFullBodyAwarenessActive ();
|
||||
|
||||
if (state) {
|
||||
if (startActionWithRoll) {
|
||||
mainAnimator.SetInteger (actionIDAnimatorID, actionIDWithRoll);
|
||||
@@ -461,9 +622,24 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
mainAnimator.SetBool (externalControlleBehaviorActiveAnimatorID, state);
|
||||
|
||||
if (setNewCameraStateOnThirdPerson && !isFirstPersonActive) {
|
||||
previousCameraState = mainPlayerCamera.getCurrentStateName ();
|
||||
if (isFullBodyAwarenessActive) {
|
||||
|
||||
mainPlayerCamera.setCameraStateOnlyOnThirdPerson (newCameraStateOnThirdPerson);
|
||||
} else {
|
||||
if (defaultThirdPersonStateName == "") {
|
||||
defaultThirdPersonStateName = mainPlayerCamera.getDefaultThirdPersonStateName ();
|
||||
|
||||
mainPlayerCamera.setDefaultThirdPersonStateName (newCameraStateOnThirdPerson);
|
||||
|
||||
previousCameraState = mainPlayerCamera.getCurrentStateName ();
|
||||
|
||||
mainPlayerCamera.setCameraStateOnlyOnThirdPerson (newCameraStateOnThirdPerson);
|
||||
|
||||
mainPlayerCamera.setUseCustomThirdPersonAimActivePausedState (true);
|
||||
|
||||
mainPlayerCamera.setUseCustomThirdPersonAimActiveState (true,
|
||||
newCameraStateOnThirdPerson, newCameraStateOnThirdPerson);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
carryingWeaponsPreviously = mainPlayerWeaponsManager.isPlayerCarringWeapon ();
|
||||
@@ -485,12 +661,26 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
mainAnimator.SetInteger (actionIDAnimatorID, 0);
|
||||
|
||||
if (setNewCameraStateOnThirdPerson && !isFirstPersonActive) {
|
||||
if (previousCameraState != "") {
|
||||
if (previousCameraState != newCameraStateOnThirdPerson) {
|
||||
mainPlayerCamera.setCameraStateOnlyOnThirdPerson (previousCameraState);
|
||||
if (isFullBodyAwarenessActive) {
|
||||
|
||||
} else {
|
||||
if (defaultThirdPersonStateName != "") {
|
||||
mainPlayerCamera.setDefaultThirdPersonStateName (defaultThirdPersonStateName);
|
||||
|
||||
defaultThirdPersonStateName = "";
|
||||
}
|
||||
|
||||
previousCameraState = "";
|
||||
if (previousCameraState != "") {
|
||||
if (previousCameraState != newCameraStateOnThirdPerson) {
|
||||
mainPlayerCamera.setCameraStateOnlyOnThirdPerson (previousCameraState);
|
||||
}
|
||||
|
||||
previousCameraState = "";
|
||||
}
|
||||
|
||||
mainPlayerCamera.setUseCustomThirdPersonAimActivePausedState (false);
|
||||
|
||||
mainPlayerCamera.setUseCustomThirdPersonAimActiveState (false, "", "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,7 +711,9 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
|
||||
mainPlayerController.setAddExtraRotationPausedState (state);
|
||||
|
||||
//if (!isFullBodyAwarenessActive) {
|
||||
mainHeadTrack.setHeadTrackSmoothPauseState (state);
|
||||
//}
|
||||
|
||||
mainPlayerController.setUseExternalControllerBehaviorPausedState (state);
|
||||
|
||||
@@ -535,6 +727,8 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
|
||||
mainPlayerController.setIgnoreLookInCameraDirectionOnFreeFireActiveState (state);
|
||||
|
||||
mainPlayerController.setIgnoreLookInCameraDirectionValue (state);
|
||||
|
||||
checkEventOnStateChange (state);
|
||||
|
||||
mainPlayerController.setFootStepManagerState (state);
|
||||
@@ -542,6 +736,23 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
mainPlayerController.setIgnoreInputOnAirControlActiveState (state);
|
||||
|
||||
mainPlayerController.setPlayerActionsInputEnabledState (!state);
|
||||
|
||||
mainPlayerController.setInoreInputOnNewGroundAdherenceActive (state);
|
||||
|
||||
if (state) {
|
||||
mainPlayerCamera.enableOrDisableChangeCameraView (false);
|
||||
} else {
|
||||
mainPlayerCamera.setOriginalchangeCameraViewEnabledValue ();
|
||||
}
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("setPlayerState " + state);
|
||||
}
|
||||
|
||||
if (isFullBodyAwarenessActive) {
|
||||
mainAnimator.SetFloat (horizontalAnimatorID, 0);
|
||||
mainAnimator.SetFloat (verticalAnimatorID, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void resetActionIdOnTimeBulletJump ()
|
||||
@@ -549,54 +760,6 @@ public class bulletTimeFiringSystem : OnAnimatorIKComponent
|
||||
mainAnimator.SetInteger (actionIDAnimatorID, 0);
|
||||
}
|
||||
|
||||
public override void updateOnAnimatorIKState ()
|
||||
{
|
||||
if (!updateIKEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
mainAnimator.SetLookAtPosition (lookDirectionTarget);
|
||||
|
||||
mainAnimator.SetLookAtWeight (bodyWeight, 0.5f, 1.0f, 1.0f, 0.7f);
|
||||
|
||||
if (activateGetUp || jumpCoroutineActive) {
|
||||
bodyWeight = Mathf.Lerp (0, bodyWeight, currentTimeForRisingHands / bodyWeightLerpSpeed);
|
||||
} else {
|
||||
bodyWeight = Mathf.Lerp (1, bodyWeight, currentTimeForRisingHands / bodyWeightLerpSpeed);
|
||||
}
|
||||
|
||||
if (activateGetUp || jumpCoroutineActive) {
|
||||
if (!armsIKActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentTimeForRisingHands > 0) {
|
||||
currentTimeForRisingHands -= Time.unscaledDeltaTime;
|
||||
|
||||
currentArmsWeight = Mathf.Lerp (0, armsWeight, currentTimeForRisingHands / timeForRaisingHands);
|
||||
} else {
|
||||
currentTimeForRisingHands = 0;
|
||||
|
||||
currentArmsWeight = 0;
|
||||
|
||||
armsIKActive = false;
|
||||
}
|
||||
|
||||
} else {
|
||||
armsIKActive = true;
|
||||
|
||||
if (currentTimeForRisingHands < timeForRaisingHands) {
|
||||
currentTimeForRisingHands += Time.unscaledDeltaTime;
|
||||
|
||||
currentArmsWeight = Mathf.Lerp (0, armsWeight, currentTimeForRisingHands / timeForRaisingHands);
|
||||
} else {
|
||||
currentTimeForRisingHands = timeForRaisingHands;
|
||||
|
||||
currentArmsWeight = armsWeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setCurrentPlayerActionSystemCustomActionCategoryID ()
|
||||
{
|
||||
if (movementActive) {
|
||||
|
||||
@@ -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/Player/Extra Movements/bulletTimeFiringSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/climbDetectionCollisionSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/climbRopeSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/climbRopeTriggerMatchSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/climbRopeTriggerSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/externalControllerBehavior.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/externalControllerBehaviorManager.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/flySystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/freeClimbSystem.cs.bak
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/freeClimbSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/freeClimbSystemIK.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/freeClimbZoneSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -5,325 +5,342 @@ using UnityEngine.Events;
|
||||
|
||||
public class freeFallCharacterActivator : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public bool checkCharacterFallEnabled = true;
|
||||
public bool checkCharacterFallEnabled = true;
|
||||
|
||||
public float minTimeOnAirToActivateFreeFall = 2;
|
||||
public float minTimeOnAirToActivateFreeFall = 2;
|
||||
|
||||
public int regularAirID = -1;
|
||||
public int freeFallID = 3;
|
||||
public int regularAirID = -1;
|
||||
public int freeFallID = 3;
|
||||
|
||||
public bool setNewCameraStateOnFreeFallActive;
|
||||
public bool setNewCameraStateOnFreeFallActive;
|
||||
|
||||
public string newCameraStateOnFreeFall;
|
||||
public string newCameraStateOnFreeFall;
|
||||
|
||||
public Vector3 capsuleColliderCenter = new Vector3 (0, 1, 0);
|
||||
public Vector3 capsuleColliderCenter = new Vector3 (0, 1, 0);
|
||||
|
||||
public bool useMinFallSpeedToActivateState;
|
||||
public float minFallSpeedToActivateState;
|
||||
public bool useMinFallSpeedToActivateState;
|
||||
public float minFallSpeedToActivateState;
|
||||
|
||||
public bool avoidFallDamageOnFreeFall;
|
||||
public bool avoidFallDamageOnFreeFall;
|
||||
|
||||
public bool avoidFallDamageOnFreeFallOnlyOnTurbo;
|
||||
public bool avoidFallDamageOnFreeFallOnlyOnTurbo;
|
||||
|
||||
[Space]
|
||||
[Header ("Turbo Settings")]
|
||||
[Space]
|
||||
[Space]
|
||||
[Header ("Turbo Settings")]
|
||||
[Space]
|
||||
|
||||
public bool fallTurboEnabled = true;
|
||||
public float fallTurboMultiplier = 2;
|
||||
public bool fallTurboEnabled = true;
|
||||
public float fallTurboMultiplier = 2;
|
||||
|
||||
public bool useCameraShake;
|
||||
public string regularCameraShakeName;
|
||||
public bool useCameraShake;
|
||||
public string regularCameraShakeName;
|
||||
|
||||
public bool useMaxFallSpeed;
|
||||
public bool useMaxFallSpeed;
|
||||
|
||||
public float maxFallSpeed;
|
||||
public float maxFallSpeed;
|
||||
|
||||
[Space]
|
||||
[Space]
|
||||
|
||||
public bool useEventOnLandingWithTurbo;
|
||||
public UnityEvent eventOnLandingWithTurbo;
|
||||
public bool useEventOnLandingWithTurbo;
|
||||
public UnityEvent eventOnLandingWithTurbo;
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public bool checkingFreeFall;
|
||||
public bool showDebugPrint;
|
||||
|
||||
public bool freeFallActive;
|
||||
public bool checkingFreeFall;
|
||||
|
||||
public bool freeFallPaused;
|
||||
public bool freeFallActive;
|
||||
|
||||
public bool fallTurboActive;
|
||||
public bool freeFallPaused;
|
||||
|
||||
[Space]
|
||||
[Header ("Event Settings")]
|
||||
[Space]
|
||||
public bool fallTurboActive;
|
||||
|
||||
public bool useEventsOnFreeFallStateChange;
|
||||
public UnityEvent eventOnFreeFallActive;
|
||||
public UnityEvent eventOnFreeFallDeactivate;
|
||||
[Space]
|
||||
[Header ("Event Settings")]
|
||||
[Space]
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
public bool useEventsOnFreeFallStateChange;
|
||||
public UnityEvent eventOnFreeFallActive;
|
||||
public UnityEvent eventOnFreeFallDeactivate;
|
||||
|
||||
public playerCamera mainPlayerCamera;
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
|
||||
public playerController mainPlayerController;
|
||||
public playerCamera mainPlayerCamera;
|
||||
|
||||
float lastTimeFalling;
|
||||
public playerController mainPlayerController;
|
||||
|
||||
float lastTimeJump;
|
||||
float lastTimeFalling;
|
||||
|
||||
string previousCameraState;
|
||||
float lastTimeJump;
|
||||
|
||||
bool resetCheckOnFreeFallActive;
|
||||
string previousCameraState;
|
||||
|
||||
void Update ()
|
||||
{
|
||||
if (checkCharacterFallEnabled) {
|
||||
if (freeFallPaused) {
|
||||
return;
|
||||
}
|
||||
bool resetCheckOnFreeFallActive;
|
||||
|
||||
if (!checkingFreeFall) {
|
||||
if (!mainPlayerController.isPlayerOnGround () &&
|
||||
mainPlayerController.getCurrentAirID () == regularAirID &&
|
||||
!mainPlayerController.isExternalControlBehaviorForAirTypeActive () &&
|
||||
!mainPlayerController.isPlayerDriving ()) {
|
||||
void Update ()
|
||||
{
|
||||
if (checkCharacterFallEnabled) {
|
||||
if (freeFallPaused) {
|
||||
return;
|
||||
}
|
||||
|
||||
checkingFreeFall = true;
|
||||
if (!checkingFreeFall) {
|
||||
if (!mainPlayerController.isPlayerOnGround () &&
|
||||
mainPlayerController.getCurrentAirID () == regularAirID &&
|
||||
!mainPlayerController.isExternalControlBehaviorForAirTypeActive () &&
|
||||
!mainPlayerController.isPlayerDriving ()) {
|
||||
|
||||
lastTimeFalling = Time.time;
|
||||
}
|
||||
} else {
|
||||
if (!freeFallActive) {
|
||||
if (Time.time > minTimeOnAirToActivateFreeFall + lastTimeFalling && checkFallSpeed ()) {
|
||||
checkingFreeFall = true;
|
||||
|
||||
if (mainPlayerController.getCurrentAirID () == regularAirID) {
|
||||
setFreeFallState (true);
|
||||
} else {
|
||||
checkingFreeFall = false;
|
||||
}
|
||||
} else {
|
||||
if (mainPlayerController.isPlayerOnGround () ||
|
||||
mainPlayerController.isActionActive () ||
|
||||
mainPlayerController.isGravityPowerActive () ||
|
||||
mainPlayerController.isPlayerOnFFOrZeroGravityModeOn () ||
|
||||
mainPlayerController.isChoosingGravityDirection () ||
|
||||
mainPlayerController.isGravityForcePaused () ||
|
||||
mainPlayerController.isWallRunningActive () ||
|
||||
mainPlayerController.isSwimModeActive () ||
|
||||
mainPlayerController.isSphereModeActive () ||
|
||||
mainPlayerController.isExternalControlBehaviorForAirTypeActive () ||
|
||||
mainPlayerController.isPlayerDriving () ||
|
||||
mainPlayerController.isSlowFallExternallyActive ()) {
|
||||
lastTimeFalling = Time.time;
|
||||
}
|
||||
} else {
|
||||
if (!freeFallActive) {
|
||||
if (Time.time > minTimeOnAirToActivateFreeFall + lastTimeFalling && checkFallSpeed ()) {
|
||||
|
||||
setFreeFallState (false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mainPlayerController.isPlayerOnGround () ||
|
||||
mainPlayerController.isPlayerAiming () ||
|
||||
lastTimeJump != mainPlayerController.getLastDoubleJumpTime () ||
|
||||
mainPlayerController.isExternalControlBehaviorForAirTypeActive () ||
|
||||
resetCheckOnFreeFallActive) {
|
||||
|
||||
resetRegularPlayerValues ();
|
||||
|
||||
disableFreeFallActiveState ();
|
||||
}
|
||||
|
||||
if (mainPlayerController.getCurrentAirID () != freeFallID) {
|
||||
disableFreeFallActiveState ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void disableFreeFallActiveState ()
|
||||
{
|
||||
resetCheckOnFreeFallActive = false;
|
||||
|
||||
setFreeFallState (false);
|
||||
}
|
||||
|
||||
public void setFreeFallPausedState (bool state)
|
||||
{
|
||||
if (!state) {
|
||||
if (freeFallActive) {
|
||||
resetRegularPlayerValues ();
|
||||
|
||||
disableFreeFallActiveState ();
|
||||
}
|
||||
}
|
||||
|
||||
freeFallPaused = state;
|
||||
}
|
||||
|
||||
public bool checkFallSpeed ()
|
||||
{
|
||||
if (useMinFallSpeedToActivateState) {
|
||||
if (Mathf.Abs (mainPlayerController.getVerticalSpeed ()) > minFallSpeedToActivateState) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setResetCheckOnFreeFallActiveState (bool state)
|
||||
{
|
||||
resetCheckOnFreeFallActive = state;
|
||||
}
|
||||
|
||||
public void inputEnableOrDisableFallTurbo (bool state)
|
||||
{
|
||||
if (!fallTurboEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (freeFallActive) {
|
||||
setTurboState (state);
|
||||
}
|
||||
}
|
||||
|
||||
void setTurboState (bool state)
|
||||
{
|
||||
if (fallTurboActive == state) {
|
||||
return;
|
||||
}
|
||||
|
||||
fallTurboActive = state;
|
||||
|
||||
if (fallTurboActive) {
|
||||
mainPlayerController.setGravityMultiplierValueFromExternalFunction (fallTurboMultiplier);
|
||||
|
||||
mainPlayerController.setCurrentAirSpeedValue (2);
|
||||
|
||||
if (useCameraShake) {
|
||||
mainPlayerCamera.setShakeCameraState (true, regularCameraShakeName);
|
||||
}
|
||||
} else {
|
||||
mainPlayerController.setGravityMultiplierValue (true, 0);
|
||||
|
||||
mainPlayerController.setCurrentAirSpeedValue (1);
|
||||
|
||||
if (useCameraShake) {
|
||||
mainPlayerCamera.setShakeCameraState (false, "");
|
||||
}
|
||||
}
|
||||
|
||||
if (avoidFallDamageOnFreeFall && avoidFallDamageOnFreeFallOnlyOnTurbo) {
|
||||
mainPlayerController.setFallDamageCheckOnHealthPausedState (state);
|
||||
}
|
||||
|
||||
if (useMaxFallSpeed) {
|
||||
mainPlayerController.setUseMaxFallSpeedExternallyActiveState (state);
|
||||
|
||||
if (state) {
|
||||
mainPlayerController.setCustomMaxFallSpeedExternally (maxFallSpeed);
|
||||
} else {
|
||||
mainPlayerController.setCustomMaxFallSpeedExternally (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void setFreeFallState (bool state)
|
||||
{
|
||||
if (state) {
|
||||
freeFallActive = true;
|
||||
|
||||
mainPlayerController.setCurrentAirIDValue (freeFallID);
|
||||
|
||||
mainPlayerController.setPlayerCapsuleColliderDirection (2);
|
||||
|
||||
mainPlayerController.setPlayerColliderCapsuleCenter (capsuleColliderCenter);
|
||||
|
||||
lastTimeJump = mainPlayerController.getLastDoubleJumpTime ();
|
||||
|
||||
if (setNewCameraStateOnFreeFallActive) {
|
||||
previousCameraState = mainPlayerCamera.getCurrentStateName ();
|
||||
|
||||
mainPlayerCamera.setCameraStateOnlyOnThirdPerson (newCameraStateOnFreeFall);
|
||||
}
|
||||
|
||||
if (avoidFallDamageOnFreeFall && !avoidFallDamageOnFreeFallOnlyOnTurbo) {
|
||||
mainPlayerController.setFallDamageCheckOnHealthPausedState (true);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (avoidFallDamageOnFreeFall) {
|
||||
mainPlayerController.setFallDamageCheckOnHealthPausedState (false);
|
||||
}
|
||||
|
||||
if (fallTurboActive) {
|
||||
if (useEventOnLandingWithTurbo) {
|
||||
if (mainPlayerController.checkIfPlayerOnGroundWithRaycast () || mainPlayerController.isPlayerOnGround ()) {
|
||||
eventOnLandingWithTurbo.Invoke ();
|
||||
}
|
||||
}
|
||||
|
||||
setTurboState (false);
|
||||
}
|
||||
if (mainPlayerController.getCurrentAirID () == regularAirID) {
|
||||
setFreeFallState (true);
|
||||
} else {
|
||||
checkingFreeFall = false;
|
||||
}
|
||||
} else {
|
||||
if (checkIfPlayerBusy ()) {
|
||||
|
||||
checkingFreeFall = false;
|
||||
setFreeFallState (false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mainPlayerController.isPlayerOnGround () ||
|
||||
mainPlayerController.isPlayerAiming () ||
|
||||
lastTimeJump != mainPlayerController.getLastDoubleJumpTime () ||
|
||||
mainPlayerController.isExternalControlBehaviorForAirTypeActive () ||
|
||||
mainPlayerController.isActionActive () ||
|
||||
resetCheckOnFreeFallActive) {
|
||||
|
||||
freeFallActive = false;
|
||||
resetRegularPlayerValues ();
|
||||
|
||||
if (setNewCameraStateOnFreeFallActive) {
|
||||
if (previousCameraState != "") {
|
||||
mainPlayerCamera.setCameraStateOnlyOnThirdPerson (previousCameraState);
|
||||
disableFreeFallActiveState ();
|
||||
}
|
||||
|
||||
previousCameraState = "";
|
||||
}
|
||||
}
|
||||
if (mainPlayerController.getCurrentAirID () != freeFallID) {
|
||||
disableFreeFallActiveState ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (useMaxFallSpeed) {
|
||||
mainPlayerController.setUseMaxFallSpeedExternallyActiveState (false);
|
||||
bool checkIfPlayerBusy ()
|
||||
{
|
||||
if (mainPlayerController.isPlayerOnGround () ||
|
||||
mainPlayerController.isActionActive () ||
|
||||
mainPlayerController.isGravityPowerActive () ||
|
||||
mainPlayerController.isPlayerOnFFOrZeroGravityModeOn () ||
|
||||
mainPlayerController.isChoosingGravityDirection () ||
|
||||
mainPlayerController.isGravityForcePaused () ||
|
||||
mainPlayerController.isWallRunningActive () ||
|
||||
mainPlayerController.isSwimModeActive () ||
|
||||
mainPlayerController.isSphereModeActive () ||
|
||||
mainPlayerController.isExternalControlBehaviorForAirTypeActive () ||
|
||||
mainPlayerController.isPlayerDriving () ||
|
||||
mainPlayerController.isSlowFallExternallyActive ()) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void disableFreeFallActiveState ()
|
||||
{
|
||||
resetCheckOnFreeFallActive = false;
|
||||
|
||||
setFreeFallState (false);
|
||||
}
|
||||
|
||||
public void setFreeFallPausedState (bool state)
|
||||
{
|
||||
if (!state) {
|
||||
if (freeFallActive) {
|
||||
resetRegularPlayerValues ();
|
||||
|
||||
disableFreeFallActiveState ();
|
||||
}
|
||||
}
|
||||
|
||||
freeFallPaused = state;
|
||||
}
|
||||
|
||||
public bool checkFallSpeed ()
|
||||
{
|
||||
if (useMinFallSpeedToActivateState) {
|
||||
if (Mathf.Abs (mainPlayerController.getVerticalSpeed ()) > minFallSpeedToActivateState) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setResetCheckOnFreeFallActiveState (bool state)
|
||||
{
|
||||
resetCheckOnFreeFallActive = state;
|
||||
}
|
||||
|
||||
public void inputEnableOrDisableFallTurbo (bool state)
|
||||
{
|
||||
if (!fallTurboEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (freeFallActive) {
|
||||
setTurboState (state);
|
||||
}
|
||||
}
|
||||
|
||||
void setTurboState (bool state)
|
||||
{
|
||||
if (fallTurboActive == state) {
|
||||
return;
|
||||
}
|
||||
|
||||
fallTurboActive = state;
|
||||
|
||||
if (fallTurboActive) {
|
||||
mainPlayerController.setGravityMultiplierValueFromExternalFunction (fallTurboMultiplier);
|
||||
|
||||
mainPlayerController.setCurrentAirSpeedValue (2);
|
||||
|
||||
if (useCameraShake) {
|
||||
mainPlayerCamera.setShakeCameraState (true, regularCameraShakeName);
|
||||
}
|
||||
} else {
|
||||
mainPlayerController.setGravityMultiplierValue (true, 0);
|
||||
|
||||
mainPlayerController.setCurrentAirSpeedValue (1);
|
||||
|
||||
if (useCameraShake) {
|
||||
mainPlayerCamera.setShakeCameraState (false, "");
|
||||
}
|
||||
}
|
||||
|
||||
if (avoidFallDamageOnFreeFall && avoidFallDamageOnFreeFallOnlyOnTurbo) {
|
||||
mainPlayerController.setFallDamageCheckOnHealthPausedState (state);
|
||||
}
|
||||
|
||||
if (useMaxFallSpeed) {
|
||||
mainPlayerController.setUseMaxFallSpeedExternallyActiveState (state);
|
||||
|
||||
if (state) {
|
||||
mainPlayerController.setCustomMaxFallSpeedExternally (maxFallSpeed);
|
||||
} else {
|
||||
mainPlayerController.setCustomMaxFallSpeedExternally (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void setFreeFallState (bool state)
|
||||
{
|
||||
if (state) {
|
||||
freeFallActive = true;
|
||||
|
||||
mainPlayerController.setCurrentAirIDValue (freeFallID);
|
||||
|
||||
mainPlayerController.setPlayerCapsuleColliderDirection (2);
|
||||
|
||||
mainPlayerController.setPlayerColliderCapsuleCenter (capsuleColliderCenter);
|
||||
|
||||
lastTimeJump = mainPlayerController.getLastDoubleJumpTime ();
|
||||
|
||||
if (setNewCameraStateOnFreeFallActive) {
|
||||
previousCameraState = mainPlayerCamera.getCurrentStateName ();
|
||||
|
||||
mainPlayerCamera.setCameraStateOnlyOnThirdPerson (newCameraStateOnFreeFall);
|
||||
}
|
||||
|
||||
if (avoidFallDamageOnFreeFall && !avoidFallDamageOnFreeFallOnlyOnTurbo) {
|
||||
mainPlayerController.setFallDamageCheckOnHealthPausedState (true);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (avoidFallDamageOnFreeFall) {
|
||||
mainPlayerController.setFallDamageCheckOnHealthPausedState (false);
|
||||
}
|
||||
|
||||
if (fallTurboActive) {
|
||||
if (useEventOnLandingWithTurbo) {
|
||||
if (mainPlayerController.checkIfPlayerOnGroundWithRaycast () || mainPlayerController.isPlayerOnGround ()) {
|
||||
eventOnLandingWithTurbo.Invoke ();
|
||||
}
|
||||
}
|
||||
|
||||
setTurboState (false);
|
||||
}
|
||||
|
||||
mainPlayerController.setCustomMaxFallSpeedExternally (0);
|
||||
}
|
||||
}
|
||||
checkingFreeFall = false;
|
||||
|
||||
checkEventsOnFreeFallStateChange (state);
|
||||
}
|
||||
freeFallActive = false;
|
||||
|
||||
public void stopFreeFallStateIfActive ()
|
||||
{
|
||||
if (freeFallActive) {
|
||||
resetRegularPlayerValues ();
|
||||
if (setNewCameraStateOnFreeFallActive) {
|
||||
if (previousCameraState != "") {
|
||||
mainPlayerCamera.setCameraStateOnlyOnThirdPerson (previousCameraState);
|
||||
|
||||
disableFreeFallActiveState ();
|
||||
}
|
||||
}
|
||||
previousCameraState = "";
|
||||
}
|
||||
}
|
||||
|
||||
void resetRegularPlayerValues ()
|
||||
{
|
||||
if (mainPlayerController.getCurrentAirID () == freeFallID) {
|
||||
mainPlayerController.setCurrentAirIDValue (regularAirID);
|
||||
if (useMaxFallSpeed) {
|
||||
mainPlayerController.setUseMaxFallSpeedExternallyActiveState (false);
|
||||
|
||||
mainPlayerController.setPlayerCapsuleColliderDirection (1);
|
||||
mainPlayerController.setCustomMaxFallSpeedExternally (0);
|
||||
}
|
||||
}
|
||||
|
||||
mainPlayerController.setOriginalPlayerColliderCapsuleScale ();
|
||||
}
|
||||
}
|
||||
checkEventsOnFreeFallStateChange (state);
|
||||
|
||||
void checkEventsOnFreeFallStateChange (bool state)
|
||||
{
|
||||
if (useEventsOnFreeFallStateChange) {
|
||||
if (state) {
|
||||
eventOnFreeFallActive.Invoke ();
|
||||
} else {
|
||||
eventOnFreeFallDeactivate.Invoke ();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (showDebugPrint) {
|
||||
print ("setFreeFallState " + state);
|
||||
}
|
||||
}
|
||||
|
||||
public void stopFreeFallStateIfActive ()
|
||||
{
|
||||
if (freeFallActive) {
|
||||
resetRegularPlayerValues ();
|
||||
|
||||
disableFreeFallActiveState ();
|
||||
}
|
||||
}
|
||||
|
||||
void resetRegularPlayerValues ()
|
||||
{
|
||||
if (mainPlayerController.getCurrentAirID () == freeFallID) {
|
||||
mainPlayerController.setCurrentAirIDValue (regularAirID);
|
||||
|
||||
mainPlayerController.setPlayerCapsuleColliderDirection (1);
|
||||
|
||||
mainPlayerController.setOriginalPlayerColliderCapsuleScale ();
|
||||
}
|
||||
}
|
||||
|
||||
void checkEventsOnFreeFallStateChange (bool state)
|
||||
{
|
||||
if (useEventsOnFreeFallStateChange) {
|
||||
if (state) {
|
||||
eventOnFreeFallActive.Invoke ();
|
||||
} else {
|
||||
eventOnFreeFallDeactivate.Invoke ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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/Player/Extra Movements/freeFallCharacterActivator.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/jetpackSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/paragliderSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/playerSphereModeSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/portableClimbRopeTriggerSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/portableWalkOnBalanceTriggerSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/railSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/railTriggerSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/rollOnLandingSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/simpleWaypointSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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/Player/Extra Movements/slideSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/slideZoneSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/swimSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/swimTriggerSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -99,9 +99,7 @@ public class walkOnBalanceSystem : externalControllerBehavior
|
||||
|
||||
public Vector3 targetDirection;
|
||||
|
||||
public simpleWaypointSystem currentSimpleWaypointSystem;
|
||||
|
||||
public List<Transform> currentWayPoints = new List<Transform> ();
|
||||
public Vector3 currentTargetDirection;
|
||||
|
||||
public bool adjustingPlayerToMovement;
|
||||
|
||||
@@ -118,6 +116,12 @@ public class walkOnBalanceSystem : externalControllerBehavior
|
||||
|
||||
public bool jumpOnEndState;
|
||||
|
||||
[Space]
|
||||
|
||||
public simpleWaypointSystem currentSimpleWaypointSystem;
|
||||
|
||||
public List<Transform> currentWayPoints = new List<Transform> ();
|
||||
|
||||
[Space]
|
||||
[Header ("Events Settings")]
|
||||
[Space]
|
||||
@@ -176,8 +180,6 @@ public class walkOnBalanceSystem : externalControllerBehavior
|
||||
|
||||
float lastTimeReverseMovementDirectionInput;
|
||||
|
||||
Vector3 currentTargetDirection;
|
||||
|
||||
float lastTimeMoving;
|
||||
|
||||
float lastTimeNotMoving;
|
||||
@@ -190,6 +192,8 @@ public class walkOnBalanceSystem : externalControllerBehavior
|
||||
|
||||
float lastTimeWalkOnBalanceActive;
|
||||
|
||||
float lastTimeWalkOnBalanceEnd = -1;
|
||||
|
||||
bool ignoreHorizontalCameraRotationInputState;
|
||||
|
||||
|
||||
@@ -537,6 +541,10 @@ public class walkOnBalanceSystem : externalControllerBehavior
|
||||
if (lastTimeWalkOnBalanceActive > 0 && Time.time < lastTimeWalkOnBalanceActive + 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (lastTimeWalkOnBalanceEnd > -1 && Time.time < lastTimeWalkOnBalanceEnd + 1) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (state) {
|
||||
@@ -582,6 +590,10 @@ public class walkOnBalanceSystem : externalControllerBehavior
|
||||
|
||||
lastTimeWalkOnBalanceActive = Time.time;
|
||||
|
||||
lastTimeWalkOnBalanceEnd = -1;
|
||||
|
||||
currentTargetDirection = Vector3.zero;
|
||||
|
||||
} else {
|
||||
mainPlayerController.setCheckOnGroungPausedState (false);
|
||||
|
||||
@@ -602,6 +614,8 @@ public class walkOnBalanceSystem : externalControllerBehavior
|
||||
|
||||
ignoreHorizontalCameraRotationInputState = false;
|
||||
}
|
||||
|
||||
lastTimeWalkOnBalanceEnd = Time.time;
|
||||
}
|
||||
|
||||
mainPlayerController.setUpdate2_5dClampedPositionPausedState (state);
|
||||
|
||||
@@ -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/Player/Extra Movements/walkOnBalanceSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -26,6 +26,12 @@ public class walkOnBalanceTriggerSystem : MonoBehaviour
|
||||
public bool jumpOnEndState;
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public bool showDebugPrint;
|
||||
|
||||
[Space]
|
||||
[Header ("Remote Events Settings")]
|
||||
[Space]
|
||||
|
||||
@@ -36,6 +42,7 @@ public class walkOnBalanceTriggerSystem : MonoBehaviour
|
||||
public bool useRemoteEventOnEnd;
|
||||
public List<string> remoteEventNameListOnEnd = new List<string> ();
|
||||
|
||||
|
||||
GameObject currentPlayer;
|
||||
|
||||
|
||||
@@ -95,7 +102,11 @@ public class walkOnBalanceTriggerSystem : MonoBehaviour
|
||||
}
|
||||
|
||||
checkRemoteEvents (true, currentPlayer);
|
||||
}
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("checking walk on balance on enter trigger ");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
currentPlayer = col.gameObject;
|
||||
@@ -117,7 +128,11 @@ public class walkOnBalanceTriggerSystem : MonoBehaviour
|
||||
currentMovementSystem.setJumpOnEndState (true);
|
||||
|
||||
checkRemoteEvents (false, currentPlayer);
|
||||
}
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("checking walk on balance on exit trigger ");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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/Player/Extra Movements/walkOnBalanceTriggerSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/wallRunningSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/wallSlideJumpSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Extra Movements/wallSlideJumpZoneSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Generic Model Controller/AIMountManager.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Generic Model Controller/GKCCharacterController.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Generic Model Controller/basicAnimatorController.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Generic Model Controller/customCharacterControllerBase.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Generic Model Controller/customCharacterControllerBaseBuilder.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -26,6 +26,8 @@ public class customCharacterControllerManager : MonoBehaviour
|
||||
public bool setNewCharacterModeOnRegularState;
|
||||
public string newCharacterModeOnRegularState;
|
||||
|
||||
public bool disableFootStepsOnGenericModeEnabled = true;
|
||||
|
||||
[Space]
|
||||
[Header ("Character Controller List Settings")]
|
||||
[Space]
|
||||
@@ -469,6 +471,10 @@ public class customCharacterControllerManager : MonoBehaviour
|
||||
|
||||
mainRagdollActivator.setCurrentRagdollInfo (currentCustomCharacterControllerBase.customRagdollInfoName);
|
||||
|
||||
if (currentCustomCharacterControllerBase.useExtraColliders) {
|
||||
mainRagdollActivator.ignoreCollisionWithBodyColliderList (currentCustomCharacterControllerBase.extraCollidersList);
|
||||
}
|
||||
|
||||
if (mainOtherPowersSystem != null && currentCustomCharacterControllerBase.otherPowersShootZoneParent != null) {
|
||||
if (state) {
|
||||
mainOtherPowersSystem.setCustomShootZoneParentActiveState (true, currentCustomCharacterControllerBase.otherPowersShootZoneParent);
|
||||
@@ -613,7 +619,9 @@ public class customCharacterControllerManager : MonoBehaviour
|
||||
|
||||
mainPlayerController.enableOrDisableIKSystemManagerState (!state);
|
||||
|
||||
mainPlayerController.setFootStepManagerState (state);
|
||||
if (disableFootStepsOnGenericModeEnabled) {
|
||||
mainPlayerController.setFootStepManagerState (state);
|
||||
}
|
||||
|
||||
customCharacterControllerActive = state;
|
||||
|
||||
|
||||
@@ -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/Player/Generic Model Controller/customCharacterControllerManager.cs.bak
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Generic Model Controller/customCharacterControllerManager.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Generic Model Controller/customCharacterControllerSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Generic Model Controller/setCustomCharacterStateTriggerSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/Generic Model Controller/spiderCharacterController.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class wolfCharacterController : vehicleController
|
||||
|
||||
@@ -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/Player/Generic Model Controller/wolfCharacterController.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/States/Examples/characterSlowDownVelocity.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/States/Examples/freezeCharacterState.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/States/characterPropertiesSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/States/characterStateAffectedInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/States/setCharacterAffectedState.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/characterStateIconSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/doubleJumpAnimationTrigger.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/genericRagdollBuilder.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/multipleInteractionSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -206,7 +206,9 @@ public class playerComponentsManager : MonoBehaviour
|
||||
|
||||
public matchPlayerToTargetSystem mainMatchPlayerToTargetSystem;
|
||||
|
||||
[Space]
|
||||
public characterModelListManager mainCharacterModelListManager;
|
||||
|
||||
[Space]
|
||||
[Header ("External Controller Behavior Components")]
|
||||
[Space]
|
||||
|
||||
@@ -699,4 +701,9 @@ public class playerComponentsManager : MonoBehaviour
|
||||
{
|
||||
return mainVehiclePassengerUnderwater;
|
||||
}
|
||||
|
||||
public characterModelListManager getCharacterModelListManager ()
|
||||
{
|
||||
return mainCharacterModelListManager;
|
||||
}
|
||||
}
|
||||
@@ -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/Player/playerComponentsManager.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -212,6 +212,8 @@ public class playerController : MonoBehaviour
|
||||
|
||||
public int playerNonLocalAvatarID;
|
||||
|
||||
public int characterModelID = 0;
|
||||
|
||||
[Space]
|
||||
[Header ("AI Settings")]
|
||||
[Space]
|
||||
@@ -720,6 +722,7 @@ public class playerController : MonoBehaviour
|
||||
|
||||
Transform currentTemporalPlayerParent;
|
||||
|
||||
bool keepCameraRelativeMovementWhenNotAiming;
|
||||
|
||||
public bool useRelativeMovementToLockedCamera;
|
||||
public bool ladderFound;
|
||||
@@ -782,6 +785,8 @@ public class playerController : MonoBehaviour
|
||||
|
||||
public bool ignoreNewGroundAdherenceActive;
|
||||
|
||||
bool ignoreInputOnNewGroundAdherenceActive;
|
||||
|
||||
[Space]
|
||||
[Header ("Weapons And Powers State")]
|
||||
[Space]
|
||||
@@ -1261,6 +1266,9 @@ public class playerController : MonoBehaviour
|
||||
|
||||
public bool moveIputPaused;
|
||||
|
||||
[HideInInspector] public float characterScale = 1;
|
||||
[HideInInspector] public bool customCharacterScaleActive;
|
||||
|
||||
//Physics variables
|
||||
public Vector3 currentVelocity;
|
||||
RaycastHit hit;
|
||||
@@ -2529,9 +2537,6 @@ public class playerController : MonoBehaviour
|
||||
}
|
||||
|
||||
if (externalForceOnAirActive) {
|
||||
// airMove = externalForceOnAirValue;
|
||||
// currentVelocity = Vector3.Lerp (currentVelocity, airMove, currentFixedUpdateDeltaTime * externalForceOnAirControlValue);
|
||||
|
||||
velocityChange = externalForceOnAirValue - mainRigidbody.linearVelocity;
|
||||
|
||||
velocityChange = Vector3.ClampMagnitude (velocityChange, maxVelocityChange);
|
||||
@@ -3298,7 +3303,9 @@ public class playerController : MonoBehaviour
|
||||
} else {
|
||||
if (activateExtraRotationInQuickTurnMovement) {
|
||||
Quaternion quickTurnRotatation = Quaternion.LookRotation (currentMoveInput, playerTransformUp);
|
||||
mainRigidbody.rotation = Quaternion.Lerp (mainRigidbody.rotation, quickTurnRotatation, quickTurnMovementRotationSpeed * currentFixedUpdateDeltaTime);
|
||||
|
||||
mainRigidbody.rotation =
|
||||
Quaternion.Lerp (mainRigidbody.rotation, quickTurnRotatation, quickTurnMovementRotationSpeed * currentFixedUpdateDeltaTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3366,7 +3373,6 @@ public class playerController : MonoBehaviour
|
||||
}
|
||||
|
||||
if (rotateInLookDirectionResult) {
|
||||
|
||||
bool ZGFFModeOnAir = ((zeroGravityModeOn || freeFloatingModeOn) && !playerOnGround);
|
||||
|
||||
if (!ZGFFModeOnAir) {
|
||||
@@ -3386,7 +3392,9 @@ public class playerController : MonoBehaviour
|
||||
|
||||
Quaternion currentRotation = Quaternion.LookRotation (targetDirection, playerTransformUp);
|
||||
|
||||
targetRotation = Quaternion.Lerp (mainRigidbody.rotation, currentRotation, aimTurnSpeed * currentFixedUpdateDeltaTime);
|
||||
float currentFixedDeltaTime = getCurrentFixedDeltaTime ();
|
||||
|
||||
targetRotation = Quaternion.Lerp (mainRigidbody.rotation, currentRotation, aimTurnSpeed * currentFixedDeltaTime);
|
||||
|
||||
bool canRotatePlayer = (!lookAlwaysInCameraDirection ||
|
||||
(lookAlwaysInCameraDirection && !lookOnlyIfMoving) ||
|
||||
@@ -3404,8 +3412,7 @@ public class playerController : MonoBehaviour
|
||||
if (newAngle >= Mathf.Abs (thresholdAngleDifference)) {
|
||||
//if the player is not moving, set the turnamount to rotate him around, setting its turn animation properly
|
||||
if (canRotatePlayer) {
|
||||
targetRotation = Quaternion.Lerp (mainRigidbody.rotation, currentRotation, autoTurnSpeed * currentFixedUpdateDeltaTime);
|
||||
// mainRigidbody.MoveRotation (targetRotation);
|
||||
targetRotation = Quaternion.Lerp (mainRigidbody.rotation, currentRotation, autoTurnSpeed * currentFixedDeltaTime);
|
||||
|
||||
Vector3 lookDelta = playerTransform.InverseTransformDirection (targetDirection * 100);
|
||||
|
||||
@@ -3414,7 +3421,7 @@ public class playerController : MonoBehaviour
|
||||
turnAmount += lookAngle * .01f * 6;
|
||||
}
|
||||
} else {
|
||||
turnAmount = Mathf.MoveTowards (turnAmount, 0, currentFixedUpdateDeltaTime * 2);
|
||||
turnAmount = Mathf.MoveTowards (turnAmount, 0, currentFixedDeltaTime * 2);
|
||||
}
|
||||
|
||||
if (rotateDirectlyTowardCameraOnStrafe || fullBodyAwarenessActive) {
|
||||
@@ -3448,7 +3455,8 @@ public class playerController : MonoBehaviour
|
||||
lookCameraDirectionInFBAIsCurrentlyActive = true;
|
||||
} else {
|
||||
if ((zeroGravityModeOn || freeFloatingModeOn) && isPlayerMovingOn3dWorld ()) {
|
||||
Quaternion targetRotation = Quaternion.Lerp (playerTransform.rotation, playerCameraTransform.rotation, zeroGravityLookCameraSpeed * currentFixedUpdateDeltaTime);
|
||||
Quaternion targetRotation = Quaternion.Lerp (playerTransform.rotation,
|
||||
playerCameraTransform.rotation, zeroGravityLookCameraSpeed * getCurrentFixedDeltaTime ());
|
||||
|
||||
playerTransform.rotation = targetRotation;
|
||||
}
|
||||
@@ -3943,9 +3951,12 @@ public class playerController : MonoBehaviour
|
||||
if (!gravityForcePaused && !zeroGravityModeOn && !freeFloatingModeOn && !wallRunningActive && !pauseAllPlayerDownForces && !externalControlBehaviorForAirTypeActive) {
|
||||
mainRigidbody.AddForce (mainRigidbody.mass * gravityForce * playerTransformUp);
|
||||
|
||||
extraGravityForce = (gravityForce * gravityMultiplier) * playerTransformUp + (-gravityForce) * playerTransformUp;
|
||||
if (gravityMultiplier != 0) {
|
||||
extraGravityForce = (gravityForce * gravityMultiplier) * playerTransformUp
|
||||
+ (-gravityForce) * playerTransformUp;
|
||||
|
||||
mainRigidbody.AddForce (extraGravityForce);
|
||||
mainRigidbody.AddForce (extraGravityForce);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4331,7 +4342,19 @@ public class playerController : MonoBehaviour
|
||||
currentWalkSpeedOnLockedCamera = 1;
|
||||
}
|
||||
|
||||
if (!playerIsAiming && playerCameraManager.isShowCameraCursorWhenNotAimingActive ()) {
|
||||
bool useMainCameraRelativeDirectionResult = false;
|
||||
|
||||
if (!playerIsAiming) {
|
||||
if (playerCameraManager.isShowCameraCursorWhenNotAimingActive ()) {
|
||||
useMainCameraRelativeDirectionResult = true;
|
||||
|
||||
if (keepCameraRelativeMovementWhenNotAiming) {
|
||||
useMainCameraRelativeDirectionResult = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (useMainCameraRelativeDirectionResult) {
|
||||
lockedCameraMoveInput = currentWalkSpeedOnLockedCamera *
|
||||
(verticalInput * playerCameraTransform.forward + horizontalInput * mainCameraTransform.right);
|
||||
} else {
|
||||
@@ -4890,6 +4913,10 @@ public class playerController : MonoBehaviour
|
||||
currentMoveSpeedMultiplier = moveSpeedMultiplier;
|
||||
}
|
||||
|
||||
if (customCharacterScaleActive) {
|
||||
currentMoveSpeedMultiplier *= characterScale;
|
||||
}
|
||||
|
||||
characterVelocity = (currentMoveSpeedMultiplier * animator.deltaPosition) / Time.deltaTime;
|
||||
} else {
|
||||
currentNoRootMovementSpeed = 1;
|
||||
@@ -5524,6 +5551,17 @@ public class playerController : MonoBehaviour
|
||||
return currentDeltaTime;
|
||||
}
|
||||
|
||||
float getCurrentFixedDeltaTime ()
|
||||
{
|
||||
float currentFixedDeltaTime = Time.fixedDeltaTime;
|
||||
|
||||
if (regularMovementOnBulletTime) {
|
||||
currentFixedDeltaTime *= GKC_Utils.getCurrentDeltaTime ();
|
||||
}
|
||||
|
||||
return currentFixedDeltaTime;
|
||||
}
|
||||
|
||||
public float getCurrentScaleTime ()
|
||||
{
|
||||
return GKC_Utils.getCurrentDeltaTime ();
|
||||
@@ -5562,6 +5600,24 @@ public class playerController : MonoBehaviour
|
||||
currentHeight = capsule.height;
|
||||
}
|
||||
|
||||
public void setPlayerColliderCapsuleScaleWithCenterAsRadius (float capsuleHeight)
|
||||
{
|
||||
setPlayerColliderCapsuleScale (capsuleHeight);
|
||||
|
||||
Vector3 capsuleCenter = capsule.center;
|
||||
|
||||
if (capsuleCenter.y < capsule.radius) {
|
||||
capsuleCenter = new Vector3 (capsuleCenter.x, capsule.radius, capsuleCenter.z);
|
||||
|
||||
capsule.center = capsuleCenter;
|
||||
}
|
||||
}
|
||||
|
||||
public void setCapsuleHeightOnCrouch (float newValue)
|
||||
{
|
||||
capsuleHeightOnCrouch = newValue;
|
||||
}
|
||||
|
||||
public void setPlayerColliderCapsuleCenter (Vector3 newValue)
|
||||
{
|
||||
capsule.center = newValue;
|
||||
@@ -5616,6 +5672,13 @@ public class playerController : MonoBehaviour
|
||||
return characterRadius;
|
||||
}
|
||||
|
||||
public void setCharacterCustomScale (float newValue)
|
||||
{
|
||||
characterScale = newValue;
|
||||
|
||||
customCharacterScaleActive = characterScale != 1;
|
||||
}
|
||||
|
||||
public void setPlaceToShootPositionOffset (float newValue)
|
||||
{
|
||||
if (newValue > 0) {
|
||||
@@ -8167,7 +8230,7 @@ public class playerController : MonoBehaviour
|
||||
}
|
||||
|
||||
public void setLockedCameraState (bool state, bool useTankControlsValue, bool useRelativeMovementToLockedCameraValue,
|
||||
bool playerCanMoveOnAimInTankModeValue)
|
||||
bool playerCanMoveOnAimInTankModeValue, bool keepCameraRelativeMovementWhenNotAimingValue)
|
||||
{
|
||||
lockedCameraActive = state;
|
||||
|
||||
@@ -8179,6 +8242,8 @@ public class playerController : MonoBehaviour
|
||||
|
||||
useRelativeMovementToLockedCamera = useRelativeMovementToLockedCameraValue;
|
||||
|
||||
keepCameraRelativeMovementWhenNotAiming = keepCameraRelativeMovementWhenNotAimingValue;
|
||||
|
||||
if (!lockedCameraActive) {
|
||||
checkCameraDirectionFromLockedToFree = true;
|
||||
}
|
||||
@@ -8588,6 +8653,16 @@ public class playerController : MonoBehaviour
|
||||
playerID = newID;
|
||||
}
|
||||
|
||||
public void setCharacterModelID (int newID)
|
||||
{
|
||||
characterModelID = newID;
|
||||
}
|
||||
|
||||
public int getCharacterModelID ()
|
||||
{
|
||||
return characterModelID;
|
||||
}
|
||||
|
||||
public bool isPlayerNonLocalAvatar ()
|
||||
{
|
||||
return playerIsNonLocalAvatar;
|
||||
@@ -9479,6 +9554,13 @@ public class playerController : MonoBehaviour
|
||||
return animator;
|
||||
}
|
||||
|
||||
public void setNewRuntimeAnimatorController (RuntimeAnimatorController newRuntimeAnimatorController)
|
||||
{
|
||||
if (animator.runtimeAnimatorController != newRuntimeAnimatorController) {
|
||||
animator.runtimeAnimatorController = newRuntimeAnimatorController;
|
||||
}
|
||||
}
|
||||
|
||||
public void setAnimatorState (bool state)
|
||||
{
|
||||
animator.enabled = state;
|
||||
@@ -10314,6 +10396,12 @@ public class playerController : MonoBehaviour
|
||||
ignoreNewGroundAdherenceActive = state;
|
||||
}
|
||||
|
||||
|
||||
public void setInoreInputOnNewGroundAdherenceActive (bool state)
|
||||
{
|
||||
ignoreInputOnNewGroundAdherenceActive = state;
|
||||
}
|
||||
|
||||
Vector3 GetInputDirection ()
|
||||
{
|
||||
if (lockedCameraActive && useRelativeMovementToLockedCamera && !usedByAI) {
|
||||
@@ -10349,6 +10437,10 @@ public class playerController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
if (ignoreInputOnNewGroundAdherenceActive) {
|
||||
moveDirectionInput = Vector3.zero;
|
||||
}
|
||||
|
||||
Vector3 mainMovementDirection = moveDirectionInput.normalized;
|
||||
|
||||
//if (usedByAI || (hitAngle > minAngleToUsedInputNormalized) || (walkSpeed <= 0.5f)) {
|
||||
@@ -10365,7 +10457,6 @@ public class playerController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vector3 desiredMove = moveDirectionInput * dt;
|
||||
Vector3 futurePos = playerTransform.position + desiredMove;
|
||||
dbgFuturePos = futurePos;
|
||||
@@ -10656,7 +10747,7 @@ public class playerController : MonoBehaviour
|
||||
|
||||
bool TryGetGroundAtPosition (Vector3 samplePos, Vector3 localUp, out RaycastHit hitInfo)
|
||||
{
|
||||
float originHeight = capsule.height + 1f;
|
||||
float originHeight = (currentHeight / 4) + 1f;
|
||||
|
||||
Vector3 origin = samplePos + localUp * originHeight;
|
||||
|
||||
|
||||
@@ -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/Player/playerController.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/playerIdleSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/playerStateSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -429,6 +429,13 @@ public class playerStatesManager : MonoBehaviour
|
||||
ignoreSetPlayerModeByNameActive = state;
|
||||
}
|
||||
|
||||
public void setPlayerModeByNameCheckingCharacterIsNotBusy (string modeName)
|
||||
{
|
||||
if (canUseInput ()) {
|
||||
setPlayerModeByName (modeName);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPlayerModeByName (string modeName)
|
||||
{
|
||||
if (ignoreSetPlayerModeByNameActive) {
|
||||
|
||||
@@ -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/Player/playerStatesManager.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/quickPlayerModeChangeSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -1992,6 +1992,8 @@ public class ragdollActivator : MonoBehaviour
|
||||
hipsRigidbody = rootMotion.GetComponent<Rigidbody> ();
|
||||
|
||||
currentHipsRigidbody = hipsRigidbody;
|
||||
|
||||
skeleton = rootMotion.parent.gameObject;
|
||||
}
|
||||
|
||||
currentRootMotion = rootMotion;
|
||||
|
||||
@@ -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/Player/ragdollActivator.cs.bak
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -11,7 +11,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/Player/ragdollActivator.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/remotePlayerNavmeshOverride.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/remotePlayerNavmeshOverrideSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/spriteAnimatorSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -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/Player/stairAdherenceSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -179,12 +179,8 @@ public class upperBodyRotationSystem : MonoBehaviour
|
||||
|
||||
void Start ()
|
||||
{
|
||||
parentRot = spineTransform.parent.rotation;
|
||||
parentRotInv = Quaternion.Inverse (parentRot);
|
||||
calculateCharacterRotationValues ();
|
||||
|
||||
referenceLookDir = parentRotInv * transform.rotation * headLookVector.normalized;
|
||||
referenceUpDir = parentRotInv * transform.rotation * headUpVector.normalized;
|
||||
dirUp = referenceUpDir;
|
||||
originalAngleDifference = maxBendingAngle;
|
||||
|
||||
weaponRotationPointToFollowLocated = weaponRotationPointToFollow != null;
|
||||
@@ -196,6 +192,19 @@ public class upperBodyRotationSystem : MonoBehaviour
|
||||
originalVerticalMaxAngleDifference = verticalMaxAngleDifference;
|
||||
}
|
||||
|
||||
public void calculateCharacterRotationValues ()
|
||||
{
|
||||
parentRot = spineTransform.parent.rotation;
|
||||
|
||||
parentRotInv = Quaternion.Inverse (parentRot);
|
||||
|
||||
referenceLookDir = parentRotInv * transform.rotation * headLookVector.normalized;
|
||||
|
||||
referenceUpDir = parentRotInv * transform.rotation * headUpVector.normalized;
|
||||
|
||||
dirUp = referenceUpDir;
|
||||
}
|
||||
|
||||
void FixedUpdate ()
|
||||
{
|
||||
if (IKUpperBodyActive) {
|
||||
@@ -560,6 +569,7 @@ public class upperBodyRotationSystem : MonoBehaviour
|
||||
public void setCurrentBodyRotation (float bodyRotation)
|
||||
{
|
||||
currentExtraRotation = bodyRotation;
|
||||
|
||||
auxCurrentExtraRotation = currentExtraRotation;
|
||||
}
|
||||
|
||||
@@ -781,6 +791,16 @@ public class upperBodyRotationSystem : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public Transform getChestTransform ()
|
||||
{
|
||||
return chestTransform;
|
||||
}
|
||||
|
||||
public void setNewChestUpVectorValueOnRuntime (Vector3 newValue)
|
||||
{
|
||||
chestUpVector = newValue;
|
||||
}
|
||||
|
||||
//EDITOR FUNCTIONS
|
||||
public void setNewChestUpVectorValue (Vector3 newValue)
|
||||
{
|
||||
|
||||
@@ -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/Player/upperBodyRotationSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -141,6 +141,11 @@ public class usingDevicesSystem : MonoBehaviour
|
||||
|
||||
public List<multipleInteractionInfo> multipleInteractionInfoList = new List<multipleInteractionInfo> ();
|
||||
|
||||
|
||||
public bool removeDeviceFromPlayerListOnMaxDistance;
|
||||
public float maxDistanceToRemoveDeviceFromPlayerList;
|
||||
|
||||
|
||||
float lastTimePressedButton;
|
||||
bool holdingButton;
|
||||
|
||||
@@ -594,10 +599,16 @@ public class usingDevicesSystem : MonoBehaviour
|
||||
devicePosition = deviceInfoToCheck.deviceTransform.position;
|
||||
|
||||
|
||||
if (deviceInfoToCheck.removeDeviceFromPlayerListOnMaxDistance) {
|
||||
if (removeDeviceFromPlayerListOnMaxDistance || deviceInfoToCheck.removeDeviceFromPlayerListOnMaxDistance) {
|
||||
float distanceToObject = GKC_Utils.distance (transform.position, devicePosition);
|
||||
|
||||
if (distanceToObject > deviceInfoToCheck.maxDistanceToRemoveDeviceFromPlayerList) {
|
||||
float maxDistance = deviceInfoToCheck.maxDistanceToRemoveDeviceFromPlayerList;
|
||||
|
||||
if (removeDeviceFromPlayerListOnMaxDistance) {
|
||||
maxDistance = maxDistanceToRemoveDeviceFromPlayerList;
|
||||
}
|
||||
|
||||
if (distanceToObject > maxDistance) {
|
||||
if (showDetectedDevicesIconOnScreen) {
|
||||
if (deviceInfoToCheck.deviceIcon != null) {
|
||||
Destroy (deviceInfoToCheck.deviceIcon);
|
||||
@@ -1393,7 +1404,7 @@ public class usingDevicesSystem : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
//print (usableObjectFound.name + " " + currentDeviceIsPickup);
|
||||
//print (usableObjectFound.name + " " + currentDeviceIsPickup);
|
||||
|
||||
if (currentDeviceIsPickup) {
|
||||
pickUpObject currentPickUpObject = usableObjectFound.GetComponentInParent<pickUpObject> ();
|
||||
|
||||
@@ -11,7 +11,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/Player/usingDevicesSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
Reference in New Issue
Block a user