// This siumulates the enemy's movement based on the actual enemy movement public void Simulate(float time) { Vector3 outPos; Quaternion outRot; Waypoint outWay; EnemyMover.Solve(gameObject.GetHashCode(), dummyPosition, dummyRotation, moveSpeed, rotationSpeed, time, dummyTarget, 0.25f, out outPos, out outRot, out outWay); dummyPosition = outPos; dummyRotation = outRot; dummyTarget = outWay; currentPosition = dummyPosition; currentRotation = dummyRotation; }
// This moves the enemy in the game running environment void Update() { Vector3 outPos; Quaternion outRot; Waypoint outWay; EnemyMover.Solve(gameObject.GetHashCode(), transform.position, transform.rotation, moveSpeed, rotationSpeed, Time.deltaTime, target, 0.25f, out outPos, out outRot, out outWay); transform.position = outPos; transform.rotation = outRot; target = outWay; currentPosition = transform.position; currentRotation = transform.rotation; }