45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class FractionManager : MonoBehaviour
|
|
{
|
|
public static FractionManager ins;
|
|
public List<Fraction> fractions;
|
|
[SerializeField] float Totalscore;
|
|
public Dictionary<int, string> order = new Dictionary<int, string>();
|
|
[SerializeField] Button Btn;
|
|
private void Awake()
|
|
{
|
|
ins = this;
|
|
fractions = new List<Fraction>();
|
|
}
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
Btn = GetComponent<Button>();
|
|
Btn?.onClick.AddListener(() => over());
|
|
}
|
|
|
|
// Update is called once per frame
|
|
public float over()
|
|
{
|
|
for (int i = 0; i < fractions.Count; i++)
|
|
{
|
|
if (!fractions[i].CompletedorNot)
|
|
{
|
|
if (!fractions[i].Erroritem)
|
|
{
|
|
Totalscore -= fractions[i].scorercontinuer;
|
|
continue;
|
|
}
|
|
Totalscore -= fractions[i].scorercontinuer;
|
|
}
|
|
}
|
|
Debug.Log("¼Æ·ÖÍê³É");
|
|
return Totalscore;
|
|
}
|
|
}
|