Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
920 B
0
Indexable
Never
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ScoreManager : MonoBehaviour
{
    public static ScoreManager instance;

    public Text scoreText;

    static int score = 0;

    private void Awake()
    {
        instance = this;
    }

    void Start()
    {
        scoreText.text = score.ToString() + "Points";
    }

    public void AddPointkill()
    {
        score += 200;
        scoreText.text = score.ToString() + "Points";
    }

    public void TakePointhit()
    {
        score -= 50;
        scoreText.text = score.ToString() + "Points";
    }

    public void AddPointheal()
    {
        score += 100;
        scoreText.text = score.ToString() + "Points";
    }

    public void AddPointkillboss()
    {
        score += 2000;
        scoreText.text = score.ToString() + "Points";
    }
}