Added cameracontroller scripts to assemblydef
This commit is contained in:
parent
f7a5778c95
commit
df62312126
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "Entities.Structures",
|
"name": "Entities.Structures",
|
||||||
"rootNamespace": "AsteroidGame",
|
"rootNamespace": "AsteroidGame",
|
||||||
"references": ["GUID:17a5862fcd6383b4b97bad4dcb1e2e5d","GUID:f26d68a0bdefa1043b120b820f55e190"],
|
"references": ["GUID:17a5862fcd6383b4b97bad4dcb1e2e5d","GUID:f26d68a0bdefa1043b120b820f55e190","GUID:896bd127e4aae4c4d86d99385f967c0c"],
|
||||||
"includePlatforms": [],
|
"includePlatforms": [],
|
||||||
"excludePlatforms": [],
|
"excludePlatforms": [],
|
||||||
"allowUnsafeCode": false,
|
"allowUnsafeCode": false,
|
||||||
|
|
|
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: bcf384b154398e341b6b29969c078198, type: 3}
|
m_Script: {fileID: 11500000, guid: bcf384b154398e341b6b29969c078198, type: 3}
|
||||||
m_Name: MotionBlur
|
m_Name: MotionBlur
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
active: 1
|
active: 0
|
||||||
quality:
|
quality:
|
||||||
m_OverrideState: 1
|
m_OverrideState: 1
|
||||||
m_Value: 1
|
m_Value: 1
|
||||||
|
@ -94,7 +94,7 @@ MonoBehaviour:
|
||||||
m_Value: 0.15
|
m_Value: 0.15
|
||||||
m_SampleCount:
|
m_SampleCount:
|
||||||
m_OverrideState: 0
|
m_OverrideState: 0
|
||||||
m_Value: 8
|
m_Value: 10
|
||||||
--- !u!114 &11400000
|
--- !u!114 &11400000
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -250,7 +250,7 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 24f077503be6ae942a1e1245dbd53ea9, type: 3}
|
m_Script: {fileID: 11500000, guid: 24f077503be6ae942a1e1245dbd53ea9, type: 3}
|
||||||
m_Name: Bloom
|
m_Name: Bloom
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
active: 1
|
active: 0
|
||||||
quality:
|
quality:
|
||||||
m_OverrideState: 1
|
m_OverrideState: 1
|
||||||
m_Value: 1
|
m_Value: 1
|
||||||
|
@ -525,10 +525,10 @@ MonoBehaviour:
|
||||||
m_Value: 0
|
m_Value: 0
|
||||||
m_MaximumRadiusInPixels:
|
m_MaximumRadiusInPixels:
|
||||||
m_OverrideState: 0
|
m_OverrideState: 0
|
||||||
m_Value: 32
|
m_Value: 40
|
||||||
m_BilateralUpsample:
|
m_BilateralUpsample:
|
||||||
m_OverrideState: 0
|
m_OverrideState: 0
|
||||||
m_Value: 0
|
m_Value: 1
|
||||||
m_DirectionCount:
|
m_DirectionCount:
|
||||||
m_OverrideState: 0
|
m_OverrideState: 0
|
||||||
m_Value: 2
|
m_Value: 2
|
||||||
|
|
|
@ -15,12 +15,15 @@ using System.Collections.Generic;
|
||||||
using UnityEngine.InputSystem;
|
using UnityEngine.InputSystem;
|
||||||
using UnityEngine.InputSystem.Utilities;
|
using UnityEngine.InputSystem.Utilities;
|
||||||
|
|
||||||
public partial class @CameraControllActions : IInputActionCollection2, IDisposable
|
namespace InputSystem
|
||||||
{
|
{
|
||||||
public InputActionAsset asset { get; }
|
public partial class @CameraControllActions : IInputActionCollection2, IDisposable
|
||||||
public @CameraControllActions()
|
|
||||||
{
|
{
|
||||||
asset = InputActionAsset.FromJson(@"{
|
public InputActionAsset asset { get; }
|
||||||
|
|
||||||
|
public @CameraControllActions()
|
||||||
|
{
|
||||||
|
asset = InputActionAsset.FromJson(@"{
|
||||||
""name"": ""CameraControllActions"",
|
""name"": ""CameraControllActions"",
|
||||||
""maps"": [
|
""maps"": [
|
||||||
{
|
{
|
||||||
|
@ -138,119 +141,149 @@ public partial class @CameraControllActions : IInputActionCollection2, IDisposab
|
||||||
],
|
],
|
||||||
""controlSchemes"": []
|
""controlSchemes"": []
|
||||||
}");
|
}");
|
||||||
// Camera
|
// Camera
|
||||||
m_Camera = asset.FindActionMap("Camera", throwIfNotFound: true);
|
m_Camera = asset.FindActionMap("Camera", throwIfNotFound: true);
|
||||||
m_Camera_Movement = m_Camera.FindAction("Movement", throwIfNotFound: true);
|
m_Camera_Movement = m_Camera.FindAction("Movement", throwIfNotFound: true);
|
||||||
m_Camera_RotateCamera = m_Camera.FindAction("RotateCamera", throwIfNotFound: true);
|
m_Camera_RotateCamera = m_Camera.FindAction("RotateCamera", throwIfNotFound: true);
|
||||||
m_Camera_ZoomCamera = m_Camera.FindAction("ZoomCamera", throwIfNotFound: true);
|
m_Camera_ZoomCamera = m_Camera.FindAction("ZoomCamera", throwIfNotFound: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
|
||||||
UnityEngine.Object.Destroy(asset);
|
|
||||||
}
|
|
||||||
|
|
||||||
public InputBinding? bindingMask
|
|
||||||
{
|
|
||||||
get => asset.bindingMask;
|
|
||||||
set => asset.bindingMask = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReadOnlyArray<InputDevice>? devices
|
|
||||||
{
|
|
||||||
get => asset.devices;
|
|
||||||
set => asset.devices = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
|
|
||||||
|
|
||||||
public bool Contains(InputAction action)
|
|
||||||
{
|
|
||||||
return asset.Contains(action);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerator<InputAction> GetEnumerator()
|
|
||||||
{
|
|
||||||
return asset.GetEnumerator();
|
|
||||||
}
|
|
||||||
|
|
||||||
IEnumerator IEnumerable.GetEnumerator()
|
|
||||||
{
|
|
||||||
return GetEnumerator();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Enable()
|
|
||||||
{
|
|
||||||
asset.Enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Disable()
|
|
||||||
{
|
|
||||||
asset.Disable();
|
|
||||||
}
|
|
||||||
public IEnumerable<InputBinding> bindings => asset.bindings;
|
|
||||||
|
|
||||||
public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
|
|
||||||
{
|
|
||||||
return asset.FindAction(actionNameOrId, throwIfNotFound);
|
|
||||||
}
|
|
||||||
public int FindBinding(InputBinding bindingMask, out InputAction action)
|
|
||||||
{
|
|
||||||
return asset.FindBinding(bindingMask, out action);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Camera
|
|
||||||
private readonly InputActionMap m_Camera;
|
|
||||||
private ICameraActions m_CameraActionsCallbackInterface;
|
|
||||||
private readonly InputAction m_Camera_Movement;
|
|
||||||
private readonly InputAction m_Camera_RotateCamera;
|
|
||||||
private readonly InputAction m_Camera_ZoomCamera;
|
|
||||||
public struct CameraActions
|
|
||||||
{
|
|
||||||
private @CameraControllActions m_Wrapper;
|
|
||||||
public CameraActions(@CameraControllActions wrapper) { m_Wrapper = wrapper; }
|
|
||||||
public InputAction @Movement => m_Wrapper.m_Camera_Movement;
|
|
||||||
public InputAction @RotateCamera => m_Wrapper.m_Camera_RotateCamera;
|
|
||||||
public InputAction @ZoomCamera => m_Wrapper.m_Camera_ZoomCamera;
|
|
||||||
public InputActionMap Get() { return m_Wrapper.m_Camera; }
|
|
||||||
public void Enable() { Get().Enable(); }
|
|
||||||
public void Disable() { Get().Disable(); }
|
|
||||||
public bool enabled => Get().enabled;
|
|
||||||
public static implicit operator InputActionMap(CameraActions set) { return set.Get(); }
|
|
||||||
public void SetCallbacks(ICameraActions instance)
|
|
||||||
{
|
{
|
||||||
if (m_Wrapper.m_CameraActionsCallbackInterface != null)
|
UnityEngine.Object.Destroy(asset);
|
||||||
|
}
|
||||||
|
|
||||||
|
public InputBinding? bindingMask
|
||||||
|
{
|
||||||
|
get => asset.bindingMask;
|
||||||
|
set => asset.bindingMask = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReadOnlyArray<InputDevice>? devices
|
||||||
|
{
|
||||||
|
get => asset.devices;
|
||||||
|
set => asset.devices = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
|
||||||
|
|
||||||
|
public bool Contains(InputAction action)
|
||||||
|
{
|
||||||
|
return asset.Contains(action);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerator<InputAction> GetEnumerator()
|
||||||
|
{
|
||||||
|
return asset.GetEnumerator();
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerator IEnumerable.GetEnumerator()
|
||||||
|
{
|
||||||
|
return GetEnumerator();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Enable()
|
||||||
|
{
|
||||||
|
asset.Enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Disable()
|
||||||
|
{
|
||||||
|
asset.Disable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<InputBinding> bindings => asset.bindings;
|
||||||
|
|
||||||
|
public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
|
||||||
|
{
|
||||||
|
return asset.FindAction(actionNameOrId, throwIfNotFound);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int FindBinding(InputBinding bindingMask, out InputAction action)
|
||||||
|
{
|
||||||
|
return asset.FindBinding(bindingMask, out action);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Camera
|
||||||
|
private readonly InputActionMap m_Camera;
|
||||||
|
private ICameraActions m_CameraActionsCallbackInterface;
|
||||||
|
private readonly InputAction m_Camera_Movement;
|
||||||
|
private readonly InputAction m_Camera_RotateCamera;
|
||||||
|
private readonly InputAction m_Camera_ZoomCamera;
|
||||||
|
|
||||||
|
public struct CameraActions
|
||||||
|
{
|
||||||
|
private @CameraControllActions m_Wrapper;
|
||||||
|
|
||||||
|
public CameraActions(@CameraControllActions wrapper)
|
||||||
{
|
{
|
||||||
@Movement.started -= m_Wrapper.m_CameraActionsCallbackInterface.OnMovement;
|
m_Wrapper = wrapper;
|
||||||
@Movement.performed -= m_Wrapper.m_CameraActionsCallbackInterface.OnMovement;
|
|
||||||
@Movement.canceled -= m_Wrapper.m_CameraActionsCallbackInterface.OnMovement;
|
|
||||||
@RotateCamera.started -= m_Wrapper.m_CameraActionsCallbackInterface.OnRotateCamera;
|
|
||||||
@RotateCamera.performed -= m_Wrapper.m_CameraActionsCallbackInterface.OnRotateCamera;
|
|
||||||
@RotateCamera.canceled -= m_Wrapper.m_CameraActionsCallbackInterface.OnRotateCamera;
|
|
||||||
@ZoomCamera.started -= m_Wrapper.m_CameraActionsCallbackInterface.OnZoomCamera;
|
|
||||||
@ZoomCamera.performed -= m_Wrapper.m_CameraActionsCallbackInterface.OnZoomCamera;
|
|
||||||
@ZoomCamera.canceled -= m_Wrapper.m_CameraActionsCallbackInterface.OnZoomCamera;
|
|
||||||
}
|
}
|
||||||
m_Wrapper.m_CameraActionsCallbackInterface = instance;
|
|
||||||
if (instance != null)
|
public InputAction @Movement => m_Wrapper.m_Camera_Movement;
|
||||||
|
public InputAction @RotateCamera => m_Wrapper.m_Camera_RotateCamera;
|
||||||
|
public InputAction @ZoomCamera => m_Wrapper.m_Camera_ZoomCamera;
|
||||||
|
|
||||||
|
public InputActionMap Get()
|
||||||
{
|
{
|
||||||
@Movement.started += instance.OnMovement;
|
return m_Wrapper.m_Camera;
|
||||||
@Movement.performed += instance.OnMovement;
|
}
|
||||||
@Movement.canceled += instance.OnMovement;
|
|
||||||
@RotateCamera.started += instance.OnRotateCamera;
|
public void Enable()
|
||||||
@RotateCamera.performed += instance.OnRotateCamera;
|
{
|
||||||
@RotateCamera.canceled += instance.OnRotateCamera;
|
Get().Enable();
|
||||||
@ZoomCamera.started += instance.OnZoomCamera;
|
}
|
||||||
@ZoomCamera.performed += instance.OnZoomCamera;
|
|
||||||
@ZoomCamera.canceled += instance.OnZoomCamera;
|
public void Disable()
|
||||||
|
{
|
||||||
|
Get().Disable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool enabled => Get().enabled;
|
||||||
|
|
||||||
|
public static implicit operator InputActionMap(CameraActions set)
|
||||||
|
{
|
||||||
|
return set.Get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetCallbacks(ICameraActions instance)
|
||||||
|
{
|
||||||
|
if (m_Wrapper.m_CameraActionsCallbackInterface != null)
|
||||||
|
{
|
||||||
|
@Movement.started -= m_Wrapper.m_CameraActionsCallbackInterface.OnMovement;
|
||||||
|
@Movement.performed -= m_Wrapper.m_CameraActionsCallbackInterface.OnMovement;
|
||||||
|
@Movement.canceled -= m_Wrapper.m_CameraActionsCallbackInterface.OnMovement;
|
||||||
|
@RotateCamera.started -= m_Wrapper.m_CameraActionsCallbackInterface.OnRotateCamera;
|
||||||
|
@RotateCamera.performed -= m_Wrapper.m_CameraActionsCallbackInterface.OnRotateCamera;
|
||||||
|
@RotateCamera.canceled -= m_Wrapper.m_CameraActionsCallbackInterface.OnRotateCamera;
|
||||||
|
@ZoomCamera.started -= m_Wrapper.m_CameraActionsCallbackInterface.OnZoomCamera;
|
||||||
|
@ZoomCamera.performed -= m_Wrapper.m_CameraActionsCallbackInterface.OnZoomCamera;
|
||||||
|
@ZoomCamera.canceled -= m_Wrapper.m_CameraActionsCallbackInterface.OnZoomCamera;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_Wrapper.m_CameraActionsCallbackInterface = instance;
|
||||||
|
if (instance != null)
|
||||||
|
{
|
||||||
|
@Movement.started += instance.OnMovement;
|
||||||
|
@Movement.performed += instance.OnMovement;
|
||||||
|
@Movement.canceled += instance.OnMovement;
|
||||||
|
@RotateCamera.started += instance.OnRotateCamera;
|
||||||
|
@RotateCamera.performed += instance.OnRotateCamera;
|
||||||
|
@RotateCamera.canceled += instance.OnRotateCamera;
|
||||||
|
@ZoomCamera.started += instance.OnZoomCamera;
|
||||||
|
@ZoomCamera.performed += instance.OnZoomCamera;
|
||||||
|
@ZoomCamera.canceled += instance.OnZoomCamera;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
public CameraActions @Camera => new CameraActions(this);
|
public CameraActions @Camera => new CameraActions(this);
|
||||||
public interface ICameraActions
|
|
||||||
{
|
public interface ICameraActions
|
||||||
void OnMovement(InputAction.CallbackContext context);
|
{
|
||||||
void OnRotateCamera(InputAction.CallbackContext context);
|
void OnMovement(InputAction.CallbackContext context);
|
||||||
void OnZoomCamera(InputAction.CallbackContext context);
|
void OnRotateCamera(InputAction.CallbackContext context);
|
||||||
|
void OnZoomCamera(InputAction.CallbackContext context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"name": "InputSystem",
|
||||||
|
"rootNamespace": "",
|
||||||
|
"references": [
|
||||||
|
"GUID:75469ad4d38634e559750d17036d5f7c"
|
||||||
|
],
|
||||||
|
"includePlatforms": [],
|
||||||
|
"excludePlatforms": [],
|
||||||
|
"allowUnsafeCode": false,
|
||||||
|
"overrideReferences": false,
|
||||||
|
"precompiledReferences": [],
|
||||||
|
"autoReferenced": true,
|
||||||
|
"defineConstraints": [],
|
||||||
|
"versionDefines": [],
|
||||||
|
"noEngineReferences": false
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f008ecc6829887e478aeb5eb004eb01b
|
||||||
|
AssemblyDefinitionImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -1,7 +1,7 @@
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.InputSystem;
|
using UnityEngine.InputSystem;
|
||||||
|
|
||||||
namespace AsteroidGame.InputSystem
|
namespace InputSystem
|
||||||
{
|
{
|
||||||
public class ReadInputExample : MonoBehaviour
|
public class ReadInputExample : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using System;
|
using InputSystem;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.InputSystem;
|
using UnityEngine.InputSystem;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"name": "Scripts",
|
||||||
|
"rootNamespace": "AsteroidGame",
|
||||||
|
"references": [
|
||||||
|
"GUID:75469ad4d38634e559750d17036d5f7c",
|
||||||
|
"GUID:f008ecc6829887e478aeb5eb004eb01b"
|
||||||
|
],
|
||||||
|
"includePlatforms": [],
|
||||||
|
"excludePlatforms": [],
|
||||||
|
"allowUnsafeCode": false,
|
||||||
|
"overrideReferences": false,
|
||||||
|
"precompiledReferences": [],
|
||||||
|
"autoReferenced": true,
|
||||||
|
"defineConstraints": [],
|
||||||
|
"versionDefines": [],
|
||||||
|
"noEngineReferences": false
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 896bd127e4aae4c4d86d99385f967c0c
|
||||||
|
AssemblyDefinitionImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
Reference in New Issue