36 lines
844 B
C#
36 lines
844 B
C#
using CodeStage.AntiCheat.ObscuredTypes;
|
|
using System;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
|
|
public class CountChoiceUI : MonoBehaviour
|
|
{
|
|
public GameObject[] gos_unit_on, gos_unit_off;
|
|
|
|
ObscuredInt ChoiceCount = 1;
|
|
int m_UnitIndex;
|
|
Action m_actSelect;
|
|
|
|
public void Set(Action _actSelect)
|
|
{
|
|
m_actSelect = _actSelect;
|
|
Set_UI();
|
|
}
|
|
|
|
void Set_UI()
|
|
{
|
|
m_UnitIndex = ChoiceCount.ToString().Count(c => c == '0');
|
|
DSUtil.InActivateGameObjects(gos_unit_on, m_UnitIndex);
|
|
DSUtil.ActivateGameObjects(gos_unit_off, m_UnitIndex);
|
|
}
|
|
|
|
public int Get_Count() { return ChoiceCount; }
|
|
|
|
public void OnClick_Count(GameObject _go)
|
|
{
|
|
ChoiceCount = int.Parse(_go.name);
|
|
ChoiceCount.RandomizeCryptoKey();
|
|
Set_UI();
|
|
m_actSelect?.Invoke();
|
|
}
|
|
} |