26 lines
673 B
C#
26 lines
673 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace AibisDream
|
|
{
|
|
public class OilDashBoard : Dashboard
|
|
{
|
|
private Transform _pointer;
|
|
|
|
[SerializeField] private float topPosY;
|
|
[SerializeField] private float bottomPosY;
|
|
|
|
protected override void OnStart()
|
|
{
|
|
_pointer = transform.Find("Pointer");
|
|
}
|
|
|
|
protected override void UpdateDashboard(EngineData data)
|
|
{
|
|
var targetPosY = (topPosY - bottomPosY) * data.curOil + bottomPosY;
|
|
_pointer.position = new Vector3(_pointer.position.x, targetPosY, _pointer.position.z);
|
|
}
|
|
}
|
|
}
|