hasicak
This commit is contained in:
@@ -1,20 +1,8 @@
|
||||
<<<<<<< HEAD
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
using GeoSus.Client;
|
||||
using System;
|
||||
|
||||
public class WindController : MonoBehaviour, ITask
|
||||
{
|
||||
[Header("Settings větru")]
|
||||
public float maxWindTorque = 8f;
|
||||
public float windChangeSpeed = 0.6f;
|
||||
public float gustInterval = 4f;
|
||||
=======
|
||||
using UnityEngine;
|
||||
|
||||
public class WindController : MonoBehaviour
|
||||
{
|
||||
[Header("settings větru")]
|
||||
[Tooltip("Maximální síla větru (kladná i záporná)")]
|
||||
@@ -27,7 +15,7 @@ public class WindController : MonoBehaviour
|
||||
public float gustInterval = 4f;
|
||||
|
||||
[Tooltip("Multiplier pro sílu vichřice")]
|
||||
>>>>>>> origin/main
|
||||
|
||||
public float gustMultiplier = 2.0f;
|
||||
|
||||
public float CurrentWindTorque { get; private set; }
|
||||
@@ -35,7 +23,6 @@ public class WindController : MonoBehaviour
|
||||
private float targetTorque;
|
||||
private float gustTimer;
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
||||
private Action<ITask> _onCompleted;
|
||||
private Action<ITask> _onExit;
|
||||
@@ -43,11 +30,10 @@ public class WindController : MonoBehaviour
|
||||
public string TaskID { get; set; }
|
||||
public TaskType TaskType { get; set; }
|
||||
public string TaskName { get; set; }
|
||||
public Position TaskLocation { get; set; }
|
||||
public (double, double) TaskLocation { get; set; }
|
||||
public bool IsCompleted { get; private set; }
|
||||
|
||||
=======
|
||||
>>>>>>> origin/main
|
||||
|
||||
void Start()
|
||||
{
|
||||
PickNewTargetTorque();
|
||||
@@ -56,7 +42,7 @@ public class WindController : MonoBehaviour
|
||||
|
||||
void Update()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
|
||||
CurrentWindTorque = Mathf.Lerp(CurrentWindTorque, targetTorque, Time.deltaTime * windChangeSpeed);
|
||||
|
||||
gustTimer -= Time.deltaTime;
|
||||
@@ -67,27 +53,13 @@ public class WindController : MonoBehaviour
|
||||
|
||||
gustTimer = gustInterval;
|
||||
Invoke(nameof(PickNewTargetTorque), 0.8f);
|
||||
=======
|
||||
// Smoothly move wind toward target torque
|
||||
CurrentWindTorque = Mathf.Lerp(CurrentWindTorque, targetTorque, Time.deltaTime * windChangeSpeed);
|
||||
|
||||
// Occasional gusts
|
||||
gustTimer -= Time.deltaTime;
|
||||
if (gustTimer <= 0f)
|
||||
{
|
||||
// Apply a short gust by shifting target torque more aggressively
|
||||
float gust = Random.Range(-maxWindTorque, maxWindTorque) * gustMultiplier;
|
||||
targetTorque = Mathf.Clamp(gust, -maxWindTorque * gustMultiplier, maxWindTorque * gustMultiplier);
|
||||
|
||||
gustTimer = gustInterval;
|
||||
Invoke(nameof(PickNewTargetTorque), 0.8f); // gust lasts ~0.8s
|
||||
>>>>>>> origin/main
|
||||
// Smoothly move wind toward target torque
|
||||
CurrentWindTorque = Mathf.Lerp(CurrentWindTorque, targetTorque, Time.deltaTime * windChangeSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
private void PickNewTargetTorque()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
targetTorque = UnityEngine.Random.Range(-maxWindTorque, maxWindTorque);
|
||||
}
|
||||
|
||||
@@ -113,8 +85,4 @@ public class WindController : MonoBehaviour
|
||||
_onExit?.Invoke(this);
|
||||
}
|
||||
}
|
||||
=======
|
||||
targetTorque = Random.Range(-maxWindTorque, maxWindTorque);
|
||||
}
|
||||
}
|
||||
>>>>>>> origin/main
|
||||
|
||||
|
||||
Reference in New Issue
Block a user