移除ECM2
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2f424a060a55e54fa1e050bdce93433
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 123fd4edbed747d08a7269e248ace9be
|
||||
timeCreated: 1700531367
|
||||
Reference in New Issue
Block a user