YiHe_AllVersion/YHWeb/Assets/YHElectric/Scripts/Helper/FloorController.cs

64 lines
1.8 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FloorController : MonoBehaviour
{
public static FloorController instance;
public GameObject bgl;
public GameObject floor1;
public GameObject floor2;
public GameObject floor3;
public GameObject bglTouMing;
public GameObject floor1TouMing;
public GameObject floor2TouMing;
public GameObject floor3TouMing;
private void Awake()
{
instance = this;
ShowFloor1(4);
}
private void Start()
{
}
public void ShowFloor1(int index)
{
bgl.SetActive(false);
bglTouMing.SetActive(false);
floor1.SetActive(false);
floor2.SetActive(false);
floor3.SetActive(false);
floor1TouMing.SetActive(false);
floor2TouMing.SetActive(false);
floor3TouMing.SetActive(false);
switch (index)
{
case 1:
bglTouMing.SetActive(true);
floor1.SetActive(true);
floor2TouMing.SetActive(true);
floor3TouMing.SetActive(true);
break;
case 2:
bglTouMing.SetActive(true);
floor2.SetActive(true);
floor1TouMing.SetActive(true);
floor3TouMing.SetActive(true);
break;
case 3:
bglTouMing.SetActive(true);
floor3.SetActive(true);
floor1TouMing.SetActive(true);
floor2TouMing.SetActive(true);
break;
case 4:
bgl.SetActive(true);
floor1.SetActive(false);
floor2.SetActive(false);
floor3.SetActive(false);
break;
}
}
}