edx/assignment8final/Assets/ProtoPack/Scripts/OpenAnimTest.cs
2022-11-10 21:56:29 -03:00

34 lines
379 B
C#

using UnityEngine;
using System.Collections;
public class OpenAnimTest: MonoBehaviour {
Animator anim;
bool open = false;
// Use this for initialization
void Start () {
anim = GetComponent<Animator>();
}
void OnMouseDown(){
if (!open){
open = true;
anim.SetBool("open", open);
} else {
open = false;
anim.SetBool("open", open);
}
}
}