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; } GetComponent().CompletedorNot = true; } } }