PO/Assets/PhaseCounter.cs

44 lines
904 B
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PhaseCounter : MonoBehaviour
{
private Text _phaseCount;
private int _maxPhase = 1;
private int _phase = 1;
private void Awake()
{
_phaseCount = GetComponent<Text>();
}
public void NewPhase()
{
_phase++;
_phaseCount.text = "Phase: " + _phase + "/" + _maxPhase;
}
public void NewMaxPhase(BattleConfig _config)
{
var _character = _config.battleCharacteristics;
if(_character.SecondPhase == true)
{
if(_character.ThirdPhase == true)
{
_maxPhase = 3;
}
else
{
_maxPhase = 2;
}
}
else
{
_maxPhase = 1;
}
_phase = 0;
NewPhase();
}
}