52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
using UnityEngine.XR.Interaction.Toolkit;
|
|
|
|
public class FirstMenuScript : MonoBehaviour
|
|
{
|
|
[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)
|
|
{
|
|
_Move = move;
|
|
_CharacterController = cc;
|
|
}
|
|
|
|
// Start is called before the first frame update
|
|
|
|
// действие на кнопку закончить
|
|
public void OnEnd()
|
|
{
|
|
_Move.enabled = true;
|
|
_CharacterController.enabled = true;
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
// действие на кнопку продолжить
|
|
public void OnContinues()
|
|
{
|
|
if (_currentIndex == _UIPanel.Length-1)
|
|
{
|
|
OnEnd();
|
|
return;
|
|
}
|
|
|
|
_UIPanel[_currentIndex++].SetActive(false);
|
|
|
|
_UIPanel[_currentIndex].SetActive(true);
|
|
}
|
|
|
|
// public void UserDisagree()
|
|
// {
|
|
// Application.Quit();
|
|
// }
|
|
}
|