ShanxiKnowledgeBase/SXElectricalInspection/Assets/GuYuan/Interactive/BoxPengZhuang.cs

47 lines
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BoxPengZhuang : MonoBehaviour
{
[SerializeField] Dialogue g1;
[SerializeField] string name;
[SerializeField] string dialogue;
public bool isok = false;
[SerializeField] GameObject g12;
[SerializeField] int socre = 2;
[SerializeField] string tips = "³öʾ¹¤×÷Ö¤";
[SerializeField] int id = 3;
// Start is called before the first frame update
void Start()
{
WorkingPersonnel.instance.init();
if (UIManager.Instance.ganTanHao)
{
if (UIManager.Instance.ganTanHao.KeyGanTanHao.ContainsKey(GlobalFlag.userId)&&UIManager.Instance.isBox)
{
gameObject.SetActive(false);
}
}
}
private async void OnTriggerEnter(Collider other)
{
if (UIManager.Instance.ganTanHao)
{
if (other.name.Equals(name))
{
g1.gameObject.SetActive(true);
g1.init(dialogue);
if (!UIManager.Instance.ganTanHao.KeyGanTanHao.ContainsKey(GlobalFlag.userId))
{
gameObject.SetActive(false);
UIManager.Instance.isBox = true;
}
await FractionManager.Instance.overAsync(3, 2, "¹¤×÷Ö¤");
gameObject.SetActive(false);
}
}
}
}