You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.2 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class MenuWnd : MonoBehaviour
{
//视图索引
private int viewIndex = 0;
public Button viewChangeBtn;
public Button roadInfoBtn;
public GameObject threeDcamera;
public GameObject twoDcamera;
// Start is called before the first frame update
public void Init()
{
viewChangeBtn.onClick.AddListener(ChangeView);
roadInfoBtn.onClick.AddListener(()=>{ GameRoot.Instance.infoWnd.SetRoadInfoActive(true); }
);
}
/// <summary>
/// 0为3D试图1为2D视图
/// </summary>
public void ChangeView()
{
switch (viewIndex)
{
case 0:
viewIndex = 1;
break;
case 1:
viewIndex = 0;
break;
}
switch (viewIndex)
{
case 0:
twoDcamera.SetActive(true);
threeDcamera.SetActive(false);
break;
case 1:
twoDcamera.SetActive(false);
threeDcamera.SetActive(true);
break;
}
GameRoot.Instance.infoWnd.SetColorTitleActive();
}
}