移除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: 5c6227c91940406409f9456a4497e746
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

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

View File

@@ -1,28 +0,0 @@
using UnityEngine;
namespace ECM2.Walkthrough.Ex61
{
/// <summary>
/// This example shows how to implement a directional bouncer using the Character's LaunchCharacter function.
/// </summary>
public class Bouncer : MonoBehaviour
{
public float launchImpulse = 15.0f;
public bool overrideVerticalVelocity;
public bool overrideLateralVelocity;
private void OnTriggerEnter(Collider other)
{
if (!other.CompareTag("Player"))
return;
if (!other.TryGetComponent(out Character character))
return;
character.PauseGroundConstraint();
character.LaunchCharacter(transform.up * launchImpulse, overrideVerticalVelocity, overrideLateralVelocity);
}
}
}

View File

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

View File

@@ -1,41 +0,0 @@
using UnityEngine;
namespace ECM2.Walkthrough.Ex61
{
/// <summary>
/// This example shows how to simulate a directional wind using the Character's AddForce method.
/// </summary>
public class ForceZone : MonoBehaviour
{
public Vector3 windDirection = Vector3.up;
public float windStrength = 20.0f;
private void OnTriggerStay(Collider other)
{
if (!other.CompareTag("Player"))
return;
if (!other.TryGetComponent(out Character character))
return;
Vector3 windForce = windDirection.normalized * windStrength;
// Check to see if applied momentum is enough to overcome gravity,
// if does, pause ground constraint to allow the character leave the ground
Vector3 worldUp = -character.GetGravityDirection();
float upWindForceMagnitude = Vector3.Dot(windForce, worldUp);
if (upWindForceMagnitude > 0.0f)
{
if (character.IsWalking() && upWindForceMagnitude - character.GetGravityMagnitude() > 0.0f)
character.PauseGroundConstraint();
}
// Add force ignoring character's mass
character.AddForce(windForce, ForceMode.Acceleration);
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 123fd4edbed747d08a7269e248ace9be
timeCreated: 1700531367

View File

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

View File

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

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 584e635a936d48cba39504fbe0661830
timeCreated: 1701142404

View File

@@ -1,46 +0,0 @@
using UnityEngine;
namespace ECM2.Walkthrough.Ex62
{
/// <summary>
/// This example extends a Character (through composition) to apply a landing force
/// when it lands on a dynamic rigidbody.
///
/// The landing force is calculated (characterMass * characterGravity * landingVelocity * landingForceMag)
/// and is applied along gravity direction.
/// </summary>
public class ApplyLandingForce : MonoBehaviour
{
public float landingForceScale = 1.0f;
private Character _character;
private void Awake()
{
_character = GetComponent<Character>();
}
private void OnEnable()
{
_character.Landed += OnLanded;
}
private void OnDisable()
{
_character.Landed -= OnLanded;
}
private void OnLanded(Vector3 landingVelocity)
{
Rigidbody groundRigidbody = _character.characterMovement.groundRigidbody;
if (!groundRigidbody)
return;
Vector3 force = _character.GetGravityVector() *
(_character.mass * landingVelocity.magnitude * landingForceScale);
groundRigidbody.AddForceAtPosition(force, _character.position);
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 931fef3c18e6491c84e85c9053988e76
timeCreated: 1701142457