99 lines
1.9 KiB
C#
99 lines
1.9 KiB
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using Unity.Mathematics;
|
||
using UnityEngine;
|
||
using UnityEngine.SceneManagement;
|
||
using UnityEngine.UI;
|
||
|
||
public class UIManager : MonoBehaviour
|
||
{
|
||
public GameObject buildingName;
|
||
public Image icon;
|
||
public Sprite ON;
|
||
public Sprite OFF;
|
||
public GameObject camCtrl;
|
||
public GameObject camCenter;
|
||
public Vector3 camCenterX;
|
||
|
||
bool bName = false;
|
||
bool dis = true;
|
||
|
||
|
||
// Start is called before the first frame update
|
||
void Start()
|
||
{
|
||
|
||
}
|
||
|
||
// Update is called once per frame
|
||
void Update()
|
||
{
|
||
if (Input.GetKey(KeyCode.Q))
|
||
{
|
||
Debug.Log("°´ÏÂq");
|
||
}
|
||
|
||
}
|
||
public void disName()
|
||
{
|
||
if (bName == false)
|
||
{
|
||
buildingName.SetActive(true);
|
||
bName = true;
|
||
|
||
icon.sprite = OFF;
|
||
}
|
||
else
|
||
{
|
||
buildingName.SetActive(false);
|
||
bName = false;
|
||
|
||
icon.sprite = ON;
|
||
}
|
||
}
|
||
|
||
public void qie(GameObject imageUI)
|
||
{
|
||
if (dis == false)
|
||
{
|
||
dis = true;
|
||
imageUI.SetActive(true);
|
||
icon.sprite = OFF;
|
||
}
|
||
else
|
||
{
|
||
dis = false;
|
||
imageUI.SetActive(false);
|
||
icon.sprite = ON;
|
||
}
|
||
}
|
||
|
||
public void qieAll(GameObject imageUI)
|
||
{
|
||
dis = true;
|
||
imageUI.SetActive(true);
|
||
icon.sprite = OFF;
|
||
|
||
}
|
||
|
||
public void toSecen()
|
||
{
|
||
SceneManager.LoadScene("SampleScene");
|
||
}
|
||
|
||
public void dingWeiX(float cx)
|
||
{
|
||
camCtrl.GetComponent<MouseFollowRotation>().x = cx;
|
||
//camCtrl.GetComponent<MouseFollowRotation>().y = cy;
|
||
}
|
||
public void dingWeiY(float cy)
|
||
{
|
||
camCtrl.GetComponent<MouseFollowRotation>().y = cy;
|
||
}
|
||
public void centerX()
|
||
{
|
||
camCenter.transform.position = camCenterX;
|
||
}
|
||
|
||
}
|