PBG2H23ABR_PBG2H23AKL_PMC_P.../Plunderblock/Assets/UI_Manager.cs

31 lines
672 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using UnityEngine;
using UnityEngine.UI;
public class UI_Manager : MonoBehaviour
{
private Text anzahlKills;
private Transform canvas;
public void killCount(int addedScore){
int summe = int.Parse(anzahlKills.text) + addedScore;
anzahlKills.text = "" + summe;
}
void Start()
{
canvas = this.gameObject.GetComponentInChildren<Transform>();
anzahlKills = canvas.GetComponentInChildren<Text>();
anzahlKills.text = "0";
}
// Update is called once per frame
void Update()
{
}
}