Изменён текст
This commit is contained in:
@ -8,7 +8,13 @@ public class ScoreManagerScript : MonoBehaviour
|
||||
{
|
||||
// to do
|
||||
// добавить коментарии ко всему
|
||||
private TileManagerScript _tileManagerScript;
|
||||
private TileManagerScript _TileManagerScript;
|
||||
|
||||
[SerializeField]
|
||||
private Transform _PlayerTransform;
|
||||
|
||||
[SerializeField]
|
||||
private float _Distance = 0f;
|
||||
|
||||
private int _CurrentScore = 0;
|
||||
|
||||
@ -17,17 +23,19 @@ public class ScoreManagerScript : MonoBehaviour
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_tileManagerScript = GameObject.FindGameObjectWithTag("Tile Manager").GetComponent<TileManagerScript>();
|
||||
_TileManagerScript = GameObject.FindGameObjectWithTag("Tile Manager").GetComponent<TileManagerScript>();
|
||||
|
||||
if (_tileManagerScript != null)
|
||||
if (_TileManagerScript != null)
|
||||
{
|
||||
_tileManagerScript.scoreManager = this;
|
||||
_TileManagerScript.scoreManager = this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void Start()
|
||||
private void Update()
|
||||
{
|
||||
|
||||
UpdatePos();
|
||||
}
|
||||
|
||||
public void Increase()
|
||||
@ -41,9 +49,15 @@ public class ScoreManagerScript : MonoBehaviour
|
||||
text.text = $"Счёт - {_CurrentScore}";
|
||||
}
|
||||
|
||||
//public void UpdatePos()
|
||||
//{
|
||||
// Vector3 newVector = new Vector3(_ScoreText.gameObject.transform.position.x, _ScoreText.gameObject.transform.position.y, _ScoreText.gameObject.transform.position.z + _TileManagerScript.DistanceTiles);
|
||||
// _ScoreText.gameObject.transform.position = newVector;
|
||||
//}
|
||||
|
||||
public void UpdatePos()
|
||||
{
|
||||
Vector3 newVector = new Vector3(_ScoreText.gameObject.transform.position.x, _ScoreText.gameObject.transform.position.y, _ScoreText.gameObject.transform.position.z + _tileManagerScript.DistanceTiles);
|
||||
_ScoreText.gameObject.transform.position = newVector;
|
||||
Vector3 newVector = new Vector3(_ScoreText.gameObject.transform.position.x, _ScoreText.gameObject.transform.position.y, _PlayerTransform.position.z + _Distance);
|
||||
_ScoreText.gameObject.transform.position = newVector;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user