Sachn
This commit is contained in:
@ -13,13 +13,17 @@ public class CameraScript : MonoBehaviour
|
||||
|
||||
public float Distance = 5.0f;
|
||||
|
||||
public float Angle = 45.0f;
|
||||
|
||||
void Start()
|
||||
{
|
||||
Vector4 position = new Vector4(0, 0, -Distance, 1.0f);
|
||||
|
||||
Matrix4x4 mat = Matrix4x4.Rotate(Quaternion.Euler(45, 0, 0));
|
||||
Quaternion rotation = Quaternion.Euler(Angle, 0, 0);
|
||||
Matrix4x4 mat = Matrix4x4.Rotate(rotation);
|
||||
|
||||
_camera.transform.localPosition = mat * position;
|
||||
_camera.transform.localRotation = rotation;
|
||||
transform.position = _character.transform.position;
|
||||
}
|
||||
|
||||
|
||||
@ -237,6 +237,8 @@ public class Developer : MonoBehaviour
|
||||
_happiness += 0.2;
|
||||
}
|
||||
|
||||
_urgeToUrinateLevel -= caffeineAmount / 0.5f;
|
||||
|
||||
_wantedDrink = WantedConsumable.None;
|
||||
}
|
||||
|
||||
@ -270,6 +272,8 @@ public class Developer : MonoBehaviour
|
||||
_happiness += 0.2;
|
||||
}
|
||||
|
||||
_urgeToUrinateLevel -= foodAmount / 0.5f;
|
||||
|
||||
_wantedFood = WantedConsumable.None;
|
||||
}
|
||||
|
||||
|
||||
@ -40,6 +40,19 @@ public class TimeManager : MonoBehaviourSingleton<TimeManager>
|
||||
/// </summary>
|
||||
public DateTime Deadline => _deadline;
|
||||
|
||||
public DateTime PredictedEndDate
|
||||
{
|
||||
get
|
||||
{
|
||||
double realSeconds = GameManager.Instance.ExpectedRemainingGameDuration;
|
||||
double gameDays = realSeconds / _secondsPerDay;
|
||||
|
||||
return CurrentDate.AddDays(gameDays);
|
||||
}
|
||||
}
|
||||
|
||||
public bool PredictedMissesDeadline => PredictedEndDate > Deadline;
|
||||
|
||||
/// <summary>
|
||||
/// Wie viele Sekunden ein Tag im Spiel hat
|
||||
/// </summary>
|
||||
|
||||
@ -23,10 +23,44 @@ public class UiController : MonoBehaviour
|
||||
private Button _prevActionButton;
|
||||
[SerializeField]
|
||||
private Button _nextActionButton;
|
||||
|
||||
[SerializeField]
|
||||
private Image _progressBarImage;
|
||||
|
||||
[SerializeField]
|
||||
private Image _progressBarBorder;
|
||||
|
||||
[SerializeField] private TextMeshProUGUI _progressText;
|
||||
|
||||
[SerializeField] private TextMeshProUGUI _deadlineText;
|
||||
[SerializeField] private TextMeshProUGUI _currentDateText;
|
||||
[SerializeField] private TextMeshProUGUI _predictedEndText;
|
||||
|
||||
[SerializeField] private Gradient _deadlineTextColors;
|
||||
|
||||
void Update()
|
||||
{
|
||||
UpdateActionDisplay();
|
||||
UpdateProgressBar();
|
||||
UpdateDeadlineDateStuffTexts();
|
||||
}
|
||||
|
||||
private void UpdateProgressBar()
|
||||
{
|
||||
Vector3 scale = _progressBarImage.rectTransform.localScale;
|
||||
scale.x = (float)GameManager.Instance.GameProgress;
|
||||
|
||||
_progressBarImage.rectTransform.localScale = scale;
|
||||
_progressBarImage.pixelsPerUnitMultiplier = _progressBarBorder.pixelsPerUnitMultiplier * scale.x;
|
||||
_progressText.text = $"Entwicklungsfortschritt: {GameManager.Instance.GameProgress:##0%}";
|
||||
}
|
||||
|
||||
private void UpdateDeadlineDateStuffTexts()
|
||||
{
|
||||
_currentDateText.text = $"Aktuelle Zeit: {TimeManager.Instance.CurrentDate: dddd dd.MM.yy hh U\\hr}";
|
||||
_deadlineText.text = $"Deadline: {TimeManager.Instance.Deadline: dddd dd.MM.yy hh U\\hr}";
|
||||
_predictedEndText.text = $"Vorraussichtlich fertig: {TimeManager.Instance.PredictedEndDate: dddd dd.MM.yy hh U\\hr}";
|
||||
_predictedEndText.color = _deadlineTextColors.Evaluate(TimeManager.Instance.PredictedMissesDeadline ? 0.0f : 1.0f);
|
||||
}
|
||||
|
||||
private void UpdateActionDisplay()
|
||||
|
||||
Reference in New Issue
Block a user