44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
public class DeveloperInfoUi : MonoBehaviour
|
||
|
{
|
||
|
[SerializeField]
|
||
|
private Developer _developer;
|
||
|
|
||
|
[SerializeField]
|
||
|
private RawImage _developerPortrait;
|
||
|
|
||
|
[SerializeField]
|
||
|
private Image _hungerImage;
|
||
|
|
||
|
[SerializeField]
|
||
|
private Image _caffeineImage;
|
||
|
|
||
|
[SerializeField]
|
||
|
private Image _toiletImage;
|
||
|
|
||
|
[SerializeField]
|
||
|
private Image _happinessImage;
|
||
|
|
||
|
[SerializeField]
|
||
|
private Gradient _statusGradient;
|
||
|
|
||
|
void Start()
|
||
|
{
|
||
|
_developerPortrait.texture = _developer.GetComponentInChildren<Camera>().targetTexture;
|
||
|
}
|
||
|
|
||
|
// Update is called once per frame
|
||
|
void Update()
|
||
|
{
|
||
|
_happinessImage.color = _statusGradient.Evaluate((float)_developer.CurrentUrgeToUrinate);
|
||
|
_caffeineImage.color = _statusGradient.Evaluate((float)_developer.CurrentCaffeination);
|
||
|
_hungerImage.color = _statusGradient.Evaluate((float)_developer.CurrentHunger);
|
||
|
_toiletImage.color = _statusGradient.Evaluate((float)_developer.CurrentUrgeToUrinate);
|
||
|
}
|
||
|
}
|