add some extra assets FX and SFX
This commit is contained in:
@@ -57,6 +57,8 @@ public class matchPlayerToTargetSystem : MonoBehaviour
|
||||
public bool checkMaxVerticalDistanceWithTarget;
|
||||
public float maxVerticalDistanceWithTarget;
|
||||
|
||||
public bool useLocalVerticalDistance;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool checkIfObstaclesToTarget;
|
||||
@@ -261,6 +263,13 @@ public class matchPlayerToTargetSystem : MonoBehaviour
|
||||
movementCoroutine = StartCoroutine (activateMatchPositionCoroutine (targetToUse, customOffset));
|
||||
}
|
||||
|
||||
public void stopMovementIfActive ()
|
||||
{
|
||||
if (movementActive) {
|
||||
stopMovement ();
|
||||
}
|
||||
}
|
||||
|
||||
public void stopMovement ()
|
||||
{
|
||||
if (movementCoroutine != null) {
|
||||
@@ -317,6 +326,10 @@ public class matchPlayerToTargetSystem : MonoBehaviour
|
||||
float targetToUseRadius = GKC_Utils.getCharacterRadius (targetToUse);
|
||||
|
||||
currentPositionOffset += mainPlayerController.getCharacterRadius () + targetToUseRadius;
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("current character radius obtained " + targetToUseRadius);
|
||||
}
|
||||
}
|
||||
|
||||
if (adjustVerticalPositionEnabled) {
|
||||
@@ -511,7 +524,33 @@ public class matchPlayerToTargetSystem : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
if (!ignoreRestOfChecks) {
|
||||
bool ignoreCurrentTarget = false;
|
||||
|
||||
if (checkMaxVerticalDistanceWithTarget) {
|
||||
float verticalDistance = 0;
|
||||
|
||||
if (useLocalVerticalDistance) {
|
||||
verticalDistance = verticalDistanceInLocalDirection (playerTransform, charactersAround [i]);
|
||||
} else {
|
||||
verticalDistance = Mathf.Abs (characterPosition.y - currentPlayerPosition.y);
|
||||
}
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("vertical distance obtained for " + charactersAround [i].name + " " + verticalDistance);
|
||||
}
|
||||
|
||||
if (verticalDistance > maxVerticalDistanceWithTarget) {
|
||||
transformToMatchPosition = null;
|
||||
|
||||
ignoreCurrentTarget = true;
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("vertical distance too long " + verticalDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!ignoreRestOfChecks && !ignoreCurrentTarget) {
|
||||
//unity takes the resolution of the main screen if the press or input is done on
|
||||
//the editor it self, instead of taking the resolution of the game window
|
||||
|
||||
@@ -523,18 +562,6 @@ public class matchPlayerToTargetSystem : MonoBehaviour
|
||||
canBeChecked = true;
|
||||
}
|
||||
|
||||
if (checkMaxVerticalDistanceWithTarget) {
|
||||
float verticalDistance = Mathf.Abs (characterPosition.y - currentPlayerPosition.y);
|
||||
|
||||
if (verticalDistance > maxVerticalDistanceWithTarget) {
|
||||
canBeChecked = false;
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("vertical distance too long " + verticalDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (checkIfObstaclesToTarget) {
|
||||
RaycastHit hit;
|
||||
|
||||
@@ -578,6 +605,15 @@ public class matchPlayerToTargetSystem : MonoBehaviour
|
||||
return transformToMatchPosition;
|
||||
}
|
||||
|
||||
|
||||
//future check to get the distance locally instead of using the Y axis
|
||||
float verticalDistanceInLocalDirection (Transform a, Transform b)
|
||||
{
|
||||
Vector3 direction = b.position - a.position;
|
||||
|
||||
return Mathf.Abs (Vector3.Dot (direction, a.up));
|
||||
}
|
||||
|
||||
void checkEventsOnTargetsChange (bool state)
|
||||
{
|
||||
if (useEventsOnTargetsChange) {
|
||||
|
||||
Reference in New Issue
Block a user