Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using UnityEngine.SceneManagement;
- public class KampfStarten : MonoBehaviour
- {
- [Header("WaffenButton")]
- public Button Waffe1, Waffe, Waffe3, Waffe4;
- [Header("WaffenText")]
- public Text WaffeText1, WaffeText2, WaffeText3, WaffeText4;
- [Header("WaffenIcon")]
- public Image WaffeIcon1, WaffeIcon2, WaffeIcon3, WaffeIcon4;
- [Header("WaffeInBesitz")]
- public bool Waffe01, Waffe02, Waffe03, Waffe04;
- [Header("WaffeAktiv")]
- public bool Waffe01Aktiv, Waffe02Aktiv, Waffe03Aktiv, Waffe04Aktiv;
- [Header("Runden")]
- public int RundenGespielt;
- [Header("Fortschrit")]
- public GameObject Fortschrit1, Fortschrit2, Fortschrit3, Fortschrit4;
- [Header("BuyButtonTexts")]
- public Text BuyButton01, BuyButton02, BuyButton03, BuyButton04;
- [Header("FortschritsText")]
- public Text Fortschrit02Text, Fortschrit03Text, Fortschrit04Text;
- Kampf1 kampf;
- [Header("WellenButtons")]
- public Button Fünf_Wellen;
- public Button Zehn_Wellen;
- public Button EineMinuty_Wellen;
- public Button EinsdreizigMinuten_Wellen;
- public static KampfStarten kampfStarten;
- public Button StartButton;
- [Header("Fortschritsanzeige")]
- public Image Fortschritsanzeige02, Fortschritsanzeige03, Fortschritsanzeige04;
- public float maxMission, Fortschritt, currentMission;
- Timer Timer;
- public Slider slider;
- void Awake()
- {
- Timer = FindObjectOfType<Timer>();
- if (kampfStarten == null)
- {
- DontDestroyOnLoad(this.gameObject);
- kampfStarten = this;
- }
- else
- {
- Destroy(gameObject);
- }
- }
- private void Start()
- {
- kampf = FindObjectOfType<Kampf1>();
- Waffe01Aktiv = true;
- Waffe01 = true;
- Fortschrit02Text.text = RundenGespielt + "/60".ToString();
- Fortschrit03Text.text = RundenGespielt + "/80".ToString();
- Fortschrit04Text.text = RundenGespielt + "/90".ToString();
- }
- public void FünfWellen()
- {
- kampf.Wellen += 5;
- EinsdreizigMinuten_Wellen.interactable = false;
- EineMinuty_Wellen.interactable = false;
- Zehn_Wellen.interactable = false;
- Fünf_Wellen.interactable = false;
- StartButton.interactable = true;
- }
- public void ZehnWellen()
- {
- kampf.Wellen += 10;
- EinsdreizigMinuten_Wellen.interactable = false;
- EineMinuty_Wellen.interactable = false;
- Zehn_Wellen.interactable = false;
- Fünf_Wellen.interactable = false;
- StartButton.interactable = true;
- }
- public void EineMinuteWellen()
- {
- // Timer.Zeitt = true;
- kampf.Time += 60;
- EinsdreizigMinuten_Wellen.interactable = false;
- EineMinuty_Wellen.interactable = false;
- Zehn_Wellen.interactable = false;
- Fünf_Wellen.interactable = false;
- kampf.AufZeit = true;
- StartButton.interactable = true;
- }
- public void EinsDreisichMinutyenWellen()
- {
- //Timer.Zeitt = true;
- kampf.Time += 90;
- EinsdreizigMinuten_Wellen.interactable = false;
- EineMinuty_Wellen.interactable = false;
- Zehn_Wellen.interactable = false;
- Fünf_Wellen.interactable = false;
- kampf.AufZeit = true;
- StartButton.interactable = true;
- }
- public void Starten()
- {
- SceneManager.LoadScene("Kampf");
- }
- public void Waffe01Button()
- {
- if (Waffe01 == true)
- {
- WaffeText4.GetComponentInChildren<Text>().text = "Ausrüsten";
- WaffeText2.GetComponentInChildren<Text>().text = "Ausrüsten";
- WaffeText3.GetComponentInChildren<Text>().text = "Ausrüsten";
- }
- WaffeText1.GetComponentInChildren<Text>().text = "Aktiv";
- Waffe01 = true;
- Waffe01Aktiv = true;
- Waffe02Aktiv = false;
- Waffe03Aktiv = false;
- Waffe04Aktiv = false;
- if (Waffe02Aktiv == false)
- {
- BuyButton02.GetComponentInChildren<Text>().text = "Ausrüsten";
- }
- }
- public void Waffe02Button()
- {
- if (RundenGespielt >= 60)
- {
- if (Waffe02Aktiv == true)
- {
- Waffe02 = true;
- WaffeText2.GetComponentInChildren<Text>().text = "Aktiv";
- }
- }
- if (Waffe03 == true)
- {
- WaffeText3.GetComponentInChildren<Text>().text = "Ausrüsten";
- }
- if(Waffe02Aktiv == true)
- {
- WaffeText2.GetComponentInChildren<Text>().text = "Aktiv";
- }
- if (Waffe04 == true)
- {
- WaffeText4.GetComponentInChildren<Text>().text = "Ausrüsten";
- }
- if (Waffe01 == false)
- {
- WaffeText1.GetComponentInChildren<Text>().text = "Ausrüsten";
- }
- if (RundenGespielt >= 60)
- {
- Destroy(Fortschrit2);
- BuyButton02.GetComponentInChildren<Text>().text = "Aktiv";
- WaffeText1.GetComponentInChildren<Text>().text = "Ausrüsten";
- Waffe02 = true;
- Waffe02Aktiv = true;
- Waffe01Aktiv = false;
- Waffe03Aktiv = false;
- Waffe04Aktiv = false;
- }
- }
- public void Waffe03Button()
- {
- if (RundenGespielt >= 80)
- {
- if (Waffe03Aktiv == true)
- {
- Waffe03 = true;
- WaffeText3.text = "Aktiv";
- WaffeText3.GetComponentInChildren<Text>().text = "Aktiv";
- WaffeText1.GetComponentInChildren<Text>().text = "Ausrüsten";
- WaffeText2.GetComponentInChildren<Text>().text = "Ausrüsten";
- }
- }
- if (Waffe02 == true)
- {
- WaffeText2.GetComponentInChildren<Text>().text = "Ausrüsten";
- }
- if (Waffe03Aktiv == true)
- {
- WaffeText2.GetComponentInChildren<Text>().text = "Aktiv";
- }
- if (Waffe04 == true)
- {
- WaffeText4.GetComponentInChildren<Text>().text = "Ausrüsten";
- }
- if (Waffe01 == false)
- {
- WaffeText1.GetComponentInChildren<Text>().text = "Ausrüsten";
- }
- if (RundenGespielt >= 80)
- {
- Destroy(Fortschrit3);
- BuyButton03.GetComponentInChildren<Text>().text = "Aktiv";
- Waffe03 = true;
- Waffe02Aktiv = false;
- Waffe01Aktiv = false;
- Waffe03Aktiv = true;
- Waffe04Aktiv = false;
- }
- }
- public void Waffe04Button()
- {
- if (RundenGespielt >= 90)
- {
- Destroy(Fortschrit4);
- BuyButton04.GetComponentInChildren<Text>().text = "Aktiv";
- Waffe04 = true;
- Waffe02Aktiv = false;
- Waffe01Aktiv = false;
- Waffe03Aktiv = false;
- Waffe04Aktiv = true;
- if (Waffe04Aktiv == true)
- {
- Waffe04 = true;
- WaffeText4.GetComponentInChildren<Text>().text = "Aktiv";
- WaffeText1.GetComponentInChildren<Text>().text = "Ausrüsten";
- WaffeText2.GetComponentInChildren<Text>().text = "Ausrüsten";
- WaffeText3.GetComponentInChildren<Text>().text = "Ausrüsten";
- }
- }
- if (Waffe04 == true)
- {
- WaffeText4.GetComponentInChildren<Text>().text = "Ausrüsten";
- }
- if (Waffe04Aktiv == true)
- {
- WaffeText4.GetComponentInChildren<Text>().text = "Aktiv";
- }
- if (Waffe04Aktiv == true)
- {
- WaffeText3.GetComponentInChildren<Text>().text = "Ausrüsten";
- }
- if (Waffe01 == false)
- {
- WaffeText1.GetComponentInChildren<Text>().text = "Ausrüsten";
- }
- }
- public void JoJoJo()
- {
- RundenGespielt += 60;
- RundenAktualiesieren();
- }
- public void FortschritsUpdate()
- {
- if (RundenGespielt <= 60)
- {
- currentMission = currentMission + Fortschritt;
- Fortschritsanzeige02.GetComponent<Image>().fillAmount = currentMission / 100f;
- print("Yes");
- }
- if (RundenGespielt >= 60)
- {
- currentMission = currentMission + Fortschritt;
- Fortschritsanzeige03.GetComponent<Image>().fillAmount = currentMission / 100f;
- print("2");
- }
- if (RundenGespielt >= 80)
- {
- currentMission = currentMission + Fortschritt;
- Fortschritsanzeige04.GetComponent<Image>().fillAmount = currentMission / 100f;
- }
- }
- public void RundenAktualiesieren()
- {
- Fortschrit02Text.text = RundenGespielt.ToString() + "/60";
- Fortschrit03Text.text = RundenGespielt.ToString() + "/80";
- Fortschrit04Text.text = RundenGespielt.ToString() + "/90";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement