1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class DangJianManager : MonoBehaviour
- {
- public List<GameObject> oldList;
- public List<GameObject> newList;
- public List<GameObject> sound;
- private void Start()
- {
- for (int i = 0; i < oldList.Count; i++)
- {
- oldList[i].SetActive(true);
- newList[i].SetActive(false);
- sound[i].SetActive(false);
- }
- }
- public void show(int index)
- {
- for (int i = 0; i < oldList.Count; i++)
- {
- if (index == i)
- {
- oldList[i].SetActive(false);
- newList[i].SetActive(true);
- sound[i].SetActive(true);
- }
- else
- {
- oldList[i].SetActive(true);
- newList[i].SetActive(false);
- sound[i].SetActive(false);
- }
- }
- }
- public void hide(int index)
- {
- /*
- for (int i = 0; i < oldList.Count; i++)
- {
- if (index == i)
- {
- oldList[i].SetActive(true);
- newList[i].SetActive(false);
- sound[i].SetActive(false);
- }
- }*/
- }
- }
|