add some extra assets FX and SFX
This commit is contained in:
@@ -13,8 +13,9 @@ 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/Abilities System/Custom Abilities/Grappling
|
||||
Hook System/grapplingHookEffect.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,8 +13,9 @@ 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/Abilities System/Custom Abilities/Grappling
|
||||
Hook System/grapplingHookSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,8 +13,9 @@ 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/Abilities System/Custom Abilities/Grappling
|
||||
Hook System/grapplingHookTarget.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,8 +13,9 @@ 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/Abilities System/Custom Abilities/Grappling
|
||||
Hook System/grapplingHookTargetsSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,8 +13,9 @@ 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/Abilities System/Custom Abilities/Grappling
|
||||
Hook System/objectToAttractWithGrapplingHook.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -54,10 +54,12 @@ public class customAbilitySystem : abilityInfo
|
||||
public bool useEventOnDeactivateAbility;
|
||||
public UnityEvent eventOnDeactivateAbility;
|
||||
|
||||
|
||||
float lastTimePressDownUsed;
|
||||
|
||||
bool eventTriggeredOnPressHold;
|
||||
|
||||
|
||||
public override void updateAbilityState ()
|
||||
{
|
||||
if (useEventOnUpdateAbilityState) {
|
||||
|
||||
@@ -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/Abilities System/Custom Abilities/customAbilitySystem.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/Abilities System/Custom Abilities/drainStatSystem.cs
|
||||
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/Abilities System/Custom Abilities/laserPlayer.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/Abilities System/Custom Abilities/laserVisionSystem.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/Abilities System/Custom Abilities/manualDetonationMineObject.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/Abilities System/Custom Abilities/manualDetonationMineSystem.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/Abilities System/Custom Abilities/playerGravitySystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -4,288 +4,288 @@ using UnityEngine;
|
||||
|
||||
public class playerShieldSystem : abilityInfo
|
||||
{
|
||||
[Header ("Custom Settings")]
|
||||
[Space]
|
||||
[Header ("Custom Settings")]
|
||||
[Space]
|
||||
|
||||
public bool shieldEnabled;
|
||||
public bool shieldEnabled;
|
||||
|
||||
public bool shieldActive;
|
||||
public bool shieldActive;
|
||||
|
||||
public bool laserActive;
|
||||
public bool laserActive;
|
||||
|
||||
public bool laserAbilityEnabled = true;
|
||||
public bool laserAbilityEnabled = true;
|
||||
|
||||
public LayerMask layerToDamage;
|
||||
public LayerMask layerToDamage;
|
||||
|
||||
public bool returnProjectilesDetectedEnabled = true;
|
||||
public bool returnProjectilesDetectedEnabled = true;
|
||||
|
||||
public bool destroProjectilesStoredIfShieldDisabled;
|
||||
public bool destroProjectilesStoredIfShieldDisabled;
|
||||
|
||||
[Space]
|
||||
[Header ("Component Elements")]
|
||||
[Space]
|
||||
[Space]
|
||||
[Header ("Component Elements")]
|
||||
[Space]
|
||||
|
||||
public GameObject shield;
|
||||
public GameObject shield;
|
||||
|
||||
public armorSurfaceSystem armorSurfaceManager;
|
||||
public armorSurfaceSystem armorSurfaceManager;
|
||||
|
||||
public GameObject playerLaserGameObject;
|
||||
public GameObject playerLaserGameObject;
|
||||
|
||||
public laserPlayer laserPlayerManager;
|
||||
public laserPlayer laserPlayerManager;
|
||||
|
||||
public otherPowers mainOtherPowers;
|
||||
public otherPowers mainOtherPowers;
|
||||
|
||||
public Transform pivotCameraTransform;
|
||||
public Transform playerCameraTransform;
|
||||
public Transform mainCameraTransform;
|
||||
public Transform pivotCameraTransform;
|
||||
public Transform playerCameraTransform;
|
||||
public Transform mainCameraTransform;
|
||||
|
||||
public Collider playerCollider;
|
||||
public Collider playerCollider;
|
||||
|
||||
GameObject currentLaser;
|
||||
GameObject currentLaser;
|
||||
|
||||
Vector3 laserPosition;
|
||||
laserDevice.laserType lasertype;
|
||||
Vector3 laserPosition;
|
||||
laserDevice.laserType lasertype;
|
||||
|
||||
RaycastHit hit;
|
||||
RaycastHit hit;
|
||||
|
||||
|
||||
public override void updateAbilityState ()
|
||||
{
|
||||
//enable shield when the player touch a laser
|
||||
if (shield.activeSelf && currentLaser != null) {
|
||||
Vector3 targetDir = currentLaser.transform.position - shield.transform.position;
|
||||
public override void updateAbilityState ()
|
||||
{
|
||||
//enable shield when the player touch a laser
|
||||
if (shield.activeSelf && currentLaser != null) {
|
||||
Vector3 targetDir = currentLaser.transform.position - shield.transform.position;
|
||||
|
||||
Quaternion qTo = Quaternion.LookRotation (targetDir);
|
||||
Quaternion qTo = Quaternion.LookRotation (targetDir);
|
||||
|
||||
shield.transform.rotation = Quaternion.Slerp (shield.transform.rotation, qTo, 10 * Time.deltaTime);
|
||||
}
|
||||
shield.transform.rotation = Quaternion.Slerp (shield.transform.rotation, qTo, 10 * Time.deltaTime);
|
||||
}
|
||||
|
||||
//if the shield is enabled, the power decreases
|
||||
if (shield.activeSelf && shieldActive && !laserActive) {
|
||||
//also, rotates the shield towards the camera direction
|
||||
if (pivotCameraTransform.localRotation.x < 0) {
|
||||
shield.transform.rotation = pivotCameraTransform.rotation;
|
||||
} else {
|
||||
shield.transform.rotation = Quaternion.Euler (playerCameraTransform.eulerAngles);
|
||||
}
|
||||
//if the shield is enabled, the power decreases
|
||||
if (shield.activeSelf && shieldActive && !laserActive) {
|
||||
//also, rotates the shield towards the camera direction
|
||||
if (pivotCameraTransform.localRotation.x < 0) {
|
||||
shield.transform.rotation = pivotCameraTransform.rotation;
|
||||
} else {
|
||||
shield.transform.rotation = Quaternion.Euler (playerCameraTransform.eulerAngles);
|
||||
}
|
||||
|
||||
bool updateAbilityEnergyResult =
|
||||
mainPlayerAbilitiesSystem.checkAbilityUseEnergyInUpdate (useEnergyOnAbility, useEnergyWithRate, energyAmountUsed);
|
||||
bool updateAbilityEnergyResult =
|
||||
mainPlayerAbilitiesSystem.checkAbilityUseEnergyInUpdate (useEnergyOnAbility, useEnergyWithRate, energyAmountUsed);
|
||||
|
||||
if (!updateAbilityEnergyResult) {
|
||||
deactivateAbility ();
|
||||
}
|
||||
}
|
||||
if (!updateAbilityEnergyResult) {
|
||||
deactivateAbility ();
|
||||
}
|
||||
}
|
||||
|
||||
if (mainOtherPowers.isAimingPower ()) {
|
||||
//if the player is touching by a laser device, enable the laser in the player
|
||||
if (laserActive && !playerLaserGameObject.activeSelf) {
|
||||
playerLaserGameObject.SetActive (true);
|
||||
}
|
||||
if (mainOtherPowers.isAimingPower ()) {
|
||||
//if the player is touching by a laser device, enable the laser in the player
|
||||
if (laserActive && !playerLaserGameObject.activeSelf) {
|
||||
playerLaserGameObject.SetActive (true);
|
||||
}
|
||||
|
||||
//else disable the laser
|
||||
if (!laserActive && playerLaserGameObject.activeSelf) {
|
||||
playerLaserGameObject.SetActive (false);
|
||||
}
|
||||
} else {
|
||||
if (playerLaserGameObject.activeSelf) {
|
||||
playerLaserGameObject.SetActive (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
//else disable the laser
|
||||
if (!laserActive && playerLaserGameObject.activeSelf) {
|
||||
playerLaserGameObject.SetActive (false);
|
||||
}
|
||||
} else {
|
||||
if (playerLaserGameObject.activeSelf) {
|
||||
playerLaserGameObject.SetActive (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//enable and disable the shield when the player want to stop attacks or when he touchs a laser
|
||||
public void setActiveShieldState (bool state)
|
||||
{
|
||||
//enable or disable the shield
|
||||
if (!mainPlayerAbilitiesSystem.isPlayerCurrentlyBusy ()) {
|
||||
setShieldState (state);
|
||||
}
|
||||
}
|
||||
//enable and disable the shield when the player want to stop attacks or when he touchs a laser
|
||||
public void setActiveShieldState (bool state)
|
||||
{
|
||||
//enable or disable the shield
|
||||
if (!mainPlayerAbilitiesSystem.isPlayerCurrentlyBusy ()) {
|
||||
setShieldState (state);
|
||||
}
|
||||
}
|
||||
|
||||
public void setShieldState (bool state)
|
||||
{
|
||||
if (!laserActive && mainPlayerAbilitiesSystem.canMove && shieldEnabled) {
|
||||
shieldActive = state;
|
||||
public void setShieldState (bool state)
|
||||
{
|
||||
if (!laserActive && mainPlayerAbilitiesSystem.getCanMove () && shieldEnabled) {
|
||||
shieldActive = state;
|
||||
|
||||
if (shield.activeSelf != shieldActive) {
|
||||
shield.SetActive (shieldActive);
|
||||
}
|
||||
if (shield.activeSelf != shieldActive) {
|
||||
shield.SetActive (shieldActive);
|
||||
}
|
||||
|
||||
checkIfDestroyProjectiles ();
|
||||
}
|
||||
}
|
||||
|
||||
//enable disable the laser in the hand of the player, when he is in the range of one
|
||||
public void activateLaserForceField (Vector3 pos)
|
||||
{
|
||||
if (!laserAbilityEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isCurrentAbility) {
|
||||
return;
|
||||
}
|
||||
|
||||
//print ("enable laser force field");
|
||||
shieldActive = false;
|
||||
|
||||
laserActive = true;
|
||||
|
||||
disableAbilityCurrentActiveFromPressState ();
|
||||
|
||||
if (laserActive) {
|
||||
if (!shield.activeSelf) {
|
||||
shield.SetActive (true);
|
||||
}
|
||||
|
||||
laserPosition = pos;
|
||||
}
|
||||
|
||||
if (playerLaserGameObject.activeSelf) {
|
||||
laserPlayerManager.setLaserInfo (lasertype, currentLaser, laserPosition);
|
||||
}
|
||||
|
||||
checkIfDestroyProjectiles ();
|
||||
}
|
||||
|
||||
void checkIfDestroyProjectiles ()
|
||||
{
|
||||
if (destroProjectilesStoredIfShieldDisabled) {
|
||||
armorSurfaceManager.destroyProjetilesOnShield ();
|
||||
}
|
||||
}
|
||||
|
||||
public void deactivateLaserForceField ()
|
||||
{
|
||||
//print ("disable laser force field");
|
||||
laserActive = false;
|
||||
|
||||
if (shield.activeSelf) {
|
||||
shield.SetActive (false);
|
||||
}
|
||||
|
||||
if (playerLaserGameObject.activeSelf) {
|
||||
playerLaserGameObject.SetActive (false);
|
||||
}
|
||||
|
||||
laserPlayerManager.removeLaserInfo ();
|
||||
}
|
||||
|
||||
public void setShieldEnabledState (bool state)
|
||||
{
|
||||
shieldEnabled = state;
|
||||
}
|
||||
|
||||
//shoot the bullets and missiles catched by the shield
|
||||
public void returnEnemyProjectiles ()
|
||||
{
|
||||
//the bullets and missiles from the enemies are stored in the shield, so if the player press the right button of the mouse
|
||||
//the shoots are sent to its owners if they still alive, else, the shoots are launched in the camera direction
|
||||
if (!mainPlayerAbilitiesSystem.isPlayerCurrentlyBusy () && shield.activeSelf && shieldActive && !laserActive) {
|
||||
if (armorSurfaceManager.thereAreProjectilesStored ()) {
|
||||
//check if a raycast hits a surface from the center of the screen to forward
|
||||
//to set the direction of the projectiles in the shield
|
||||
Vector3 direction = mainCameraTransform.TransformDirection (Vector3.forward);
|
||||
|
||||
bool surfaceFound = false;
|
||||
|
||||
Vector3 raycastPosition = mainCameraTransform.position;
|
||||
|
||||
if (Physics.Raycast (raycastPosition, direction, out hit, Mathf.Infinity, layerToDamage)) {
|
||||
if (hit.collider != playerCollider) {
|
||||
surfaceFound = true;
|
||||
} else {
|
||||
raycastPosition = hit.point + direction * 0.2f;
|
||||
|
||||
if (Physics.Raycast (raycastPosition, direction, out hit, Mathf.Infinity, layerToDamage)) {
|
||||
surfaceFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (surfaceFound) {
|
||||
direction = hit.point;
|
||||
}
|
||||
|
||||
armorSurfaceManager.throwProjectilesStored (direction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//get the laser device that touch the player, not enemy lasers, and if the laser reflects in other surfaces or not
|
||||
public void setLaser (GameObject l, laserDevice.laserType type)
|
||||
{
|
||||
currentLaser = l;
|
||||
|
||||
lasertype = type;
|
||||
}
|
||||
|
||||
//set the number of refractions in the laser in another function
|
||||
public void setLaserRefractionLimit (int value)
|
||||
{
|
||||
laserPlayerManager.reflactionLimit = value + 1;
|
||||
}
|
||||
|
||||
public void setLaserAbilityEnabledState (bool state)
|
||||
{
|
||||
laserAbilityEnabled = state;
|
||||
}
|
||||
|
||||
public override void enableAbility ()
|
||||
{
|
||||
shieldEnabled = true;
|
||||
}
|
||||
|
||||
public override void disableAbility ()
|
||||
{
|
||||
shieldEnabled = false;
|
||||
|
||||
if (shieldActive) {
|
||||
setShieldState (false);
|
||||
}
|
||||
|
||||
deactivateLaserForceField ();
|
||||
}
|
||||
|
||||
public override void deactivateAbility ()
|
||||
{
|
||||
if (shieldActive) {
|
||||
setShieldState (false);
|
||||
}
|
||||
|
||||
deactivateLaserForceField ();
|
||||
}
|
||||
|
||||
public override void activateSecondaryActionOnAbility ()
|
||||
{
|
||||
returnEnemyProjectiles ();
|
||||
}
|
||||
|
||||
public override void useAbilityPressDown ()
|
||||
{
|
||||
if (shieldActive) {
|
||||
if (armorSurfaceManager.thereAreProjectilesStored ()) {
|
||||
if (returnProjectilesDetectedEnabled) {
|
||||
returnEnemyProjectiles ();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setActiveShieldState (!shieldActive);
|
||||
|
||||
checkUseEventOnUseAbility ();
|
||||
}
|
||||
|
||||
public override void useAbilityPressHold ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void useAbilityPressUp ()
|
||||
{
|
||||
checkIfDestroyProjectiles ();
|
||||
}
|
||||
}
|
||||
|
||||
//enable disable the laser in the hand of the player, when he is in the range of one
|
||||
public void activateLaserForceField (Vector3 pos)
|
||||
{
|
||||
if (!laserAbilityEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isCurrentAbility) {
|
||||
return;
|
||||
}
|
||||
|
||||
//print ("enable laser force field");
|
||||
shieldActive = false;
|
||||
|
||||
laserActive = true;
|
||||
|
||||
disableAbilityCurrentActiveFromPressState ();
|
||||
|
||||
if (laserActive) {
|
||||
if (!shield.activeSelf) {
|
||||
shield.SetActive (true);
|
||||
}
|
||||
|
||||
laserPosition = pos;
|
||||
}
|
||||
|
||||
if (playerLaserGameObject.activeSelf) {
|
||||
laserPlayerManager.setLaserInfo (lasertype, currentLaser, laserPosition);
|
||||
}
|
||||
|
||||
checkIfDestroyProjectiles ();
|
||||
}
|
||||
|
||||
void checkIfDestroyProjectiles ()
|
||||
{
|
||||
if (destroProjectilesStoredIfShieldDisabled) {
|
||||
armorSurfaceManager.destroyProjetilesOnShield ();
|
||||
}
|
||||
}
|
||||
|
||||
public void deactivateLaserForceField ()
|
||||
{
|
||||
//print ("disable laser force field");
|
||||
laserActive = false;
|
||||
|
||||
if (shield.activeSelf) {
|
||||
shield.SetActive (false);
|
||||
}
|
||||
|
||||
if (playerLaserGameObject.activeSelf) {
|
||||
playerLaserGameObject.SetActive (false);
|
||||
}
|
||||
|
||||
laserPlayerManager.removeLaserInfo ();
|
||||
}
|
||||
|
||||
public void setShieldEnabledState (bool state)
|
||||
{
|
||||
shieldEnabled = state;
|
||||
}
|
||||
|
||||
//shoot the bullets and missiles catched by the shield
|
||||
public void returnEnemyProjectiles ()
|
||||
{
|
||||
//the bullets and missiles from the enemies are stored in the shield, so if the player press the right button of the mouse
|
||||
//the shoots are sent to its owners if they still alive, else, the shoots are launched in the camera direction
|
||||
if (!mainPlayerAbilitiesSystem.isPlayerCurrentlyBusy () && shield.activeSelf && shieldActive && !laserActive) {
|
||||
if (armorSurfaceManager.thereAreProjectilesStored ()) {
|
||||
//check if a raycast hits a surface from the center of the screen to forward
|
||||
//to set the direction of the projectiles in the shield
|
||||
Vector3 direction = mainCameraTransform.TransformDirection (Vector3.forward);
|
||||
|
||||
bool surfaceFound = false;
|
||||
|
||||
Vector3 raycastPosition = mainCameraTransform.position;
|
||||
|
||||
if (Physics.Raycast (raycastPosition, direction, out hit, Mathf.Infinity, layerToDamage)) {
|
||||
if (hit.collider != playerCollider) {
|
||||
surfaceFound = true;
|
||||
} else {
|
||||
raycastPosition = hit.point + direction * 0.2f;
|
||||
|
||||
if (Physics.Raycast (raycastPosition, direction, out hit, Mathf.Infinity, layerToDamage)) {
|
||||
surfaceFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (surfaceFound) {
|
||||
direction = hit.point;
|
||||
}
|
||||
|
||||
armorSurfaceManager.throwProjectilesStored (direction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//get the laser device that touch the player, not enemy lasers, and if the laser reflects in other surfaces or not
|
||||
public void setLaser (GameObject l, laserDevice.laserType type)
|
||||
{
|
||||
currentLaser = l;
|
||||
|
||||
lasertype = type;
|
||||
}
|
||||
|
||||
//set the number of refractions in the laser in another function
|
||||
public void setLaserRefractionLimit (int value)
|
||||
{
|
||||
laserPlayerManager.reflactionLimit = value + 1;
|
||||
}
|
||||
|
||||
public void setLaserAbilityEnabledState (bool state)
|
||||
{
|
||||
laserAbilityEnabled = state;
|
||||
}
|
||||
|
||||
public override void enableAbility ()
|
||||
{
|
||||
shieldEnabled = true;
|
||||
}
|
||||
|
||||
public override void disableAbility ()
|
||||
{
|
||||
shieldEnabled = false;
|
||||
|
||||
if (shieldActive) {
|
||||
setShieldState (false);
|
||||
}
|
||||
|
||||
deactivateLaserForceField ();
|
||||
}
|
||||
|
||||
public override void deactivateAbility ()
|
||||
{
|
||||
if (shieldActive) {
|
||||
setShieldState (false);
|
||||
}
|
||||
|
||||
deactivateLaserForceField ();
|
||||
}
|
||||
|
||||
public override void activateSecondaryActionOnAbility ()
|
||||
{
|
||||
returnEnemyProjectiles ();
|
||||
}
|
||||
|
||||
public override void useAbilityPressDown ()
|
||||
{
|
||||
if (shieldActive) {
|
||||
if (armorSurfaceManager.thereAreProjectilesStored ()) {
|
||||
if (returnProjectilesDetectedEnabled) {
|
||||
returnEnemyProjectiles ();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setActiveShieldState (!shieldActive);
|
||||
|
||||
checkUseEventOnUseAbility ();
|
||||
}
|
||||
|
||||
public override void useAbilityPressHold ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void useAbilityPressUp ()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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/Abilities System/Custom Abilities/playerShieldSystem.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/Abilities System/Custom Abilities/playerStealthSystem.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/Abilities System/Custom Abilities/playerTeleportSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -54,11 +54,8 @@ public class removeGravityFromCharacterSystem : MonoBehaviour
|
||||
if (hipsRigidbody != null) {
|
||||
hipsRigidbody.AddRelativeTorque (characterTransform.forward * extraTorqueForce, torqueForceMode);
|
||||
hipsRigidbody.AddRelativeTorque (characterTransform.right * extraTorqueForce, torqueForceMode);
|
||||
// hipsRigidbody.AddTorque (hipsRigidbody.transform.up * extraTorqueForce);
|
||||
}
|
||||
|
||||
// yield return new WaitForSeconds (removeGravityDuration);
|
||||
|
||||
bool targetReached = false;
|
||||
|
||||
float timer = 0;
|
||||
|
||||
@@ -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/Abilities System/Custom Abilities/removeGravityFromCharacterSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class removeGravityFromObjectSystem : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public float removeGravityDuration = 5;
|
||||
|
||||
public float delayBeforeFreezingVelocity = 3;
|
||||
|
||||
public bool pauseExtraForceAfterDelay;
|
||||
|
||||
public float pauseExtraForceDelay;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool setObjectAsKinematicOnZeroVelocity;
|
||||
|
||||
public float durationAsKinematic;
|
||||
|
||||
[Space]
|
||||
[Header ("Force Settings")]
|
||||
[Space]
|
||||
|
||||
public float pauseExtraForceSpeed = 3;
|
||||
|
||||
public float extraGravityForce = 5;
|
||||
|
||||
public float extraTorqueForce = 8;
|
||||
public ForceMode torqueForceMode;
|
||||
|
||||
public bool addTorqueOnRemoveGravity;
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public bool showDebugPrint;
|
||||
|
||||
public bool removeGravityActive;
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
|
||||
public Rigidbody mainRigibody;
|
||||
|
||||
grabbedObjectState currentGrabbedObjectState;
|
||||
artificialObjectGravity currentArtificialObjectGravity;
|
||||
|
||||
Coroutine removeGravityCoroutine;
|
||||
|
||||
bool currentObjectWasInsideGravityRoom;
|
||||
|
||||
|
||||
public void activateRemoveGravity ()
|
||||
{
|
||||
stopRemoveGravityCoroutine ();
|
||||
|
||||
removeGravityCoroutine = StartCoroutine (activateRemoveGravityCoroutine ());
|
||||
}
|
||||
|
||||
void stopRemoveGravityCoroutine ()
|
||||
{
|
||||
if (removeGravityCoroutine != null) {
|
||||
StopCoroutine (removeGravityCoroutine);
|
||||
}
|
||||
|
||||
removeGravityActive = false;
|
||||
}
|
||||
|
||||
IEnumerator activateRemoveGravityCoroutine ()
|
||||
{
|
||||
removeGravity ();
|
||||
|
||||
Vector3 upDirection = Vector3.up;
|
||||
|
||||
if (currentArtificialObjectGravity != null) {
|
||||
upDirection = -currentArtificialObjectGravity.getCurrentNormalDirection ();
|
||||
}
|
||||
|
||||
Vector3 initialForce = upDirection * extraGravityForce;
|
||||
|
||||
if (mainRigibody == null) {
|
||||
mainRigibody = gameObject.GetComponent<Rigidbody> ();
|
||||
}
|
||||
|
||||
if (mainRigibody != null) {
|
||||
if (addTorqueOnRemoveGravity) {
|
||||
mainRigibody.AddRelativeTorque (transform.forward * extraTorqueForce, torqueForceMode);
|
||||
mainRigibody.AddRelativeTorque (transform.right * extraTorqueForce, torqueForceMode);
|
||||
} else {
|
||||
mainRigibody.AddForce (initialForce, torqueForceMode);
|
||||
}
|
||||
}
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("force applied, waiting for delayBeforeFreezingVelocity");
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds (delayBeforeFreezingVelocity);
|
||||
|
||||
|
||||
bool targetReached = false;
|
||||
|
||||
float timer = 0;
|
||||
|
||||
bool pauseExtraForceActivated = false;
|
||||
|
||||
Vector3 currentVelocity = mainRigibody.linearVelocity;
|
||||
|
||||
while (!targetReached) {
|
||||
timer += Time.deltaTime;
|
||||
|
||||
if (pauseExtraForceAfterDelay) {
|
||||
if (pauseExtraForceActivated) {
|
||||
if (GKC_Utils.distance (currentVelocity, Vector3.zero) > 0.05f) {
|
||||
currentVelocity = Vector3.MoveTowards (currentVelocity, Vector3.zero, timer * pauseExtraForceSpeed);
|
||||
|
||||
mainRigibody.linearVelocity = currentVelocity;
|
||||
}
|
||||
} else {
|
||||
if (timer >= pauseExtraForceDelay) {
|
||||
pauseExtraForceActivated = true;
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("starting to decrease speed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (timer >= removeGravityDuration) {
|
||||
targetReached = true;
|
||||
}
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (setObjectAsKinematicOnZeroVelocity) {
|
||||
mainRigibody.isKinematic = true;
|
||||
|
||||
yield return new WaitForSeconds (durationAsKinematic);
|
||||
|
||||
mainRigibody.isKinematic = false;
|
||||
}
|
||||
|
||||
resumePreviousGravity ();
|
||||
}
|
||||
|
||||
void removeGravity ()
|
||||
{
|
||||
if (removeGravityActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
removeGravityActive = true;
|
||||
|
||||
currentGrabbedObjectState = gameObject.GetComponent<grabbedObjectState> ();
|
||||
|
||||
currentObjectWasInsideGravityRoom = false;
|
||||
|
||||
if (currentGrabbedObjectState != null) {
|
||||
currentObjectWasInsideGravityRoom = currentGrabbedObjectState.isInsideZeroGravityRoom ();
|
||||
}
|
||||
|
||||
if (currentObjectWasInsideGravityRoom) {
|
||||
if (currentGrabbedObjectState.getCurrentZeroGravityRoom ().isRoomHasZeroGravityActive ()) {
|
||||
|
||||
stopRemoveGravityCoroutine ();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
currentArtificialObjectGravity = gameObject.GetComponent<artificialObjectGravity> ();
|
||||
|
||||
if (currentArtificialObjectGravity != null) {
|
||||
currentArtificialObjectGravity.setActiveState (false);
|
||||
}
|
||||
|
||||
mainRigibody.useGravity = false;
|
||||
}
|
||||
|
||||
void resumePreviousGravity ()
|
||||
{
|
||||
bool useGravityResult = false;
|
||||
|
||||
currentArtificialObjectGravity = gameObject.GetComponent<artificialObjectGravity> ();
|
||||
|
||||
if (currentArtificialObjectGravity != null) {
|
||||
currentArtificialObjectGravity.setActiveState (true);
|
||||
} else {
|
||||
useGravityResult = true;
|
||||
}
|
||||
|
||||
if (currentObjectWasInsideGravityRoom) {
|
||||
useGravityResult = false;
|
||||
}
|
||||
|
||||
mainRigibody.useGravity = useGravityResult;
|
||||
|
||||
removeGravityActive = false;
|
||||
|
||||
if (setObjectAsKinematicOnZeroVelocity) {
|
||||
mainRigibody.isKinematic = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7415783b8417e84448dc1230095866de
|
||||
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/Abilities System/Custom Abilities/removeGravityFromObjectSystem.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/Abilities System/Custom Abilities/simpleLaser.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/Abilities System/Custom Abilities/slowDownAllAIOnSceneSystem.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/Abilities System/Custom Abilities/stealObjectFromCharacterSystem.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/Abilities System/Custom Abilities/templateAbilitySystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -116,6 +116,15 @@ public class abilityInfo : MonoBehaviour
|
||||
public bool useEnergyOnceOnPressDown;
|
||||
public bool useEnergyOnceOnPressUp;
|
||||
|
||||
[Space]
|
||||
[Header ("Animation Settings")]
|
||||
[Space]
|
||||
|
||||
public bool useAnimationWithActionSystem;
|
||||
public string animationActionSystemName;
|
||||
public bool useAnimationOnPressDown;
|
||||
public bool useAnimationOnPressUp;
|
||||
|
||||
[Space]
|
||||
[Header ("Ability Components")]
|
||||
[Space]
|
||||
@@ -252,6 +261,24 @@ public class abilityInfo : MonoBehaviour
|
||||
|
||||
}
|
||||
|
||||
public void checkIfUseAnimationWithActionSystemOnPressDown ()
|
||||
{
|
||||
if (useAnimationWithActionSystem) {
|
||||
if (useAnimationOnPressDown) {
|
||||
mainPlayerAbilitiesSystem.activateCustomAction (animationActionSystemName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void checkIfUseAnimationWithActionSystemOnPressUp ()
|
||||
{
|
||||
if (useAnimationWithActionSystem) {
|
||||
if (useAnimationOnPressUp) {
|
||||
mainPlayerAbilitiesSystem.activateCustomAction (animationActionSystemName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void checkEventOnSetCurrentAbility ()
|
||||
{
|
||||
if (useEventsOnSetCurrentAbility) {
|
||||
|
||||
@@ -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/Abilities System/abilityInfo.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/Abilities System/abilitySlotElement.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/Abilities System/dashSystem.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/Abilities System/magicSpellActionSystem.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/Abilities System/oxygenSystem.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/Abilities System/particleCollisionDetection.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/Abilities System/particleTriggerDetection.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -61,10 +61,13 @@ public class playerAbilitiesSystem : MonoBehaviour
|
||||
|
||||
public playerAbilitiesUISystem mainPlayerAbilitiesUISystem;
|
||||
|
||||
|
||||
int energyStatIndex;
|
||||
|
||||
bool mainPlayerAbilitiesUISystemAssigned;
|
||||
|
||||
bool ignoreMenusCheckActive;
|
||||
|
||||
void Start ()
|
||||
{
|
||||
if (abilitiesSystemEnabled) {
|
||||
@@ -100,11 +103,11 @@ public class playerAbilitiesSystem : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
void Update ()
|
||||
public bool getCanMove ()
|
||||
{
|
||||
if (abilitiesSystemEnabled) {
|
||||
canMove = !mainPlayerController.isPlayerDead () && mainPlayerController.canPlayerMove ();
|
||||
}
|
||||
canMove = (!mainPlayerController.isPlayerDead () && mainPlayerController.canPlayerMove ());
|
||||
|
||||
return canMove;
|
||||
}
|
||||
|
||||
public void setNextAbility ()
|
||||
@@ -507,7 +510,11 @@ public class playerAbilitiesSystem : MonoBehaviour
|
||||
setPauseCheckUsingDeviceOnAbilityInputState (!pauseCheckUsingDeviceOnAbilityInput);
|
||||
}
|
||||
|
||||
bool ignoreMenusCheckActive;
|
||||
public void activateCustomAction (string actionName)
|
||||
{
|
||||
mainPlayerController.activateCustomAction (actionName);
|
||||
}
|
||||
|
||||
public bool playerIsBusy ()
|
||||
{
|
||||
if (!pauseCheckUsingDeviceOnAbilityInput && mainPlayerController.isUsingDevice ()) {
|
||||
@@ -979,6 +986,8 @@ public class playerAbilitiesSystem : MonoBehaviour
|
||||
|
||||
currentAbilityInfo.activateUpdateAbility ();
|
||||
|
||||
currentAbilityInfo.checkIfUseAnimationWithActionSystemOnPressDown ();
|
||||
|
||||
if (currentAbilityInfo.disableAbilityInputInUseStateOnPressDown) {
|
||||
abilityInputInUse = false;
|
||||
}
|
||||
@@ -1161,6 +1170,8 @@ public class playerAbilitiesSystem : MonoBehaviour
|
||||
|
||||
currentAbilityInfo.stopActivateUpdateAbility ();
|
||||
|
||||
currentAbilityInfo.checkIfUseAnimationWithActionSystemOnPressUp ();
|
||||
|
||||
if (currentAbilityInfo.useTimeLimit && currentAbilityInfo.useTimeLimitOnPressUp) {
|
||||
if (currentAbilityInfo.abilityCurrentlyActiveFromPressUp) {
|
||||
if (currentAbilityInfo.useLimitWhenAbilityCurrentActiveFromPress) {
|
||||
|
||||
@@ -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/Abilities System/playerAbilitiesSystem.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/Abilities System/playerAbilitiesUIEditorSystem.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/Abilities System/playerAbilitiesUISystem.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/Abilities System/simpleAimAndThrowObjectState.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class simpleStrafeAndAimState : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public bool simpleStrafeAndAimEnabled = true;
|
||||
|
||||
[Space]
|
||||
[Header ("Movement Settings")]
|
||||
[Space]
|
||||
|
||||
public bool useStrafeMode;
|
||||
public int strafeIDUsed;
|
||||
public bool setPreviousStrafeModeOnDisableSystem;
|
||||
|
||||
public bool activateStrafeModeOnLockOnTargetActive;
|
||||
|
||||
public bool toggleStrafeModeIfRunningActive;
|
||||
|
||||
public bool setNewCrouchID;
|
||||
public int crouchIDUsed;
|
||||
|
||||
[Space]
|
||||
[Header ("Aim Settings")]
|
||||
[Space]
|
||||
|
||||
public bool setAimStateEnabled;
|
||||
|
||||
[Space]
|
||||
[Header ("Third Person Camera State Settings")]
|
||||
[Space]
|
||||
|
||||
public bool setNewCameraStateOnThirdPerson;
|
||||
|
||||
public string newCameraStateOnThirdPerson;
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public bool simpleStrafeAndAimActive;
|
||||
|
||||
public bool previousStrafeMode;
|
||||
public int previousStrafeID = -1;
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
|
||||
public playerController mainPlayerController;
|
||||
public playerCamera mainPlayerCamera;
|
||||
|
||||
string previousCameraState;
|
||||
|
||||
|
||||
public void setSimpleStrafeAndAimState (bool state)
|
||||
{
|
||||
if (!simpleStrafeAndAimEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (simpleStrafeAndAimActive == state) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mainPlayerCamera.isFullBodyAwarenessActive ()) {
|
||||
return;
|
||||
}
|
||||
|
||||
simpleStrafeAndAimActive = state;
|
||||
|
||||
if (simpleStrafeAndAimActive) {
|
||||
activateState ();
|
||||
} else {
|
||||
deactivateState ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void activateState ()
|
||||
{
|
||||
previousStrafeMode = mainPlayerController.isStrafeModeActive ();
|
||||
|
||||
if (previousStrafeID == -1) {
|
||||
previousStrafeID = mainPlayerController.getCurrentStrafeIDValue ();
|
||||
}
|
||||
|
||||
if (useStrafeMode) {
|
||||
mainPlayerController.activateOrDeactivateStrafeMode (true);
|
||||
|
||||
mainPlayerController.setLookOnlyIfMovingState (false);
|
||||
|
||||
} else {
|
||||
|
||||
previousStrafeMode = false;
|
||||
|
||||
previousStrafeID = -1;
|
||||
|
||||
mainPlayerController.activateOrDeactivateStrafeMode (false);
|
||||
}
|
||||
|
||||
if (toggleStrafeModeIfRunningActive) {
|
||||
mainPlayerController.setDisableStrafeModeExternallyIfIncreaseWalkSpeedActiveState (true);
|
||||
}
|
||||
|
||||
mainPlayerController.setCurrentStrafeIDValue (strafeIDUsed);
|
||||
|
||||
if (setNewCrouchID) {
|
||||
mainPlayerController.setCurrentCrouchIDValue (crouchIDUsed);
|
||||
}
|
||||
|
||||
if (setAimStateEnabled) {
|
||||
mainPlayerCamera.setManualAimStateOnLockedCamera (true);
|
||||
}
|
||||
}
|
||||
|
||||
public void deactivateState ()
|
||||
{
|
||||
if (setPreviousStrafeModeOnDisableSystem) {
|
||||
mainPlayerController.activateOrDeactivateStrafeMode (previousStrafeMode);
|
||||
} else {
|
||||
mainPlayerController.setOriginalLookAlwaysInCameraDirectionState ();
|
||||
}
|
||||
|
||||
mainPlayerController.setOriginalLookOnlyIfMovingState ();
|
||||
|
||||
if (previousStrafeID != -1) {
|
||||
mainPlayerController.setCurrentStrafeIDValue (previousStrafeID);
|
||||
}
|
||||
|
||||
if (toggleStrafeModeIfRunningActive) {
|
||||
mainPlayerController.setDisableStrafeModeExternallyIfIncreaseWalkSpeedActiveState (false);
|
||||
}
|
||||
|
||||
previousStrafeMode = false;
|
||||
|
||||
previousStrafeID = -1;
|
||||
|
||||
if (setNewCrouchID) {
|
||||
mainPlayerController.setCurrentCrouchIDValue (0);
|
||||
}
|
||||
|
||||
if (setAimStateEnabled) {
|
||||
mainPlayerCamera.setManualAimStateOnLockedCamera (false);
|
||||
}
|
||||
}
|
||||
|
||||
public void checkLookAtTargetActiveState ()
|
||||
{
|
||||
if (simpleStrafeAndAimActive) {
|
||||
bool lookingAtTarget = mainPlayerController.isPlayerLookingAtTarget ();
|
||||
|
||||
if (lookingAtTarget) {
|
||||
if (activateStrafeModeOnLockOnTargetActive) {
|
||||
mainPlayerController.activateOrDeactivateStrafeMode (true);
|
||||
|
||||
}
|
||||
} else {
|
||||
if (activateStrafeModeOnLockOnTargetActive) {
|
||||
mainPlayerController.activateOrDeactivateStrafeMode (false);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void checkLookAtTargetDeactivateState ()
|
||||
{
|
||||
if (simpleStrafeAndAimActive && activateStrafeModeOnLockOnTargetActive) {
|
||||
mainPlayerController.activateOrDeactivateStrafeMode (false);
|
||||
}
|
||||
}
|
||||
|
||||
void checkCameraState (bool state)
|
||||
{
|
||||
if (setNewCameraStateOnThirdPerson) {
|
||||
if (state) {
|
||||
previousCameraState = mainPlayerCamera.getCurrentStateName ();
|
||||
|
||||
mainPlayerCamera.setCameraStateOnlyOnThirdPerson (newCameraStateOnThirdPerson);
|
||||
} else {
|
||||
|
||||
if (previousCameraState != "") {
|
||||
if (previousCameraState != newCameraStateOnThirdPerson) {
|
||||
mainPlayerCamera.setCameraStateOnlyOnThirdPerson (previousCameraState);
|
||||
}
|
||||
|
||||
previousCameraState = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb6528a20a4ae014a86e9e8d73614f73
|
||||
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/Abilities System/simpleStrafeAndAimState.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/Abilities System/simpleThrowFireWaveAbility.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/Abilities System/staminaSystem.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/Abilities System/throwObjectTrayectorySystem.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/Abilities System/wallRunningZoneSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
Reference in New Issue
Block a user