change: more alterations to movement, settingvalues, valuegroup, etc.
This commit is contained in:
@@ -1,22 +1,25 @@
|
||||
using System;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Serialization.FullSerializer;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace Reset.Core{
|
||||
[Serializable]
|
||||
public abstract class ValueGroup{
|
||||
public interface ISmoothable{
|
||||
public interface ISmoothable{
|
||||
public BBParameter<ValueChangeAction> changeEasing{ get; set; }
|
||||
public BBParameter<ValueChangeAction> changeSmoothing{ get; set; }
|
||||
|
||||
public BBParameter<float> smoothing { get; set; }
|
||||
public BBParameter<float> easing{ get; set; }
|
||||
public BBParameter<float> Smoothing { get; set; }
|
||||
public BBParameter<float> Easing{ get; set; }
|
||||
}
|
||||
|
||||
public static void ChangeSmoothingEasing(ISmoothable valueGroup, ref float targetSmoothing,
|
||||
ref float targetEasing, ref float defaultSmoothing, ref float defaultEasing){
|
||||
switch (valueGroup.changeSmoothing.value) {
|
||||
case ValueChangeAction.NewValue:
|
||||
targetSmoothing = valueGroup.smoothing.value;
|
||||
targetSmoothing = valueGroup.Smoothing.value;
|
||||
break;
|
||||
case ValueChangeAction.ResetValue:
|
||||
targetSmoothing = defaultSmoothing;
|
||||
@@ -25,7 +28,7 @@ namespace Reset.Core{
|
||||
|
||||
switch (valueGroup.changeEasing.value) {
|
||||
case ValueChangeAction.NewValue:
|
||||
targetEasing = valueGroup.easing.value;
|
||||
targetEasing = valueGroup.Easing.value;
|
||||
break;
|
||||
case ValueChangeAction.ResetValue:
|
||||
targetEasing = defaultEasing;
|
||||
@@ -43,7 +46,7 @@ namespace Reset.Core{
|
||||
}
|
||||
|
||||
// Individual bool setting for each ring. Three of these will be used.
|
||||
public struct OrbitalFollowValueGroup : ValueGroup.ISmoothable{
|
||||
public class OrbitalFollowValueGroup : ValueGroup.ISmoothable{
|
||||
public string label;
|
||||
|
||||
public BBParameter<ValueChangeAction> changeHeight;
|
||||
@@ -52,10 +55,33 @@ namespace Reset.Core{
|
||||
public BBParameter<ValueChangeAction> changeRadius;
|
||||
public BBParameter<float> radius;
|
||||
|
||||
public BBParameter<ValueChangeAction> changeEasing{ get; set; }
|
||||
public BBParameter<ValueChangeAction> changeSmoothing{ get; set; }
|
||||
public BBParameter<float> smoothing{ get; set; }
|
||||
public BBParameter<float> easing{ get; set; }
|
||||
// Smoothing
|
||||
[SerializeField] private BBParameter<ValueChangeAction> _changeSmoothing;
|
||||
[SerializeField] public BBParameter<float> _smoothing;
|
||||
|
||||
public BBParameter<ValueChangeAction> changeSmoothing{
|
||||
get => _changeSmoothing;
|
||||
set => _changeSmoothing = value.value;
|
||||
}
|
||||
|
||||
public BBParameter<float> Smoothing{
|
||||
get => _smoothing;
|
||||
set => _smoothing = value.value;
|
||||
}
|
||||
|
||||
// Easing
|
||||
[SerializeField] private BBParameter<ValueChangeAction> _changeEasing;
|
||||
[SerializeField] public BBParameter<float> _easing;
|
||||
|
||||
public BBParameter<ValueChangeAction> changeEasing{
|
||||
get => _changeEasing;
|
||||
set => _changeEasing = value.value;
|
||||
}
|
||||
|
||||
public BBParameter<float> Easing{
|
||||
get => _easing;
|
||||
set => _easing = value.value;
|
||||
}
|
||||
|
||||
public OrbitalFollowValueGroup(string newLabel){
|
||||
label = newLabel;
|
||||
@@ -64,12 +90,14 @@ namespace Reset.Core{
|
||||
height = 0f;
|
||||
changeRadius = ValueChangeAction.NoChange;
|
||||
radius = 0f;
|
||||
|
||||
changeSmoothing = new BBParameter<ValueChangeAction>();
|
||||
Smoothing = new BBParameter<float>().value = 0f;
|
||||
|
||||
changeSmoothing = ValueChangeAction.NoChange;
|
||||
smoothing = .1f;
|
||||
|
||||
changeEasing = ValueChangeAction.NoChange;
|
||||
easing = 1f;
|
||||
changeEasing = new BBParameter<ValueChangeAction>();
|
||||
Easing = new BBParameter<float>().value = 0f;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void UpdateValue(OrbitalFollowValueGroup valueGroup, ref float targetProperty, ref float defaultProperty){
|
||||
@@ -143,14 +171,46 @@ namespace Reset.Core{
|
||||
}
|
||||
}
|
||||
|
||||
public struct Vector3ValueGroup{ // Done
|
||||
public class Vector3ValueGroup : ValueGroup.ISmoothable{ // Done
|
||||
public string label;
|
||||
|
||||
// Value
|
||||
public BBParameter<Vector3> value;
|
||||
|
||||
public BBParameter<ValueChangeAction> changeX;
|
||||
public BBParameter<ValueChangeAction> changeY;
|
||||
public BBParameter<ValueChangeAction> changeZ;
|
||||
|
||||
|
||||
// Smoothing
|
||||
[SerializeField] private BBParameter<ValueChangeAction> _changeSmoothing;
|
||||
[SerializeField] public BBParameter<float> _smoothing;
|
||||
|
||||
public BBParameter<ValueChangeAction> changeSmoothing{
|
||||
get => _changeSmoothing;
|
||||
set => _changeSmoothing = value.value;
|
||||
}
|
||||
|
||||
public BBParameter<float> Smoothing{
|
||||
get => _smoothing;
|
||||
set => _smoothing = value.value;
|
||||
}
|
||||
|
||||
// Easing
|
||||
[SerializeField] private BBParameter<ValueChangeAction> _changeEasing;
|
||||
[SerializeField] public BBParameter<float> _easing;
|
||||
|
||||
public BBParameter<ValueChangeAction> changeEasing{
|
||||
get => _changeEasing;
|
||||
set => _changeEasing = value.value;
|
||||
}
|
||||
|
||||
public BBParameter<float> Easing{
|
||||
get => _easing;
|
||||
set => _easing = value.value;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
public Vector3ValueGroup(string newLabel){
|
||||
changeX = ValueChangeAction.NoChange;
|
||||
changeY = ValueChangeAction.NoChange;
|
||||
@@ -161,6 +221,12 @@ namespace Reset.Core{
|
||||
};
|
||||
|
||||
label = newLabel;
|
||||
|
||||
changeSmoothing = new BBParameter<ValueChangeAction>();
|
||||
Smoothing = new BBParameter<float>().value = 0f;
|
||||
|
||||
changeEasing = new BBParameter<ValueChangeAction>();
|
||||
Easing = new BBParameter<float>().value = 0f;
|
||||
}
|
||||
|
||||
public static void UpdateValue(Vector3ValueGroup valueGroup, ref Vector3 targetProperty, ref Vector3 defaultProperty){
|
||||
@@ -193,21 +259,47 @@ namespace Reset.Core{
|
||||
}
|
||||
}
|
||||
|
||||
public struct Vector2ValueGroup : ValueGroup.ISmoothable{ // Done
|
||||
[Serializable]
|
||||
public class Vector2ValueGroup : ValueGroup.ISmoothable{ // Done
|
||||
public string label;
|
||||
|
||||
// Value
|
||||
public BBParameter<Vector2> value;
|
||||
|
||||
public BBParameter<ValueChangeAction> changeEasing{ get; set; }
|
||||
public BBParameter<ValueChangeAction> changeSmoothing{ get; set; }
|
||||
public BBParameter<float> smoothing{ get; set; }
|
||||
public BBParameter<float> easing{ get; set; }
|
||||
|
||||
public BBParameter<ValueChangeAction> changeX;
|
||||
public BBParameter<ValueChangeAction> changeY;
|
||||
public BBParameter<ValueChangeAction> changeY;
|
||||
|
||||
// Smoothing
|
||||
[SerializeField] private BBParameter<ValueChangeAction> _changeSmoothing;
|
||||
[SerializeField] public BBParameter<float> _smoothing;
|
||||
|
||||
public BBParameter<ValueChangeAction> changeSmoothing{
|
||||
get => _changeSmoothing;
|
||||
set => _changeSmoothing = value.value;
|
||||
}
|
||||
|
||||
public BBParameter<float> Smoothing{
|
||||
get => _smoothing;
|
||||
set => _smoothing = value.value;
|
||||
}
|
||||
|
||||
// Easing
|
||||
[SerializeField] private BBParameter<ValueChangeAction> _changeEasing;
|
||||
[SerializeField] public BBParameter<float> _easing;
|
||||
|
||||
public BBParameter<ValueChangeAction> changeEasing{
|
||||
get => _changeEasing;
|
||||
set => _changeEasing = value.value;
|
||||
}
|
||||
|
||||
public BBParameter<float> Easing{
|
||||
get => _easing;
|
||||
set => _easing = value.value;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
public Vector2ValueGroup(string newLabel){
|
||||
changeX = ValueChangeAction.NoChange;
|
||||
changeY = ValueChangeAction.NoChange;
|
||||
changeX = new BBParameter<ValueChangeAction>().value = ValueChangeAction.NoChange;
|
||||
changeY = new BBParameter<ValueChangeAction>().value = ValueChangeAction.NoChange;
|
||||
|
||||
value = new BBParameter<Vector2>{
|
||||
value = Vector2.zero
|
||||
@@ -215,10 +307,11 @@ namespace Reset.Core{
|
||||
|
||||
label = newLabel;
|
||||
|
||||
changeEasing = ValueChangeAction.NoChange;
|
||||
changeSmoothing = ValueChangeAction.NoChange;
|
||||
smoothing = 0;
|
||||
easing = 0;
|
||||
changeSmoothing = new BBParameter<ValueChangeAction>();
|
||||
Smoothing = new BBParameter<float>().value = 0f;
|
||||
|
||||
changeEasing = new BBParameter<ValueChangeAction>();
|
||||
Easing = new BBParameter<float>().value = 0f;
|
||||
}
|
||||
|
||||
public static void UpdateValue(Vector2ValueGroup valueGroup, ref Vector2 targetProperty, ref Vector2 defaultProperty){
|
||||
@@ -229,7 +322,6 @@ namespace Reset.Core{
|
||||
case ValueChangeAction.ResetValue:
|
||||
targetProperty.x = defaultProperty.x;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
switch (valueGroup.changeY.value) {
|
||||
@@ -241,32 +333,55 @@ namespace Reset.Core{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class FloatValueGroup : ValueGroup.ISmoothable{ // Done
|
||||
[Serializable]
|
||||
public class FloatValueGroup : ValueGroup.ISmoothable{ // Done, fixed
|
||||
public string label;
|
||||
|
||||
// Value
|
||||
public BBParameter<ValueChangeAction> changeValue;
|
||||
public BBParameter<float> value;
|
||||
|
||||
public BBParameter<ValueChangeAction> changeEasing{ get; set; }
|
||||
public BBParameter<ValueChangeAction> changeSmoothing{ get; set; }
|
||||
public BBParameter<float> smoothing { get; set; }
|
||||
public BBParameter<float> easing{ get; set; }
|
||||
|
||||
// Smoothing
|
||||
[SerializeField] private BBParameter<ValueChangeAction> _changeSmoothing;
|
||||
[SerializeField] public BBParameter<float> _smoothing;
|
||||
|
||||
public BBParameter<ValueChangeAction> changeSmoothing{
|
||||
get => _changeSmoothing;
|
||||
set => _changeSmoothing = value.value;
|
||||
}
|
||||
|
||||
public BBParameter<float> Smoothing{
|
||||
get => _smoothing;
|
||||
set => _smoothing = value.value;
|
||||
}
|
||||
|
||||
// Easing
|
||||
[SerializeField] private BBParameter<ValueChangeAction> _changeEasing;
|
||||
[SerializeField] public BBParameter<float> _easing;
|
||||
|
||||
public BBParameter<ValueChangeAction> changeEasing{
|
||||
get => _changeEasing;
|
||||
set => _changeEasing = value.value;
|
||||
}
|
||||
|
||||
public BBParameter<float> Easing{
|
||||
get => _easing;
|
||||
set => _easing = value.value;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
public FloatValueGroup(string newLabel){
|
||||
label = newLabel;
|
||||
value = new BBParameter<float>().value = 0f;
|
||||
changeValue = ValueChangeAction.NoChange;
|
||||
changeValue = new BBParameter<ValueChangeAction>();
|
||||
|
||||
changeSmoothing = ValueChangeAction.NoChange;
|
||||
smoothing = 0f;
|
||||
changeSmoothing = new BBParameter<ValueChangeAction>();
|
||||
Smoothing = new BBParameter<float>().value = 0f;
|
||||
|
||||
changeEasing = ValueChangeAction.NoChange;
|
||||
easing = 0f;
|
||||
changeEasing = new BBParameter<ValueChangeAction>();
|
||||
Easing = new BBParameter<float>().value = 0f;
|
||||
}
|
||||
|
||||
public static void UpdateValue(FloatValueGroup valueGroup, ref float targetProperty, ref float defaultProperty){
|
||||
@@ -277,6 +392,9 @@ namespace Reset.Core{
|
||||
case ValueChangeAction.ResetValue:
|
||||
targetProperty = defaultProperty;
|
||||
break;
|
||||
case ValueChangeAction.RelativeValue:
|
||||
targetProperty += valueGroup.value.value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user