using System.Collections; using System.Collections.Generic; using UnityEngine; public class ScoreTrigger : MonoBehaviour { void Start() { } void Update() { } private void OnTriggerEnter(Collider other) { if (other.TryGetComponent(out Wall collider)) { UIControl.Instance.AddScore(Mathf.RoundToInt(collider.transform.localScale.x * 10)); } } }