移除ECM2

This commit is contained in:
2025-05-11 21:42:51 +08:00
parent aadd564c38
commit a7bf033ca9
726 changed files with 0 additions and 138648 deletions

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 26e3edf69cc50474888179da47b38ab3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: df5e43a2b20112544875caa4d72e1b22
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 218dc7872e014a538fe2f1f1b732e706
timeCreated: 1700123862

View File

@@ -1,70 +0,0 @@
using UnityEngine;
namespace ECM2.Walkthrough.Ex31
{
/// <summary>
/// This example shows how to animate a Character,
/// using the Character data (movement direction, velocity, is jumping, etc) to feed your Animator.
/// </summary>
public class AnimationController : MonoBehaviour
{
// Cache Animator parameters
private static readonly int Forward = Animator.StringToHash("Forward");
private static readonly int Turn = Animator.StringToHash("Turn");
private static readonly int Ground = Animator.StringToHash("OnGround");
private static readonly int Crouch = Animator.StringToHash("Crouch");
private static readonly int Jump = Animator.StringToHash("Jump");
private static readonly int JumpLeg = Animator.StringToHash("JumpLeg");
// Cached Character
private Character _character;
private void Awake()
{
// Cache our Character
_character = GetComponentInParent<Character>();
}
private void Update()
{
float deltaTime = Time.deltaTime;
// Get Character animator
Animator animator = _character.GetAnimator();
// Compute input move vector in local space
Vector3 move = transform.InverseTransformDirection(_character.GetMovementDirection());
// Update the animator parameters
float forwardAmount = _character.useRootMotion && _character.GetRootMotionController()
? move.z
: Mathf.InverseLerp(0.0f, _character.GetMaxSpeed(), _character.GetSpeed());
animator.SetFloat(Forward, forwardAmount, 0.1f, deltaTime);
animator.SetFloat(Turn, Mathf.Atan2(move.x, move.z), 0.1f, deltaTime);
animator.SetBool(Ground, _character.IsGrounded());
animator.SetBool(Crouch, _character.IsCrouched());
if (_character.IsFalling())
animator.SetFloat(Jump, _character.GetVelocity().y, 0.1f, deltaTime);
// Calculate which leg is behind, so as to leave that leg trailing in the jump animation
// (This code is reliant on the specific run cycle offset in our animations,
// and assumes one leg passes the other at the normalized clip times of 0.0 and 0.5)
float runCycle = Mathf.Repeat(animator.GetCurrentAnimatorStateInfo(0).normalizedTime + 0.2f, 1.0f);
float jumpLeg = (runCycle < 0.5f ? 1.0f : -1.0f) * forwardAmount;
if (_character.IsGrounded())
animator.SetFloat(JumpLeg, jumpLeg);
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 637965ac47304625a97a4eb85d5b98af
timeCreated: 1700123873

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: a975b64a803cefa47aaa4a3c1b8e9225
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 4f612ffbed25c174c8516cd491a87438
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: a63ee7994c49a1e4e82074f9fb5cb6a0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: f87749751c4088647acafff6304c760d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 89d104878c1437246b197fe4a829808d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,40 +0,0 @@
using UnityEngine;
namespace ECM2.Walkthrough.Ex33
{
/// <summary>
/// This example shows how to extend a Character (through composition) to enable / disable (toggle)
/// root motion as needed; in this case, enabled when walking.
/// </summary>
public class RootMotionToggle : MonoBehaviour
{
private Character _character;
private void OnMovementModeChanged(Character.MovementMode prevMovementMode, int prevCustomMovementMode)
{
// Allow root motion only while walking
_character.useRootMotion = _character.IsWalking();
}
private void Awake()
{
_character = GetComponent<Character>();
}
private void OnEnable()
{
// Subscribe to Character events
_character.MovementModeChanged += OnMovementModeChanged;
}
private void OnDisable()
{
// Un-Subscribe from Character events
_character.MovementModeChanged -= OnMovementModeChanged;
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 0dff82c65b2d69948bcee99cdd3a44da
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: