adding in some needed packages
This commit is contained in:
parent
9e739f5dc8
commit
aba5310742
1012 changed files with 494191 additions and 1 deletions
34
Assets/Bremsengine/Credits Assets/CreditsLoader.cs
Normal file
34
Assets/Bremsengine/Credits Assets/CreditsLoader.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Bremsengine
|
||||
{
|
||||
public class CreditsLoader : MonoBehaviour
|
||||
{
|
||||
[SerializeField] GameCreditsSO gameCredits;
|
||||
[SerializeField] TMP_Text creditsText;
|
||||
[SerializeField] Rigidbody2D rb;
|
||||
[SerializeField] float upwardsForce;
|
||||
[SerializeField] GameObject container;
|
||||
[SerializeField] bool loadCredits;
|
||||
private void Start()
|
||||
{
|
||||
if (loadCredits)
|
||||
{
|
||||
creditsText.text = gameCredits.CompileCredits();
|
||||
return;
|
||||
}
|
||||
creditsText.text = "";
|
||||
}
|
||||
public void StartCredits()
|
||||
{
|
||||
container.SetActive(true);
|
||||
rb.position = transform.position;
|
||||
rb.linearVelocity = new(0f, upwardsForce);
|
||||
}
|
||||
public void EndCredits()
|
||||
{
|
||||
container.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue