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 ";
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Button Functions/CreditsScript.cs.meta
Normal file
2
Assets/Scripts/Button Functions/CreditsScript.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d5be39440ed9dd34481bc2c42f862691
|
||||
@@ -1,8 +1,15 @@
|
||||
using TMPro;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
public class MenueScript : MonoBehaviour
|
||||
{
|
||||
public void ReturnHome()
|
||||
{
|
||||
SceneManager.LoadSceneAsync(0);
|
||||
}
|
||||
public void GameStart()
|
||||
{
|
||||
SceneManager.LoadSceneAsync(5);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Xml.Serialization;
|
||||
using TMPro;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -6,26 +7,31 @@ public class ShopScript : MonoBehaviour
|
||||
{
|
||||
[SerializeField] GameObject shopPanel;
|
||||
[SerializeField] GameObject errorPanel;
|
||||
public InventoryScript player;
|
||||
InventoryScript player;
|
||||
|
||||
private bool paymentSystemActive = true;
|
||||
private bool paymentSystemActive = false;
|
||||
[SerializeField] TMP_Text text;
|
||||
TMP_Text textfeld;
|
||||
//InventoryScript player;
|
||||
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
player = GetComponent<InventoryScript>();
|
||||
|
||||
shopPanel.SetActive(false);
|
||||
errorPanel.SetActive(false);
|
||||
|
||||
textfeld = this.text;
|
||||
//player = GetComponent<InventoryScript>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
textfeld.text = InventoryScript.deineMudda.ToString();
|
||||
}
|
||||
|
||||
|
||||
public void OpenShop()
|
||||
{
|
||||
shopPanel.SetActive(true);
|
||||
@@ -36,6 +42,11 @@ public class ShopScript : MonoBehaviour
|
||||
shopPanel.SetActive(false);
|
||||
}
|
||||
|
||||
public void ClosePanel()
|
||||
{
|
||||
errorPanel.SetActive(false);
|
||||
}
|
||||
|
||||
public void AddLife()
|
||||
{
|
||||
player.Health++;
|
||||
@@ -61,6 +72,9 @@ public class ShopScript : MonoBehaviour
|
||||
|
||||
public void BuyMore()
|
||||
{
|
||||
|
||||
int manyGemsCost = 200;
|
||||
|
||||
if (paymentSystemActive)
|
||||
{
|
||||
|
||||
|
||||
51
Assets/Scripts/Button Functions/TweenScript.cs
Normal file
51
Assets/Scripts/Button Functions/TweenScript.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class TweenScript : MonoBehaviour
|
||||
{
|
||||
|
||||
[SerializeField] private float duration;
|
||||
[SerializeField] private GameObject button;
|
||||
|
||||
//private KeyCode secretCode = KeyCode.G;
|
||||
|
||||
Vector3 ort = new Vector3();
|
||||
|
||||
public void Start()
|
||||
{
|
||||
duration = 2;
|
||||
//button = this.GameObject;
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
OnClick();
|
||||
}
|
||||
|
||||
public void Scale()
|
||||
{
|
||||
LeanTween.scale(button, transform.localScale * 1.1f, duration * Time.deltaTime).setEase(LeanTweenType.easeOutBounce);
|
||||
//LeanTween.scale(Trinagle, new Vector3(2,2,2), duration).setOnComplete(Debug.Log);
|
||||
}
|
||||
|
||||
private void Move()
|
||||
{
|
||||
LeanTween.moveX(button, button.transform.position.y, duration * Time.deltaTime);
|
||||
}
|
||||
|
||||
public void Bounce()
|
||||
{
|
||||
//code folgt
|
||||
//code steht in scale
|
||||
//mach circle bounce on space press
|
||||
}
|
||||
|
||||
public void OnClick()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Mouse1))
|
||||
{
|
||||
Scale();
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Button Functions/TweenScript.cs.meta
Normal file
2
Assets/Scripts/Button Functions/TweenScript.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0116161a3779aa24a919d65f454bee69
|
||||
@@ -2,9 +2,12 @@ using UnityEngine;
|
||||
|
||||
public class InventoryScript : MonoBehaviour
|
||||
{
|
||||
|
||||
public static int deineMudda = 2;
|
||||
static int deinVadda = 0;
|
||||
|
||||
//Energy
|
||||
[SerializeField] int energy = 10;
|
||||
|
||||
public InventoryScript(int energy)
|
||||
{
|
||||
this.energy = energy;
|
||||
@@ -15,7 +18,7 @@ public class InventoryScript : MonoBehaviour
|
||||
//Health
|
||||
[SerializeField] int health = 1;
|
||||
public int Health { get => health; set => health = value; }
|
||||
|
||||
|
||||
//Gems
|
||||
[SerializeField] int gems;
|
||||
public int Gems { get => gems; set => gems = value; }
|
||||
@@ -23,7 +26,7 @@ public class InventoryScript : MonoBehaviour
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
Gems = 10;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
|
||||
Reference in New Issue
Block a user