# Change Log

## Version 1.4.3

Character

* The `_desiredVelocity` field is now marked as `protected` (was previously `private`), allowing modification from the `CalcDesiredVelocity` method in derived classes.
* The methods `IsJumpAllowed` and `CanJump` are now `public`, enabling access from external (non-derived) classes.

#### CharacterMovement

* The **Advanced** properties are now marked as `public`.

#### Examples

* Updated **FishNet** example to its latest version.
* Added a **Third Person** example for **Fusion 2**.
* Added a **Cinemachine Path Following** example.

## Version 1.4.2

* **New Distribution Versions**: ECM2 is now available in two versions—one for **Unity 2021+** and a native version for **Unity 6**, which includes support for **URP**, the **Input System**, and the latest **Cinemachine** version.
* **Removed Cinemachine Requirement**: The demo scene now uses the `ThirdPersonController` (non-Cinemachine based). `Cinemachine` examples are still available as a separate package.
* **Added New Input System Examples**: New examples demonstrate character control in both `First` and `Third` person views using **Unity’s Input System**.
* **New useFastGeomNormalPath Option for `CharacterMovement`**: Added the `useFastGeomNormalPath` option, which allows the `FindGeomOpposingNormal` method to compute `surfaceNormal` using a faster, though slightly less accurate, approximation.
* **InvokeMovementModeChangedEvent in `Character` Class**: Introduced `InvokeMovementModeChangedEvent` to centralize the `OnMovementModeChanged` method. This allows derived classes to override it, improving modularity and flexibility.
* **ApplyDownwardsForce Now Public**: The `ApplyDownwardsForce` method in the `Character` class is now publicly accessible.
* **Enhanced AddExplosionForce**: Improved the `AddExplosionForce` method for behavior more closely aligned with Unity's native `AddExplosionForce`.
* **Updated FishNet Example**: The FishNet example has been updated to its latest version.
* **Bug Fixes**:
  * **Platform Landing Synchronization**: Resolved a slight de-synchronization in character velocity when landing on moving platforms. The issue, influenced by ground friction and falling lateral friction, was due to execution order, where character velocity was adjusted by movement mode before platform velocity was applied.
  * **Photon Fusion 2 Initialization**: Fixed an issue in Photon Fusion 2 examples where `NetworkData` was sometimes not initialized under specific conditions.

## Version 1.4.1

* Added networking examples for the latest versions of Fusion, FishNet, Mirror, and NetCode.
* Added Input system example.
* Updated swimming example. This demonstrates the implementation of a jump out of water.
* Minor bug fixes and improvements.

## Version 1.4.0

{% hint style="danger" %}
This version is a complete package revision; as such, there are some significant changes that may affect compatibility with previous versions.&#x20;

It is recommended to import it into a clean project before applying the update in your main environment.
{% endhint %}

{% hint style="warning" %}
**Important note on package dependencies**

**ECM2 does not require any external package**, however its **Demos** and **Examples** requires **Cinemachine** package to work.

Please make sure to install the **Cinemachine** package into your project when importing **demos** and **examples**.
{% endhint %}

### General

* The entire package now resides under the `ECM2` namespace.

### **Character Movement**

* The `CollisionBehavior` enum has been renamed to `CollisionBehaviour` to align with Unity's nomenclature and now uses the \[Flags] attribute.
* The callback associated with `CollisionBehavior` has been renamed to `CollisionBehaviourCallback` to match Unity's nomenclature.
* The `DepenetrationBehavior` enum has been renamed to `DepenetrationBehaviour` to align with Unity's nomenclature, and it now uses the \[Flags] attribute.
* All fields have been corrected to reflect the 'behaviour' changes.
* The `IComparer` interface has been removed as it was causing runtime allocations.
* The use of `Array.Sort` (which caused runtime allocations) has been replaced with a custom implementation (insertion sort).
* The `State` struct, along with the `GetState` and `SetState` methods, has been removed.
* Collision and overlap limits (`kMaxCollisionCount` and `kMaxOverlapCount`) have been increased to 16 (previously 8).
* The `Velocity` property is now a ref.
* The current plane constraint normal is exposed through the `GetPlaneConstraintNormal()` method.
* The `SetPlatform` method has been renamed to `AttachTo`.
* Fixed an issue with `ImpartPlatformRotation` causing incorrect rotation when upside down.
* Minor bug fixes and improvements.

### Mesh Utility

* Resolved a bug causing reversed normals in certain mesh instances.

### Slope Limit Behaviour

* Renamed the `SlopeLimitBehaviour` component and its associated fields to `SlopeLimitBehavior` to align with Unity's naming conventions.

### Character

{% hint style="warning" %}
The `Character` class has undergone a complete refactoring (breaking changes). Among its new features, it now supports extension through composition.
{% endhint %}

* **Input Code Removal:** All input-related code has been removed for a streamlined codebase.
* **Sprint and Related Fields:** The `Sprint` and related fields have been removed and are now available as examples.
* **Jump Refactor:** The `Jump` functionality has been completely refactored. The original jump can be found in examples as an ability.
* **MovementMode and RotationMode Enums:** `Enums` (`MovementMode` and `RotationMode`) are now part of the `Character` class. Example usage: `Character.MovementMode.Walking`, `Character.RotationMode.OrientRotationToMovement`.
* **deltaTime Property Removal:** The `deltaTime` property has been removed and is now a parameter for functions requiring it.
* **Method Name Changes:** Movement mode-related methods have been renamed for clarity (e.g. `Walking` to `WalkingMovementMode`, `Falling` to `FallingMovementMode, etc`).
* **Move Method Removal:** The `Move` method has been removed.
* **Simulation Method Refactor:** The `Simulation` method has been refactored and split into inner methods and events for increased flexibility.
* **Character Class Removals:**
  * `FirstPersonCharacter` has been removed and is now available as an example.
  * `ThirdPersonCharacter` has been removed and is now available as an example.
  * `AgentCharacter` class has been replaced by the new `NavMeshCharacter` component, an extension adding `NavMesh` based navigation capabilities.

For more details, please refer to the updated documentation.
