E_ElecCompetition/Electrical_inspectionCompet.../Assets/Script/Interactive/BoxPengZhuang.cs

32 lines
772 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BoxPengZhuang : MonoBehaviour
{
[SerializeField] Dialogue g1;
[SerializeField] string name;
[SerializeField] string dialogue;
[SerializeField] Fraction fraction;
// Start is called before the first frame update
void Start()
{
}
private void OnTriggerEnter(Collider other)
{
if (other.name.Equals(name))
{
g1.gameObject.SetActive(true);
g1.init(dialogue);
if (fraction)
{
fraction.CompletedorNot = true;
}
PlayerPrefs.SetString("isWorkingPersonnel", "1");
GetComponent<Fraction>().CompletedorNot = true;
}
}
}