added: tools for changing camera settings, and camera settings processor
This commit is contained in:
@@ -1,49 +1,9 @@
|
||||
using NodeCanvas.Framework;
|
||||
using NodeCanvas.Tasks.Actions;
|
||||
using ParadoxNotion.Design;
|
||||
using Sirenix.OdinInspector;
|
||||
using Unity.Cinemachine;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
// TODO: Move this outta here but I don't know where to. Future organization task? There's also a shitty method down below in OnInit that calls this for every single instance of Change Camera Settings.
|
||||
public static class OriginalCameraSettings{
|
||||
public static float orbitFollowTopHeight;
|
||||
public static float orbitFollowTopRadius;
|
||||
public static float orbitFollowCenterHeight;
|
||||
public static float orbitFollowCenterRadius;
|
||||
public static float orbitFollowBottomHeight;
|
||||
public static float orbitFollowBottomRadius;
|
||||
|
||||
public static Vector2 rotCompScreenPosition;
|
||||
|
||||
public static bool valuesSaved;
|
||||
|
||||
[InitializeOnEnterPlayMode]
|
||||
public static void OnEnterPlaymodeInEditor(){
|
||||
// Unity Play Mode contingency
|
||||
valuesSaved = false;
|
||||
}
|
||||
|
||||
public static void StashCameraOriginalSettings(GameObject cinemachine){
|
||||
if (valuesSaved == false) {
|
||||
CinemachineOrbitalFollow orbit = cinemachine.GetComponent<CinemachineOrbitalFollow>();
|
||||
|
||||
orbitFollowTopHeight = orbit.Orbits.Top.Height;
|
||||
orbitFollowTopRadius = orbit.Orbits.Top.Radius;
|
||||
orbitFollowCenterHeight = orbit.Orbits.Center.Height;
|
||||
orbitFollowCenterRadius = orbit.Orbits.Center.Radius;
|
||||
orbitFollowBottomHeight = orbit.Orbits.Bottom.Height;
|
||||
orbitFollowBottomRadius = orbit.Orbits.Bottom.Radius;
|
||||
|
||||
CinemachineRotationComposer rotComp = cinemachine.GetComponent<CinemachineRotationComposer>();
|
||||
rotCompScreenPosition = rotComp.Composition.ScreenPosition;
|
||||
|
||||
valuesSaved = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Individual bool setting for each ring. Three of these will be used.
|
||||
public struct OrbitalFollowValueGroup{
|
||||
public string label;
|
||||
@@ -63,16 +23,98 @@ public struct OrbitalFollowValueGroup{
|
||||
}
|
||||
}
|
||||
|
||||
// Setting for any X and Y based values
|
||||
public struct CinemachineVectorValueGroup{
|
||||
public CameraSettingsToggle changeX;
|
||||
public float xValue;
|
||||
public CameraSettingsToggle changeY;
|
||||
public float yValue;
|
||||
}
|
||||
|
||||
// Enum options for individual camera settings
|
||||
public enum CameraSettingsToggle{
|
||||
NoChange,
|
||||
NewValue,
|
||||
ResetValue
|
||||
ResetValue,
|
||||
}
|
||||
|
||||
public struct Vector2CameraValueGroup{
|
||||
public string label;
|
||||
public Vector2 newValue;
|
||||
|
||||
public CameraSettingsToggle changeX;
|
||||
public CameraSettingsToggle changeY;
|
||||
|
||||
public Vector2CameraValueGroup(string newLabel){
|
||||
changeX = CameraSettingsToggle.NoChange;
|
||||
changeY = CameraSettingsToggle.NoChange;
|
||||
|
||||
newValue = Vector2.zero;
|
||||
label = newLabel;
|
||||
}
|
||||
}
|
||||
|
||||
public class Vector2CameraValueGroupDrawer : ObjectDrawer<Vector2CameraValueGroup> {
|
||||
public override Vector2CameraValueGroup OnGUI(GUIContent _content, Vector2CameraValueGroup _instance){
|
||||
// Remove label for floats
|
||||
EditorGUIUtility.labelWidth = 50;
|
||||
|
||||
// Set layout options for the label and the float fields
|
||||
GUILayoutOption[] floatOptions = new GUILayoutOption[] {
|
||||
GUILayout.Width(300.0f),
|
||||
GUILayout.MinWidth(20.0f),
|
||||
GUILayout.ExpandWidth(true),
|
||||
};
|
||||
|
||||
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
|
||||
GUILayout.Width(200.0f),
|
||||
};
|
||||
|
||||
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Label(_instance.ToString(), labelOptions);
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
// Create the x settings enum
|
||||
_instance.changeX = (CameraSettingsToggle)EditorGUILayout.EnumPopup("", instance.changeX);
|
||||
|
||||
// Create the value/disabled information field
|
||||
if (_instance.changeX == CameraSettingsToggle.NewValue){
|
||||
_instance.newValue.x = EditorGUILayout.FloatField(_instance.newValue.x, floatOptions);
|
||||
} else {
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
EditorGUILayout.TextField(_instance.changeX == CameraSettingsToggle.NoChange ? "Unchanged" : "Reset", floatOptions);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
// It do what it do.
|
||||
GUILayout.Space(5);
|
||||
|
||||
// Create the y settings enum
|
||||
_instance.changeY = (CameraSettingsToggle)EditorGUILayout.EnumPopup("", _instance.changeY);
|
||||
|
||||
// Create the value/disabled information field
|
||||
if (_instance.changeY == CameraSettingsToggle.NewValue){
|
||||
_instance.newValue.y = EditorGUILayout.FloatField(_instance.newValue.y, floatOptions);
|
||||
} else {
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
EditorGUILayout.TextField(_instance.changeY == CameraSettingsToggle.NoChange ? "Unchanged" : "Reset", floatOptions);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
// Close this line up
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.EndVertical();
|
||||
|
||||
// Reset to default so the rest of things don't get messed up
|
||||
EditorGUIUtility.labelWidth = 0;
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
// Custom editor for each orbital follow ring setting
|
||||
public class OrbitalFollowValueGroupDrawer : ObjectDrawer<OrbitalFollowValueGroup>{
|
||||
public override OrbitalFollowValueGroup OnGUI(GUIContent content, OrbitalFollowValueGroup instance){
|
||||
public override OrbitalFollowValueGroup OnGUI(GUIContent _content, OrbitalFollowValueGroup _instance){
|
||||
// Remove label for floats
|
||||
EditorGUIUtility.labelWidth = 1;
|
||||
|
||||
@@ -91,17 +133,17 @@ public class OrbitalFollowValueGroupDrawer : ObjectDrawer<OrbitalFollowValueGrou
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
// Add the left side label
|
||||
GUILayout.Label(instance.label, labelOptions);
|
||||
GUILayout.Label(_instance.label, labelOptions);
|
||||
|
||||
// Create the height settings enum
|
||||
instance.changeHeight = (CameraSettingsToggle)EditorGUILayout.EnumPopup("", instance.changeHeight);
|
||||
_instance.changeHeight = (CameraSettingsToggle)EditorGUILayout.EnumPopup("", _instance.changeHeight);
|
||||
|
||||
// Create the value/disabled information field
|
||||
if (instance.changeHeight == CameraSettingsToggle.NewValue){
|
||||
instance.height = EditorGUILayout.FloatField(instance.height, floatOptions);
|
||||
if (_instance.changeHeight == CameraSettingsToggle.NewValue){
|
||||
_instance.height = EditorGUILayout.FloatField(_instance.height, floatOptions);
|
||||
} else {
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
EditorGUILayout.TextField(instance.changeHeight == CameraSettingsToggle.NoChange ? "Unchanged" : "Reset", floatOptions);
|
||||
EditorGUILayout.TextField(_instance.changeHeight == CameraSettingsToggle.NoChange ? "Unchanged" : "Reset", floatOptions);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
@@ -109,14 +151,14 @@ public class OrbitalFollowValueGroupDrawer : ObjectDrawer<OrbitalFollowValueGrou
|
||||
GUILayout.Space(5);
|
||||
|
||||
// Create the radius settings enum
|
||||
instance.changeRadius = (CameraSettingsToggle)EditorGUILayout.EnumPopup("", instance.changeRadius);
|
||||
_instance.changeRadius = (CameraSettingsToggle)EditorGUILayout.EnumPopup("", _instance.changeRadius);
|
||||
|
||||
// Create the value/disabled information field
|
||||
if (instance.changeRadius == CameraSettingsToggle.NewValue){
|
||||
instance.radius = EditorGUILayout.FloatField(instance.radius, floatOptions);
|
||||
if (_instance.changeRadius == CameraSettingsToggle.NewValue){
|
||||
_instance.radius = EditorGUILayout.FloatField(_instance.radius, floatOptions);
|
||||
} else {
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
EditorGUILayout.TextField(instance.changeRadius == CameraSettingsToggle.NoChange ? "Unchanged" : "Reset", floatOptions);
|
||||
EditorGUILayout.TextField(_instance.changeRadius == CameraSettingsToggle.NoChange ? "Unchanged" : "Reset", floatOptions);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
@@ -125,44 +167,27 @@ public class OrbitalFollowValueGroupDrawer : ObjectDrawer<OrbitalFollowValueGrou
|
||||
|
||||
// Reset to default so the rest of things don't get messed up
|
||||
EditorGUIUtility.labelWidth = 0;
|
||||
return instance;
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions {
|
||||
|
||||
[Category("Reset")]
|
||||
[Description("Change Cinemachine camera settings for the player")]
|
||||
public class ChangeCameraSettings : ActionTask{
|
||||
public BBParameter<GameObject> cinemachine;
|
||||
[Space(5)]
|
||||
|
||||
[ParadoxNotion.Design.Header("Orbit Follow Ring Settings")]
|
||||
public OrbitalFollowValueGroup orbitFollowTop = new OrbitalFollowValueGroup(newLabel: "Top");
|
||||
public OrbitalFollowValueGroup orbitFollowCenter = new OrbitalFollowValueGroup(newLabel: "Center");
|
||||
public OrbitalFollowValueGroup orbitFollowBottom = new OrbitalFollowValueGroup(newLabel: "Bottom");
|
||||
|
||||
|
||||
[ParadoxNotion.Design.Header("Rotation Composer Settings")]
|
||||
public bool changeScreenPosition;
|
||||
[HideLabel]
|
||||
public Vector2 screenPosition;
|
||||
public Vector2CameraValueGroup screenPosition = new Vector2CameraValueGroup(newLabel: "Screen Position");
|
||||
|
||||
private CinemachineOrbitalFollow orbitalFollow;
|
||||
|
||||
//Use for initialization. This is called only once in the lifetime of the task.
|
||||
//Return null if init was successfull. Return an error string otherwise
|
||||
protected override string OnInit(){
|
||||
// Check if cinemachine is referenced
|
||||
try {
|
||||
orbitalFollow = cinemachine.value.GetComponent<CinemachineOrbitalFollow>();
|
||||
} catch {
|
||||
Debug.LogError("Couldn't grab all references from the camera?");
|
||||
EndAction(false);
|
||||
}
|
||||
|
||||
// Save em.
|
||||
OriginalCameraSettings.StashCameraOriginalSettings(cinemachine.value);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -173,55 +198,81 @@ namespace NodeCanvas.Tasks.Actions {
|
||||
// Switch case farm for checking if values should be changed and what to
|
||||
switch (orbitFollowTop.changeHeight) {
|
||||
case CameraSettingsToggle.NewValue:
|
||||
orbitalFollow.Orbits.Top.Height = orbitFollowTop.height;
|
||||
CameraSettingsProcessor.values.orbitFollowTopHeight.targetValue = orbitFollowTop.height;
|
||||
break;
|
||||
case CameraSettingsToggle.ResetValue:
|
||||
orbitalFollow.Orbits.Top.Height = OriginalCameraSettings.orbitFollowTopHeight;
|
||||
CameraSettingsProcessor.values.orbitFollowTopHeight.Reset();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (orbitFollowTop.changeRadius) {
|
||||
case CameraSettingsToggle.NewValue:
|
||||
orbitalFollow.Orbits.Top.Radius = orbitFollowTop.radius;
|
||||
CameraSettingsProcessor.values.orbitFollowTopRadius.targetValue = orbitFollowTop.radius;
|
||||
break;
|
||||
case CameraSettingsToggle.ResetValue:
|
||||
orbitalFollow.Orbits.Top.Radius = OriginalCameraSettings.orbitFollowTopRadius;
|
||||
CameraSettingsProcessor.values.orbitFollowTopRadius.Reset();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (orbitFollowCenter.changeHeight) {
|
||||
case CameraSettingsToggle.NewValue:
|
||||
orbitalFollow.Orbits.Center.Height = orbitFollowCenter.height;
|
||||
CameraSettingsProcessor.values.orbitFollowCenterHeight.targetValue = orbitFollowCenter.height;
|
||||
break;
|
||||
case CameraSettingsToggle.ResetValue:
|
||||
orbitalFollow.Orbits.Center.Height = OriginalCameraSettings.orbitFollowCenterHeight;
|
||||
CameraSettingsProcessor.values.orbitFollowCenterHeight.Reset();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (orbitFollowCenter.changeRadius) {
|
||||
case CameraSettingsToggle.NewValue:
|
||||
orbitalFollow.Orbits.Center.Radius = orbitFollowCenter.radius;
|
||||
CameraSettingsProcessor.values.orbitFollowCenterRadius.targetValue = orbitFollowCenter.radius;
|
||||
break;
|
||||
case CameraSettingsToggle.ResetValue:
|
||||
orbitalFollow.Orbits.Center.Radius = OriginalCameraSettings.orbitFollowCenterRadius;
|
||||
CameraSettingsProcessor.values.orbitFollowCenterRadius.Reset();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (orbitFollowBottom.changeHeight) {
|
||||
case CameraSettingsToggle.NewValue:
|
||||
orbitalFollow.Orbits.Bottom.Height = orbitFollowBottom.height;
|
||||
CameraSettingsProcessor.values.orbitFollowBottomHeight.targetValue = orbitFollowBottom.height;
|
||||
break;
|
||||
case CameraSettingsToggle.ResetValue:
|
||||
orbitalFollow.Orbits.Bottom.Height = OriginalCameraSettings.orbitFollowBottomHeight;
|
||||
CameraSettingsProcessor.values.orbitFollowBottomHeight.Reset();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (orbitFollowBottom.changeRadius) {
|
||||
case CameraSettingsToggle.NewValue:
|
||||
orbitalFollow.Orbits.Bottom.Radius = orbitFollowBottom.radius;
|
||||
CameraSettingsProcessor.values.orbitFollowBottomRadius.targetValue = orbitFollowBottom.radius;
|
||||
break;
|
||||
case CameraSettingsToggle.ResetValue:
|
||||
orbitalFollow.Orbits.Bottom.Radius = OriginalCameraSettings.orbitFollowBottomRadius;
|
||||
CameraSettingsProcessor.values.orbitFollowBottomRadius.Reset();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (screenPosition.changeX) {
|
||||
case CameraSettingsToggle.NewValue:
|
||||
CameraSettingsProcessor.values.rotationComposerScreenPos.targetValue = new Vector2(
|
||||
screenPosition.newValue.x,
|
||||
CameraSettingsProcessor.values.rotationComposerScreenPos.originalValue.y);
|
||||
break;
|
||||
case CameraSettingsToggle.ResetValue:
|
||||
CameraSettingsProcessor.values.rotationComposerScreenPos.targetValue = new Vector2(
|
||||
CameraSettingsProcessor.values.rotationComposerScreenPos.originalValue.x,
|
||||
CameraSettingsProcessor.values.rotationComposerScreenPos.originalValue.y);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (screenPosition.changeY) {
|
||||
case CameraSettingsToggle.NewValue:
|
||||
CameraSettingsProcessor.values.rotationComposerScreenPos.targetValue = new Vector2(
|
||||
CameraSettingsProcessor.values.rotationComposerScreenPos.originalValue.x,
|
||||
screenPosition.newValue.y);
|
||||
break;
|
||||
case CameraSettingsToggle.ResetValue:
|
||||
CameraSettingsProcessor.values.rotationComposerScreenPos.targetValue = new Vector2(
|
||||
CameraSettingsProcessor.values.rotationComposerScreenPos.originalValue.x,
|
||||
CameraSettingsProcessor.values.rotationComposerScreenPos.originalValue.y);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
128
Assets/Scripts/Player/CameraSettingsProcessor.cs
Normal file
128
Assets/Scripts/Player/CameraSettingsProcessor.cs
Normal file
@@ -0,0 +1,128 @@
|
||||
using Unity.Cinemachine;
|
||||
using UnityEngine;
|
||||
|
||||
public struct CameraSettingSingleValue<T>{
|
||||
// NOTE: Could add a locked variable here if needed??
|
||||
public T originalValue;
|
||||
public T targetValue;
|
||||
public float smoothing;
|
||||
|
||||
public float velocityRef;
|
||||
public Vector2 velocityRefV2;
|
||||
|
||||
public CameraSettingSingleValue(float defaultSmoothing, T original = default(T)){
|
||||
originalValue = original;
|
||||
targetValue = default(T);
|
||||
smoothing = defaultSmoothing;
|
||||
|
||||
velocityRef = 0;
|
||||
velocityRefV2 = default;
|
||||
}
|
||||
|
||||
public void Reset(){
|
||||
targetValue = originalValue;
|
||||
}
|
||||
}
|
||||
|
||||
public struct CameraSettingValues{
|
||||
public CameraSettingSingleValue<float> orbitFollowTopHeight;
|
||||
public CameraSettingSingleValue<float> orbitFollowTopRadius;
|
||||
public CameraSettingSingleValue<float> orbitFollowCenterHeight;
|
||||
public CameraSettingSingleValue<float> orbitFollowCenterRadius;
|
||||
public CameraSettingSingleValue<float> orbitFollowBottomHeight;
|
||||
public CameraSettingSingleValue<float> orbitFollowBottomRadius;
|
||||
|
||||
public CameraSettingSingleValue<Vector2> rotationComposerScreenPos;
|
||||
|
||||
public CameraSettingValues(float defaultSmoothing){
|
||||
orbitFollowTopHeight = new CameraSettingSingleValue<float>(defaultSmoothing);
|
||||
orbitFollowTopRadius = new CameraSettingSingleValue<float>(defaultSmoothing);
|
||||
orbitFollowCenterHeight = new CameraSettingSingleValue<float>(defaultSmoothing);
|
||||
orbitFollowCenterRadius = new CameraSettingSingleValue<float>(defaultSmoothing);
|
||||
orbitFollowBottomHeight = new CameraSettingSingleValue<float>(defaultSmoothing);
|
||||
orbitFollowBottomRadius = new CameraSettingSingleValue<float>(defaultSmoothing);
|
||||
|
||||
rotationComposerScreenPos = new CameraSettingSingleValue<Vector2>(defaultSmoothing);
|
||||
}
|
||||
}
|
||||
|
||||
public class CameraSettingsProcessor : MonoBehaviour{
|
||||
public static CameraSettingsProcessor Instance{ get; private set; }
|
||||
|
||||
public static CameraSettingValues values = new(defaultSmoothing: .2f);
|
||||
|
||||
public static GameObject mainCamera;
|
||||
|
||||
private CinemachineOrbitalFollow orbit;
|
||||
private CinemachineRotationComposer rotComp;
|
||||
|
||||
public void Awake(){
|
||||
if (Instance != null && Instance != this) {
|
||||
Destroy(this);
|
||||
} else {
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
mainCamera = gameObject;
|
||||
orbit = mainCamera.GetComponent<CinemachineOrbitalFollow>();
|
||||
rotComp = mainCamera.GetComponent<CinemachineRotationComposer>();
|
||||
|
||||
StashCameraOriginalSettings(this);
|
||||
SetTargetsToOriginalValues(this);
|
||||
}
|
||||
|
||||
public static void StashCameraOriginalSettings(CameraSettingsProcessor settings){
|
||||
values.orbitFollowTopHeight.originalValue = settings.orbit.Orbits.Top.Height;
|
||||
values.orbitFollowTopRadius.originalValue = settings.orbit.Orbits.Top.Radius;
|
||||
values.orbitFollowCenterHeight.originalValue = settings.orbit.Orbits.Center.Height;
|
||||
values.orbitFollowCenterRadius.originalValue = settings.orbit.Orbits.Center.Radius;
|
||||
values.orbitFollowBottomHeight.originalValue = settings.orbit.Orbits.Bottom.Height;
|
||||
values.orbitFollowBottomRadius.originalValue = settings.orbit.Orbits.Bottom.Radius;
|
||||
|
||||
values.rotationComposerScreenPos.originalValue = settings.rotComp.Composition.ScreenPosition;
|
||||
}
|
||||
|
||||
public static void SetTargetsToOriginalValues(CameraSettingsProcessor settings){
|
||||
values.orbitFollowTopHeight.Reset();
|
||||
values.orbitFollowTopRadius.Reset();
|
||||
values.orbitFollowCenterHeight.Reset();
|
||||
values.orbitFollowCenterRadius.Reset();
|
||||
values.orbitFollowBottomHeight.Reset();
|
||||
values.orbitFollowBottomRadius.Reset();
|
||||
values.rotationComposerScreenPos.Reset();
|
||||
}
|
||||
|
||||
void ProcessCameraValues(){
|
||||
orbit.Orbits.Top.Height = Mathf.SmoothDamp(orbit.Orbits.Top.Height,
|
||||
values.orbitFollowTopHeight.targetValue, ref values.orbitFollowTopHeight.velocityRef,
|
||||
values.orbitFollowTopHeight.smoothing);
|
||||
|
||||
orbit.Orbits.Top.Radius = Mathf.SmoothDamp(orbit.Orbits.Top.Radius,
|
||||
values.orbitFollowTopRadius.targetValue, ref values.orbitFollowTopRadius.velocityRef,
|
||||
values.orbitFollowTopRadius.smoothing);
|
||||
|
||||
orbit.Orbits.Center.Height = Mathf.SmoothDamp(orbit.Orbits.Center.Height,
|
||||
values.orbitFollowCenterHeight.targetValue, ref values.orbitFollowCenterHeight.velocityRef,
|
||||
values.orbitFollowCenterHeight.smoothing);
|
||||
|
||||
orbit.Orbits.Center.Radius = Mathf.SmoothDamp(orbit.Orbits.Center.Radius,
|
||||
values.orbitFollowCenterRadius.targetValue, ref values.orbitFollowCenterRadius.velocityRef,
|
||||
values.orbitFollowCenterRadius.smoothing);
|
||||
|
||||
orbit.Orbits.Bottom.Height = Mathf.SmoothDamp(orbit.Orbits.Bottom.Height,
|
||||
values.orbitFollowBottomHeight.targetValue, ref values.orbitFollowBottomHeight.velocityRef,
|
||||
values.orbitFollowBottomHeight.smoothing);
|
||||
|
||||
orbit.Orbits.Bottom.Radius = Mathf.SmoothDamp(orbit.Orbits.Bottom.Radius,
|
||||
values.orbitFollowBottomRadius.targetValue, ref values.orbitFollowBottomRadius.velocityRef,
|
||||
values.orbitFollowBottomRadius.smoothing);
|
||||
|
||||
rotComp.Composition.ScreenPosition = Vector2.SmoothDamp(rotComp.Composition.ScreenPosition,
|
||||
values.rotationComposerScreenPos.targetValue, ref values.rotationComposerScreenPos.velocityRefV2,
|
||||
values.rotationComposerScreenPos.smoothing);
|
||||
}
|
||||
|
||||
void Update(){
|
||||
ProcessCameraValues();
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Player/CameraSettingsProcessor.cs.meta
Normal file
2
Assets/Scripts/Player/CameraSettingsProcessor.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c032a18b0b0c1da4092bfc365c6e4aad
|
||||
@@ -50,12 +50,11 @@ public class PlayerControls : MonoBehaviour{
|
||||
graph.SendEvent<string>("InputEvent", "CancelLockOn", null);
|
||||
}
|
||||
|
||||
public void OnGrapple(InputInteractionContext context){
|
||||
if (context.control.IsPressed()) {
|
||||
graph.SendEvent<string>("InputEvent", "GrappleDown", null);
|
||||
} else {
|
||||
graph.SendEvent<string>("InputEvent", "GrappleUp", null);
|
||||
}
|
||||
|
||||
}
|
||||
// public void OnGrapple(InputInteractionContext context){
|
||||
// if (context.control.IsPressed()) {
|
||||
// graph.SendEvent<string>("InputEvent", "GrappleDown", null);
|
||||
// } else {
|
||||
// graph.SendEvent<string>("InputEvent", "GrappleUp", null);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user