51 lines
1.2 KiB
C#
51 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
|
|
public class StartupScript : MonoBehaviour
|
|
{
|
|
private static StartupScript _current;
|
|
|
|
public static StartupScript Current { get { return _current; } }
|
|
|
|
public bool Active = true;
|
|
|
|
// Use this for initialization
|
|
void Start()
|
|
{
|
|
_current = this;
|
|
Screen.SetResolution(1600, 900, true);
|
|
Debug.Log(Screen.width + "- " +Screen.height);
|
|
if (!Active) return;
|
|
for (int i = 0; i < transform.childCount; i++)
|
|
{
|
|
|
|
transform.GetChild(i).gameObject.SetActive(i == 0);
|
|
}
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
public void Display(int panelIndexToDisplay, int panelIndexToHide)
|
|
{
|
|
if (panelIndexToDisplay >= 0 && panelIndexToDisplay < transform.childCount &&
|
|
panelIndexToHide >= 0 && panelIndexToHide < transform.childCount)
|
|
{
|
|
transform.GetChild(panelIndexToDisplay).gameObject.SetActive(true);
|
|
transform.GetChild(panelIndexToHide).gameObject.SetActive(false);
|
|
}
|
|
}
|
|
|
|
public void Quit()
|
|
{
|
|
Application.Quit();
|
|
}
|
|
|
|
}
|