Проблема в том, что я не могу найти никакого материала по этой теме.
Вот скрипт:
Синтаксис:
Используется csharp
using UnityEngine;
using System.Collections;
public class AnimPlay : MonoBehaviour
{
private Animator anim;
public GameObject Obj;
void Start()
{
anim = GetComponent<Animator>();
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
if (null != anim)
{
anim.Play("Rotation1", 0, 0f);
Obj.gameObject.SetActive(false);
StartCoroutine(Wait(0.9f));
}
}
}
private IEnumerator Wait(float seconds)
{
yield return new WaitForSeconds(0.9f);
Obj.gameObject.SetActive(true);
}
}
using System.Collections;
public class AnimPlay : MonoBehaviour
{
private Animator anim;
public GameObject Obj;
void Start()
{
anim = GetComponent<Animator>();
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
if (null != anim)
{
anim.Play("Rotation1", 0, 0f);
Obj.gameObject.SetActive(false);
StartCoroutine(Wait(0.9f));
}
}
}
private IEnumerator Wait(float seconds)
{
yield return new WaitForSeconds(0.9f);
Obj.gameObject.SetActive(true);
}
}
Пишите если нужна доп. информация.
Буду благодарен вам за любую поддержку, будь то ссылка на туториал или помощь со скриптом.