using System.Collections; using System.Collections.Generic; using UnityEngine; namespace DTYJ { public class RenShuTrigger : MonoBehaviour { public string positionName; public static Dictionary dicCount = new Dictionary() { { "վ̨", 0 }, { "Õ¾Ìü", 0 } }; int _totalCount = 0; int totalCount { get { return _totalCount; } set { _totalCount = value; dicCount[positionName] = _totalCount; } } private void OnTriggerEnter(Collider other) { if (other.GetComponent() != null) { ++totalCount; } } private void OnTriggerExit(Collider other) { if (other.GetComponent() != null) { --totalCount; } } } }