温度の下がりやすさを変更
This commit is contained in:
parent
cb9fd5a870
commit
1033e6eec6
|
|
@ -31,7 +31,8 @@ public class ThermalControl : MonoBehaviour
|
|||
[SerializeField] private float coldValue = 0.32f;
|
||||
[SerializeField] private float hotValue = 0.67f;
|
||||
|
||||
private float duration = 0.3f;
|
||||
private float increaseDuration = 0.3f;
|
||||
private float decreaseDuration = 0.1f;
|
||||
private bool isMove;
|
||||
|
||||
public IReadOnlyReactiveProperty<ThermalCondition> Condition => condition;
|
||||
|
|
@ -57,17 +58,17 @@ public class ThermalControl : MonoBehaviour
|
|||
panSpeed = panController.Delta.magnitude * panFactor;
|
||||
if (panSpeed > deadZone)
|
||||
{
|
||||
temperatureSpeed = Mathf.Lerp(temperatureSpeed, -Mathf.Min(panSpeed, maxDecreaseSpeed), Time.deltaTime / duration);
|
||||
temperatureSpeed = Mathf.Lerp(temperatureSpeed, -Mathf.Min(panSpeed, maxDecreaseSpeed), Time.deltaTime / decreaseDuration);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (condition.Value == ThermalCondition.Hot)
|
||||
{
|
||||
temperatureSpeed = Mathf.Lerp(temperatureSpeed, hotIncreaseSpeed, Time.deltaTime / duration);
|
||||
temperatureSpeed = Mathf.Lerp(temperatureSpeed, hotIncreaseSpeed, Time.deltaTime / increaseDuration);
|
||||
}
|
||||
else
|
||||
{
|
||||
temperatureSpeed = Mathf.Lerp(temperatureSpeed, baseIncreaseSpeed, Time.deltaTime / duration);
|
||||
temperatureSpeed = Mathf.Lerp(temperatureSpeed, baseIncreaseSpeed, Time.deltaTime / increaseDuration);
|
||||
}
|
||||
}
|
||||
temperature = Mathf.Clamp01(temperature + temperatureSpeed * Time.deltaTime);
|
||||
|
|
|
|||
Loading…
Reference in New Issue