File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using BNG;
public class UIManager : MonoBehaviour
{
public GameObject goTargetParents;
public GameObject goUiCanvas;
public Vector3 uiPos;
public Vector3 uiRotate;
public bool isUiVisible;
private bool isFirstBegin;
public GameObject goPanelContent;
public GameObject goPanelTK;
public PlayManager playManager;
// Start is called before the first frame update
void Start()
{
//goUiCanvas.transform.parent = goTargetParents.transform;
//goUiCanvas.transform.localPosition = uiPos;
//goUiCanvas.transform.localRotation = Quaternion.Euler(uiRotate);
isFirstBegin = true;
isUiVisible = false;
goUiCanvas.SetActive(true);
goPanelContent.SetActive(false);
goPanelTK.SetActive(false);
Invoke("InitStart", 1f);
}
void InitStart()
{
playManager.SetToggle(1);
playManager.SetCharacter(0);
playManager.SetPoomsea(PlayerPrefs.GetInt("TKNum")); // 0, 8
}
private void ShowUI()
{
goUiCanvas.transform.parent = null;
goUiCanvas.SetActive(true);
}
private void HideUI()
{
goUiCanvas.SetActive(false);
goUiCanvas.transform.parent = goTargetParents.transform;
goUiCanvas.transform.localPosition = uiPos;
goUiCanvas.transform.localRotation = Quaternion.Euler(uiRotate);
}
// Update is called once per frame
void Update()
{
if(InputBridge.Instance.LeftGripDown || Input.GetKeyDown(KeyCode.O))
{
isUiVisible = !isUiVisible;
goUiCanvas.SetActive(isUiVisible);
if(isUiVisible == true)
{
goPanelContent.SetActive(false);
goPanelTK.SetActive(true);
playManager.SetToggle(playManager.currentToggleIndex);
}
}
if (InputBridge.Instance.RightGripDown || Input.GetKeyDown(KeyCode.P))
{
isUiVisible = !isUiVisible;
goUiCanvas.SetActive(isUiVisible);
if (isUiVisible == true)
{
goPanelContent.SetActive(false);
goPanelTK.SetActive(true);
playManager.SetToggleController();
}
}
}
public void OpenTK()
{
//if (isFirstBegin)
//{
// isFirstBegin = false;
goPanelContent.SetActive(false);
goPanelTK.SetActive(false);
playManager.SetCharacter(0);
playManager.SetPoomsea(0);
//}
}
public void OpenContents(int _index)
{
goPanelContent.SetActive(false);
goPanelTK.SetActive(false);
playManager.SetToggle(_index);
playManager.SetCharacter(0);
if(_index == 0)
{
playManager.SetPoomsea(0);
}
else if (_index == 1)
{
playManager.SetPoomsea(8);
}
else if (_index == 2)
{
playManager.SetPoomsea(17);
}
}
}