移除ECM2
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62e04b9d2fdce1d48a58d6f32dbe9d94
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f8ae32dc088988e4a8c1bc3aa94e1980
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b54570a11beb04408cb0b800a30e3d4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,103 +0,0 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace ECM2.Walkthrough.Ex23
|
||||
{
|
||||
/// <summary>
|
||||
/// This example shows how to make use of the new Input System,
|
||||
/// in particular, the PlayerInput component to control a Character.
|
||||
///
|
||||
/// These handlers are updated and managed by the PlayerInput component.
|
||||
/// </summary>
|
||||
|
||||
public class CharacterInput : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Our controlled character.
|
||||
/// </summary>
|
||||
|
||||
[Tooltip("Character to be controlled.\n" +
|
||||
"If not assigned, this will look into this GameObject.")]
|
||||
[SerializeField]
|
||||
private Character _character;
|
||||
|
||||
/// <summary>
|
||||
/// Current movement input values.
|
||||
/// </summary>
|
||||
|
||||
private Vector2 _movementInput;
|
||||
|
||||
/// <summary>
|
||||
/// Movement InputAction event handler.
|
||||
/// </summary>
|
||||
|
||||
public void OnMove(InputAction.CallbackContext context)
|
||||
{
|
||||
_movementInput = context.ReadValue<Vector2>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Jump InputAction event handler.
|
||||
/// </summary>
|
||||
|
||||
public void OnJump(InputAction.CallbackContext context)
|
||||
{
|
||||
if (context.started)
|
||||
_character.Jump();
|
||||
else if (context.canceled)
|
||||
_character.StopJumping();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Crouch InputAction event handler.
|
||||
/// </summary>
|
||||
|
||||
public void OnCrouch(InputAction.CallbackContext context)
|
||||
{
|
||||
if (context.started)
|
||||
_character.Crouch();
|
||||
else if (context.canceled)
|
||||
_character.UnCrouch();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle polled input here (ie: movement, look, etc.)
|
||||
/// </summary>
|
||||
|
||||
protected virtual void HandleInput()
|
||||
{
|
||||
// Compose a movement direction vector in world space
|
||||
|
||||
Vector3 movementDirection = Vector3.zero;
|
||||
|
||||
movementDirection += Vector3.forward * _movementInput.y;
|
||||
movementDirection += Vector3.right * _movementInput.x;
|
||||
|
||||
// If character has a camera assigned,
|
||||
// make movement direction relative to this camera view direction
|
||||
|
||||
if (_character.cameraTransform)
|
||||
{
|
||||
movementDirection
|
||||
= movementDirection.relativeTo(_character.cameraTransform, _character.GetUpVector());
|
||||
}
|
||||
|
||||
// Set character's movement direction vector
|
||||
|
||||
_character.SetMovementDirection(movementDirection);
|
||||
}
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
// If character not assigned, attempts to cache from this current GameObject
|
||||
|
||||
if (_character == null)
|
||||
_character = GetComponent<Character>();
|
||||
}
|
||||
|
||||
protected virtual void Update()
|
||||
{
|
||||
HandleInput();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 855c880aafd786e469e74d8dcc0f4fc8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a485e6ba4ca328418198154c3c5b8a9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 051ffeb8996dad2478867b59b30b8149
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ffee0df8c7b39c14aaf448ac6f058315
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,133 +0,0 @@
|
||||
using ECM2.Examples.FirstPerson;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace ECM2.Walkthrough.Ex24
|
||||
{
|
||||
/// <summary>
|
||||
/// This example shows how to make use of the new Input System,
|
||||
/// in particular, the PlayerInput component to control a First Person Character.
|
||||
///
|
||||
/// These handlers are updated and managed by the PlayerInput component.
|
||||
/// </summary>
|
||||
|
||||
public class FirstPersonInput : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Our controlled character.
|
||||
/// </summary>
|
||||
|
||||
[Tooltip("Character to be controlled.\n" +
|
||||
"If not assigned, this will look into this GameObject.")]
|
||||
[SerializeField]
|
||||
private FirstPersonCharacter _character;
|
||||
|
||||
[Space(15.0f)]
|
||||
public bool invertLook = true;
|
||||
[Tooltip("Mouse look sensitivity")]
|
||||
public Vector2 sensitivity = new Vector2(0.05f, 0.05f);
|
||||
|
||||
[Space(15.0f)]
|
||||
[Tooltip("How far in degrees can you move the camera down.")]
|
||||
public float minPitch = -80.0f;
|
||||
[Tooltip("How far in degrees can you move the camera up.")]
|
||||
public float maxPitch = 80.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Current movement input values.
|
||||
/// </summary>
|
||||
|
||||
private Vector2 _movementInput;
|
||||
|
||||
/// <summary>
|
||||
/// Current look input values.
|
||||
/// </summary>
|
||||
|
||||
private Vector2 _lookInput;
|
||||
|
||||
/// <summary>
|
||||
/// Movement InputAction event handler.
|
||||
/// </summary>
|
||||
|
||||
public void OnMove(InputAction.CallbackContext context)
|
||||
{
|
||||
_movementInput = context.ReadValue<Vector2>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Look InputAction event handler.
|
||||
/// </summary>
|
||||
|
||||
public void OnLook(InputAction.CallbackContext context)
|
||||
{
|
||||
_lookInput = context.ReadValue<Vector2>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Jump InputAction event handler.
|
||||
/// </summary>
|
||||
|
||||
public void OnJump(InputAction.CallbackContext context)
|
||||
{
|
||||
if (context.started)
|
||||
_character.Jump();
|
||||
else if (context.canceled)
|
||||
_character.StopJumping();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Crouch InputAction event handler.
|
||||
/// </summary>
|
||||
|
||||
public void OnCrouch(InputAction.CallbackContext context)
|
||||
{
|
||||
if (context.started)
|
||||
_character.Crouch();
|
||||
else if (context.canceled)
|
||||
_character.UnCrouch();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle polled input here (ie: movement, look, etc.)
|
||||
/// </summary>
|
||||
|
||||
protected virtual void HandleInput()
|
||||
{
|
||||
// Move
|
||||
|
||||
Vector3 movementDirection = Vector3.zero;
|
||||
|
||||
movementDirection += Vector3.forward * _movementInput.y;
|
||||
movementDirection += Vector3.right * _movementInput.x;
|
||||
|
||||
movementDirection = movementDirection.relativeTo(_character.cameraTransform, _character.GetUpVector());
|
||||
|
||||
_character.SetMovementDirection(movementDirection);
|
||||
|
||||
// Look
|
||||
|
||||
Vector2 lookInput = _lookInput * sensitivity;
|
||||
|
||||
_character.AddControlYawInput(lookInput.x);
|
||||
_character.AddControlPitchInput(invertLook ? -lookInput.y : lookInput.y, minPitch, maxPitch);
|
||||
}
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
// If character not assigned, attempts to cache from this current GameObject
|
||||
|
||||
if (_character == null)
|
||||
_character = GetComponent<FirstPersonCharacter>();
|
||||
}
|
||||
|
||||
protected virtual void Start()
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
}
|
||||
|
||||
protected virtual void Update()
|
||||
{
|
||||
HandleInput();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ed2487effc9e92479c5b2bb14904e09
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e69e7a765c2d6ab449adca049fb66006
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f6506b82daa82348be14fb6c81c641a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36e521298f3f4884caf7d4e3cca0e81e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,156 +0,0 @@
|
||||
using ECM2.Examples.ThirdPerson;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace ECM2.Walkthrough.Ex25
|
||||
{
|
||||
/// <summary>
|
||||
/// This example shows how to make use of the new Input System,
|
||||
/// in particular, the PlayerInput component to control a Third Person Character.
|
||||
///
|
||||
/// These handlers are updated and managed by the PlayerInput component.
|
||||
/// </summary>
|
||||
///
|
||||
public class ThirdPersonInput : MonoBehaviour
|
||||
{
|
||||
[Tooltip("Character to be controlled.\n" +
|
||||
"If not assigned, this will look into this GameObject.")]
|
||||
[SerializeField]
|
||||
private ThirdPersonCharacter _character;
|
||||
|
||||
[Space(15.0f)]
|
||||
public bool invertLook = true;
|
||||
|
||||
[FormerlySerializedAs("sensitivity")] [Tooltip("Look sensitivity")]
|
||||
public Vector2 lookSensitivity = new Vector2(0.05f, 0.05f);
|
||||
|
||||
[Tooltip("Zoom Sensitivity")]
|
||||
public float zoomSensitivity = 1.0f;
|
||||
|
||||
[Space(15.0f)]
|
||||
[Tooltip("How far in degrees can you move the camera down.")]
|
||||
public float minPitch = -80.0f;
|
||||
|
||||
[Tooltip("How far in degrees can you move the camera up.")]
|
||||
public float maxPitch = 80.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Current movement input values.
|
||||
/// </summary>
|
||||
|
||||
private Vector2 _movementInput;
|
||||
|
||||
/// <summary>
|
||||
/// Current look input values.
|
||||
/// </summary>
|
||||
|
||||
private Vector2 _lookInput;
|
||||
|
||||
/// <summary>
|
||||
/// Current look input values.
|
||||
/// </summary>
|
||||
|
||||
private Vector2 _zoomInput;
|
||||
|
||||
/// <summary>
|
||||
/// Movement InputAction event handler.
|
||||
/// </summary>
|
||||
|
||||
public void OnMove(InputAction.CallbackContext context)
|
||||
{
|
||||
_movementInput = context.ReadValue<Vector2>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Look InputAction event handler.
|
||||
/// </summary>
|
||||
|
||||
public void OnLook(InputAction.CallbackContext context)
|
||||
{
|
||||
_lookInput = context.ReadValue<Vector2>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Zoom InputAction event handler.
|
||||
/// </summary>
|
||||
|
||||
public void OnZoom(InputAction.CallbackContext context)
|
||||
{
|
||||
_zoomInput = context.ReadValue<Vector2>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Jump InputAction event handler.
|
||||
/// </summary>
|
||||
|
||||
public void OnJump(InputAction.CallbackContext context)
|
||||
{
|
||||
if (context.started)
|
||||
_character.Jump();
|
||||
else if (context.canceled)
|
||||
_character.StopJumping();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Crouch InputAction event handler.
|
||||
/// </summary>
|
||||
|
||||
public void OnCrouch(InputAction.CallbackContext context)
|
||||
{
|
||||
if (context.started)
|
||||
_character.Crouch();
|
||||
else if (context.canceled)
|
||||
_character.UnCrouch();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle polled input here (ie: movement, look, etc.)
|
||||
/// </summary>
|
||||
|
||||
protected virtual void HandleInput()
|
||||
{
|
||||
// Move
|
||||
|
||||
Vector3 movementDirection = Vector3.zero;
|
||||
|
||||
movementDirection += Vector3.right * _movementInput.x;
|
||||
movementDirection += Vector3.forward * _movementInput.y;
|
||||
|
||||
if (_character.cameraTransform)
|
||||
movementDirection = movementDirection.relativeTo(_character.cameraTransform, _character.GetUpVector());
|
||||
|
||||
_character.SetMovementDirection(movementDirection);
|
||||
|
||||
// Look
|
||||
|
||||
Vector2 lookInput = _lookInput * lookSensitivity;
|
||||
|
||||
_character.AddControlYawInput(lookInput.x);
|
||||
_character.AddControlPitchInput(invertLook ? -lookInput.y : lookInput.y, minPitch, maxPitch);
|
||||
|
||||
// Zoom
|
||||
|
||||
Vector2 zoomInput = _zoomInput * zoomSensitivity;
|
||||
_character.AddControlZoomInput(zoomInput.y);
|
||||
}
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
// If character not assigned, attempts to cache from this current GameObject
|
||||
|
||||
if (_character == null)
|
||||
_character = GetComponent<ThirdPersonCharacter>();
|
||||
}
|
||||
|
||||
protected virtual void Start()
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
}
|
||||
|
||||
protected virtual void Update()
|
||||
{
|
||||
HandleInput();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6baa13809475a0b4e8c754503a48fcd6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user