/
darov
/
Platformer
Обзор
Документация
Войти
/
darov
/
Platformer
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Assets/Scripts/AnimationOnePlay.cs
25 строк
601 B
Roman Danilov
Module17_1: physics, joints, connectors, effectors
01 июл 2025, 06:03
01 июл 2025, 06:03
91a8271
Код
Авторство
О чём код?
using UnityEngine; public class AnimationOnePlay : MonoBehaviour { private Animator _animator; private string _animationClip; private void Awake() { _animator = GetComponent<Animator>(); _animationClip = GetNameAnimationClip(); _animator.Play(_animationClip); } private string GetNameAnimationClip() { AnimationClip animationClip = _animator.runtimeAnimatorController.animationClips[0]; return animationClip.name; } private void DestroyAnimatedObject() { Destroy(gameObject); } }