49 lines
1.1 KiB
C#
49 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class UIFunctionNextLevel : MonoBehaviour
|
|
{
|
|
public int WhatScenceSelcet=-1;
|
|
public Button ½á¹¹;
|
|
public Button ʹÊ;
|
|
public GameObject[] ÊÓÆµ;
|
|
public GameObject ÊÓÆµÄ£¿é;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
ʹÊ.onClick.AddListener(delegate ()
|
|
{
|
|
starVideo();
|
|
});
|
|
½á¹¹.onClick.AddListener(delegate ()
|
|
{
|
|
foreach (GameObject n in ÊÓÆµ)
|
|
{
|
|
n.SetActive(false);
|
|
}
|
|
ÊÓÆµÄ£¿é.SetActive(false);
|
|
});
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
private void starVideo()
|
|
{
|
|
if (!ʹÊ.GetComponent<SelectIn>().selected)
|
|
{
|
|
ÊÓÆµÄ£¿é.SetActive(true);
|
|
foreach (GameObject n in ÊÓÆµ)
|
|
{
|
|
n.SetActive(false);
|
|
}
|
|
ÊÓÆµ[WhatScenceSelcet].SetActive(true);
|
|
}
|
|
}
|
|
}
|