This commit is contained in:
2025-05-16 23:31:59 +08:00
parent 9e4fef3f1e
commit d891e3f0ee
1198 changed files with 274242 additions and 1558 deletions

View File

@@ -0,0 +1,27 @@
using UnityEngine;
namespace ECM2.Examples
{
/// <summary>
/// Shows how to use the new (introduced in v1.4) Character Pause method to pause / resume a Character.
/// When paused, a Character prevents any interaction.
/// </summary>
public class CharacterPause : MonoBehaviour
{
private Character _character;
private void Awake()
{
_character = GetComponent<Character>();
}
private void Update()
{
// Toggle Character pause
if (Input.GetKeyDown(KeyCode.P))
_character.Pause(!_character.isPaused);
}
}
}