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