add some extra assets FX and SFX
This commit is contained in:
@@ -79,6 +79,10 @@ public class playerActionSystem : MonoBehaviour
|
||||
|
||||
public float maxWaitToResumeIfAnimationTakesLongerDuration = 0.8f;
|
||||
|
||||
[Space]
|
||||
|
||||
public float raycastDistance = 2;
|
||||
|
||||
[Space]
|
||||
[Header ("Events Settings")]
|
||||
[Space]
|
||||
@@ -889,7 +893,9 @@ public class playerActionSystem : MonoBehaviour
|
||||
|
||||
RaycastHit hit;
|
||||
|
||||
if (Physics.Raycast (currentActionInfo.positionToAdjustPlayer.position + Vector3.up, -Vector3.up, out hit, 2, currentActionInfo.layerForRaycast)) {
|
||||
if (Physics.Raycast (currentActionInfo.positionToAdjustPlayer.position + Vector3.up,
|
||||
-Vector3.up, out hit, raycastDistance, currentActionInfo.layerForRaycast)) {
|
||||
|
||||
currentActionInfo.positionToAdjustPlayer.position = hit.point + 0.01f * Vector3.up;
|
||||
}
|
||||
}
|
||||
@@ -1030,7 +1036,9 @@ public class playerActionSystem : MonoBehaviour
|
||||
if (currentActionInfo.useRaycastToAdjustMatchTransform) {
|
||||
RaycastHit hit;
|
||||
|
||||
if (Physics.Raycast (currentActionInfo.matchTargetTransform.position + Vector3.up, -Vector3.up, out hit, 2, currentActionInfo.layerForRaycast)) {
|
||||
if (Physics.Raycast (currentActionInfo.matchTargetTransform.position + Vector3.up, -Vector3.up,
|
||||
out hit, raycastDistance, currentActionInfo.layerForRaycast)) {
|
||||
|
||||
currentActionInfo.matchTargetTransform.position = hit.point + 0.05f * Vector3.up;
|
||||
}
|
||||
}
|
||||
@@ -1129,7 +1137,7 @@ public class playerActionSystem : MonoBehaviour
|
||||
|
||||
if (Mathf.Abs (currentSurfaceHitAngle) > 1) {
|
||||
|
||||
if (Physics.Raycast (targetPosition, -playerTransform.up, out hit, 3, currentActionInfo.movePlayerOnDirectionLayermask)) {
|
||||
if (Physics.Raycast (targetPosition, -playerTransform.up, out hit, raycastDistance + 1, currentActionInfo.movePlayerOnDirectionLayermask)) {
|
||||
currentSurfaceHitAngle = Vector3.SignedAngle (playerTransform.up, hit.normal, playerTransform.right);
|
||||
}
|
||||
|
||||
@@ -1282,7 +1290,9 @@ public class playerActionSystem : MonoBehaviour
|
||||
if (currentActionInfo.useRaycastToAdjustTargetTransform) {
|
||||
RaycastHit hit;
|
||||
|
||||
if (Physics.Raycast (currentActionInfo.playerWalkTarget.position + Vector3.up, -Vector3.up, out hit, 2, currentActionInfo.layerForRaycast)) {
|
||||
if (Physics.Raycast (currentActionInfo.playerWalkTarget.position + Vector3.up, -Vector3.up,
|
||||
out hit, raycastDistance, currentActionInfo.layerForRaycast)) {
|
||||
|
||||
currentActionInfo.playerWalkTarget.position = hit.point + 0.05f * Vector3.up;
|
||||
}
|
||||
}
|
||||
@@ -1648,14 +1658,16 @@ public class playerActionSystem : MonoBehaviour
|
||||
} else {
|
||||
resumePlayer ();
|
||||
|
||||
if (currentActionInfo.resetActionIndexAfterComplete) {
|
||||
currentActionInfoIndex = 0;
|
||||
if (currentActionInfo != null) {
|
||||
if (currentActionInfo.resetActionIndexAfterComplete) {
|
||||
currentActionInfoIndex = 0;
|
||||
|
||||
currentActionInfo = currentActionSystem.actionInfoList [currentActionInfoIndex];
|
||||
currentActionInfo = currentActionSystem.actionInfoList [currentActionInfoIndex];
|
||||
|
||||
currentActionName = currentActionInfo.Name;
|
||||
currentActionName = currentActionInfo.Name;
|
||||
|
||||
currentActionSystem.resetCurrentActionInfoIndex ();
|
||||
currentActionSystem.resetCurrentActionInfoIndex ();
|
||||
}
|
||||
}
|
||||
|
||||
checkDestroyAction ();
|
||||
@@ -1681,8 +1693,6 @@ public class playerActionSystem : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// print ("final");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3092,18 +3102,42 @@ public class playerActionSystem : MonoBehaviour
|
||||
}
|
||||
|
||||
if (!currentActionInfo.setHealthOnActionEnd) {
|
||||
if (currentActionInfo.addHealthAmountOnAction) {
|
||||
mainHealth.addHealth (currentActionInfo.healthAmountToAdd);
|
||||
}
|
||||
|
||||
if (currentActionInfo.removeHealthAmountOnAction) {
|
||||
if (currentActionInfo.useWaitTimeToChangeHealth) {
|
||||
bool isDamageReactionPaused = mainHealth.isDamageReactionPaused ();
|
||||
|
||||
mainHealth.setDamageReactionPausedState (true);
|
||||
float healthAmountToChange = 0;
|
||||
|
||||
mainHealth.takeHealth (currentActionInfo.healthAmountToRemove);
|
||||
if (currentActionInfo.addHealthAmountOnAction) {
|
||||
healthAmountToChange = currentActionInfo.healthAmountToAdd;
|
||||
}
|
||||
|
||||
mainHealth.setDamageReactionPausedState (isDamageReactionPaused);
|
||||
if (currentActionInfo.removeHealthAmountOnAction) {
|
||||
mainHealth.setDamageReactionPausedState (true);
|
||||
|
||||
healthAmountToChange = Mathf.Abs (currentActionInfo.healthAmountToRemove) * (-1);
|
||||
}
|
||||
|
||||
applyDamage.setDamageOrHealthTargetWithDelay (playerTransform.gameObject, currentActionInfo.waitTimeToChangeHealth, healthAmountToChange, -1);
|
||||
|
||||
if (currentActionInfo.removeHealthAmountOnAction) {
|
||||
mainHealth.setDamageReactionPausedState (isDamageReactionPaused);
|
||||
}
|
||||
} else {
|
||||
if (currentActionInfo.addHealthAmountOnAction) {
|
||||
mainHealth.addHealth (currentActionInfo.healthAmountToAdd);
|
||||
}
|
||||
|
||||
if (currentActionInfo.removeHealthAmountOnAction) {
|
||||
bool isDamageReactionPaused = mainHealth.isDamageReactionPaused ();
|
||||
|
||||
mainHealth.setDamageReactionPausedState (true);
|
||||
|
||||
float healthAmountToChange = Mathf.Abs (currentActionInfo.healthAmountToRemove);
|
||||
|
||||
mainHealth.takeHealth (healthAmountToChange);
|
||||
|
||||
mainHealth.setDamageReactionPausedState (isDamageReactionPaused);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3753,7 +3787,9 @@ public class playerActionSystem : MonoBehaviour
|
||||
|
||||
mainHealth.setDamageReactionPausedState (true);
|
||||
|
||||
mainHealth.takeHealth (currentActionInfo.healthAmountToRemove);
|
||||
float healthAmountToChange = Mathf.Abs (currentActionInfo.healthAmountToRemove);
|
||||
|
||||
mainHealth.takeHealth (healthAmountToChange);
|
||||
|
||||
mainHealth.setDamageReactionPausedState (isDamageReactionPaused);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user