Переделка меню
This commit is contained in:
@ -1,30 +1,51 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
public class FirstMenuScript : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject _UIMenu;
|
||||
[SerializeField] private ActionBasedContinuousMoveProvider _Move;
|
||||
[SerializeField] private CharacterController _CharacterController;
|
||||
|
||||
// список всех элементов UI для пролистывания
|
||||
[SerializeField] private GameObject[] _UIPanel;
|
||||
|
||||
// индекс текущего элемента UI
|
||||
private int _currentIndex = 0;
|
||||
|
||||
public void Init(ActionBasedContinuousMoveProvider move, CharacterController cc)
|
||||
{
|
||||
_UIMenu = gameObject;
|
||||
_Move = move;
|
||||
_CharacterController = cc;
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
|
||||
public void UserAgree()
|
||||
// действие на кнопку закончить
|
||||
public void OnEnd()
|
||||
{
|
||||
_Move.enabled = true;
|
||||
_CharacterController.enabled = true;
|
||||
_UIMenu.SetActive(false);
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void UserDisagree()
|
||||
// действие на кнопку продолжить
|
||||
public void OnContinues()
|
||||
{
|
||||
Application.Quit();
|
||||
if (_currentIndex == _UIPanel.Length-1)
|
||||
{
|
||||
OnEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
_UIPanel[_currentIndex++].SetActive(false);
|
||||
|
||||
_UIPanel[_currentIndex].SetActive(true);
|
||||
}
|
||||
|
||||
// public void UserDisagree()
|
||||
// {
|
||||
// Application.Quit();
|
||||
// }
|
||||
}
|
||||
|
Reference in New Issue
Block a user