using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ObjectScripts;
namespace UIScripts
{
public class ControlButtons : MonoBehaviour
{
///
/// AbstractManager to control
///
[SerializeField] AbstractManager ManagerObject;
///
/// Text in the scene for the velocity.
///
[SerializeField] UnityEngine.UI.Text VelocityText;
private void Update()
{
//Set Text in Scene
SetVelocityText(ManagerObject.GameVelocity, ManagerObject.forward);
}
///
/// On playbutton pressed
///
public void PlayPressed()
{
ManagerObject.PlayPressed();
}
///
/// Sets the velocity text in the scene
///
private void SetVelocityText(float vel, bool forward)
{
if (forward)
VelocityText.text = vel.ToString();
else
VelocityText.text = "-" + vel.ToString();
}
///
/// On stopbutton pressed
///
public void StopPressed()
{
ManagerObject.StopPressed();
}
///
/// On reversebutton pressed
///
public void ReversePressed()
{
ManagerObject.ReversePressed();
}
///
/// On playbutton pressed
///
public void PlusPressed()
{
ManagerObject.PlusPressed();
}
///
/// on minusbutton pressed
///
public void MinusPressed()
{
ManagerObject.MinusPressed();
}
}
}