-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStatButtonScript.cs
50 lines (48 loc) · 1.51 KB
/
StatButtonScript.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class StatButtonScript : MonoBehaviour
{
public Slider STRslider, ENDslider, LUKslider, SPDslider;
public void STRUP()
{
if(DataManager.Instance.credits >= 100 && DataManager.Instance.STR_stat <= 5)
{
DataManager.Instance.credits -= 100;
DataManager.Instance.STR_stat++;
STRslider.maxValue = 5;
STRslider.value = DataManager.Instance.STR_stat;
}
}
public void ENDUP()
{
if (DataManager.Instance.credits >= 100 && DataManager.Instance.END_stat <= 5 )
{
DataManager.Instance.credits -= 100;
DataManager.Instance.END_stat++;
ENDslider.maxValue = 5;
ENDslider.value = DataManager.Instance.END_stat;
}
}
public void LUKUP()
{
if (DataManager.Instance.credits >= 100 && DataManager.Instance.LUK_stat <= 5)
{
DataManager.Instance.credits -= 100;
DataManager.Instance.LUK_stat++;
LUKslider.maxValue = 5;
LUKslider.value = DataManager.Instance.LUK_stat;
}
}
public void SPDUP()
{
if (DataManager.Instance.credits >= 100 && DataManager.Instance.SPD_stat <= 5)
{
DataManager.Instance.credits -= 100;
DataManager.Instance.SPD_stat++;
SPDslider.maxValue = 5;
SPDslider.value = DataManager.Instance.SPD_stat;
}
}
}