akadoc/Assets/scripts/tchat_anim.cs

39 lines
564 B
C#

using UnityEngine;
using System.Collections;
public class tchat_anim : MonoBehaviour {
public Animator anim;
// Use this for initialization
void Start () {
}
void Awake(){
anim = gameObject.GetComponent<Animator> ();
anim.SetBool ("etat_tchat",false);
}
// Update is called once per frame
void Update () {
}
void OnMouseDown(){
//Move to position
if (anim.GetBool ("etat_tchat") == false) {
anim.SetBool ("etat_tchat", true);
}
if (anim.GetBool ("etat_tchat") == true) {
anim.SetBool ("etat_tchat", false);
}
}
}