|
|
|
@ -31,6 +31,15 @@ public class VectorFencePrefab : NetworkBehaviour
|
|
|
|
|
|
|
|
|
|
private IEnumerator ScaleUp()
|
|
|
|
|
{
|
|
|
|
|
if (navMeshObstacle != null)
|
|
|
|
|
{
|
|
|
|
|
navMeshObstacle.enabled = true;
|
|
|
|
|
navMeshObstacle.carving = true;
|
|
|
|
|
navMeshObstacle.carveOnlyStationary = false;
|
|
|
|
|
navMeshObstacle.carvingMoveThreshold = 0.01f;
|
|
|
|
|
navMeshObstacle.center = Vector3.zero; // Adjust center if needed
|
|
|
|
|
navMeshObstacle.shape = NavMeshObstacleShape.Box;
|
|
|
|
|
}
|
|
|
|
|
float elapsedTime = 0f;
|
|
|
|
|
Vector3 originalScale = transform.localScale;
|
|
|
|
|
Vector3 targetScale = new Vector3(Ability.wallLength, Ability.wallHeight, Ability.wallWidth); // Target full height scale
|
|
|
|
@ -44,14 +53,7 @@ public class VectorFencePrefab : NetworkBehaviour
|
|
|
|
|
|
|
|
|
|
transform.localScale = targetScale;
|
|
|
|
|
|
|
|
|
|
// Enable the NavMeshObstacle after scaling is complete
|
|
|
|
|
if (navMeshObstacle != null)
|
|
|
|
|
{
|
|
|
|
|
navMeshObstacle.enabled = true;
|
|
|
|
|
navMeshObstacle.carving = true;
|
|
|
|
|
navMeshObstacle.center = Vector3.zero; // Adjust center if needed
|
|
|
|
|
navMeshObstacle.shape = NavMeshObstacleShape.Box;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private IEnumerator DestroyAfterLifetime()
|
|
|
|
|