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.
53 lines
1.1 KiB
53 lines
1.1 KiB
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class NewBehaviourScript : MonoBehaviour
|
|
{
|
|
// Start is called before the first frame update
|
|
public GameObject[] games;
|
|
public GameObject xuanxiang2, xuanxiang2anniu;
|
|
public int id, querenID;
|
|
public GameObject xuanxiang3, xuanxiang3anniu;
|
|
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
public void Set(int offect)
|
|
{
|
|
id += offect;
|
|
if(id> games.Length-1)
|
|
{
|
|
id = 0;
|
|
}
|
|
if(id<0)
|
|
{
|
|
id = games.Length - 1;
|
|
}
|
|
for (int i = 0; i < games.Length; i++)
|
|
{
|
|
games[i].SetActive(false);
|
|
}
|
|
games[id].SetActive(true);
|
|
|
|
}
|
|
public void queren()
|
|
{if (id == querenID)
|
|
{
|
|
|
|
xuanxiang2anniu.SetActive(false);
|
|
xuanxiang2.SetActive(false);
|
|
xuanxiang3.SetActive(true);
|
|
if (xuanxiang3anniu != null)
|
|
{ xuanxiang3anniu.SetActive(true); }
|
|
}
|
|
}
|
|
}
|