Shop weitergebaut, CreditsScene angepasst, MainMenue weiter verschönert, an Monetarisierung gearbeitet
This commit is contained in:
74
Assets/Scripts/Button Functions/CreditsScript.cs
Normal file
74
Assets/Scripts/Button Functions/CreditsScript.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using JetBrains.Annotations;
|
||||
using TMPro;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
public class CreditsScript : MonoBehaviour
|
||||
{
|
||||
|
||||
public float scrollSpeed;
|
||||
private float maxScrollSpeed = 300f;
|
||||
[SerializeField] public float maxYPosition;
|
||||
[SerializeField] public float minYPosition;
|
||||
[SerializeField] public TMP_Text text;
|
||||
TMP_Text textfeld;
|
||||
|
||||
private RectTransform rectTransform;
|
||||
|
||||
void Start()
|
||||
{
|
||||
scrollSpeed = 200f;
|
||||
textfeld = this.text;
|
||||
|
||||
maxYPosition = 3200;
|
||||
minYPosition = 0;
|
||||
rectTransform = GetComponent<RectTransform>();
|
||||
|
||||
Credits();
|
||||
}
|
||||
|
||||
|
||||
void Update()
|
||||
{
|
||||
rectTransform.anchoredPosition += new Vector2(0, scrollSpeed * Time.deltaTime);
|
||||
|
||||
|
||||
if (transform.position.y >= maxYPosition)
|
||||
{
|
||||
//Credits wieder nach unten packen, damit sie loopen
|
||||
|
||||
//this.transform.position.y = minYPosition;
|
||||
Debug.Log("The End");
|
||||
}
|
||||
}
|
||||
|
||||
public void HurryUp()
|
||||
{
|
||||
//scrollSpeed = 50f;
|
||||
scrollSpeed = maxScrollSpeed;
|
||||
|
||||
//if (scrollSpeed > maxScrollSpeed)
|
||||
//{
|
||||
// scrollSpeed = maxScrollSpeed;
|
||||
//}
|
||||
|
||||
//else
|
||||
//{
|
||||
// scrollSpeed = 50f;
|
||||
//}
|
||||
}
|
||||
|
||||
public void Credits()
|
||||
{
|
||||
//die Credits einfach hardcoden, dann kann ich die schneller anpassen
|
||||
//funktioniert
|
||||
|
||||
textfeld.text = "Assets" +
|
||||
"Dark UI kit by kΩsmaragd on Unity Store" +
|
||||
"Clean Vector Icons by PONETI on Unity Store" +
|
||||
"UX Flat Icons [Free] by Heathen Engineering on Unity Store" +
|
||||
"Help Me Font by GGBotNet on itch.io ";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user