HomeTestScript.cs 461 B

12345678910111213141516171819
  1. using UnityEngine;
  2. public class HomeTestScript : MonoBehaviour
  3. {
  4. // Start is called once before the first execution of Update after the MonoBehaviour is created
  5. void Start()
  6. {
  7. GameObject dog = GameObject.Find("dog");
  8. Animator animator = dog.GetComponent<Animator>();
  9. animator.Play("sleep2");
  10. //animator.SetBool("isSleep", true);
  11. }
  12. // Update is called once per frame
  13. void Update()
  14. {
  15. }
  16. }