/
darov
/
Platformer
Обзор
Документация
Войти
/
darov
/
Platformer
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Assets/Scripts/CollisionFunctions/CollectItem.cs
21 строка
455 B
Roman Danilov
comment
15 окт 2025, 07:53
15 окт 2025, 07:53
80f1cc3
Код
Авторство
О чём код?
using UnityEngine; public class CollectItem : MonoBehaviour, ITriggerFunction { [SerializeField] private bool _isCherry; public void EnableFunction(GameObject other) { if (other.TryGetComponent(out ICountScore score)) { if (_isCherry) { score.Cherries++; } else { score.Acorns++; } } } }