using UnityEngine; using System.Collections; public class tchat_anim : MonoBehaviour { public Animator anim; // Use this for initialization void Start () { } void Awake(){ anim = gameObject.GetComponent (); 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); } } }