39 lines
793 B
C#
39 lines
793 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class ClcikLight : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// 被点击的红绿灯模型
|
|
/// </summary>
|
|
public GameObject lightobj;
|
|
/// <summary>
|
|
/// 控制红绿灯1
|
|
/// </summary>
|
|
public GameObject ControllightPanel1;
|
|
/// <summary>
|
|
/// 控制红绿灯2
|
|
/// </summary>
|
|
public GameObject ControllightPanel2;
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
public void OnMouseDown()
|
|
{
|
|
if (lightobj.name == "1号红绿灯")
|
|
{
|
|
ControllightPanel1.SetActive(true);
|
|
ControllightPanel2.SetActive(false);
|
|
|
|
}
|
|
else
|
|
{
|
|
ControllightPanel1.SetActive(false);
|
|
ControllightPanel2.SetActive(true);
|
|
}
|
|
}
|
|
}
|