From 88233f14746c25fec3d1ab3cdc6d3b4601920557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Pell=C3=A9?= Date: Sat, 10 Jan 2015 19:46:27 +0100 Subject: [PATCH] =?UTF-8?q?chat:=20correction=20de=20la=20couleur=20de=20s?= =?UTF-8?q?=C3=A9lection.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Une fois le chat selectionné, la nouvelle image de fond change de couleur elle aussi. --- Assets/scripts/tchat_anim.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Assets/scripts/tchat_anim.cs b/Assets/scripts/tchat_anim.cs index cb0b431..249c651 100644 --- a/Assets/scripts/tchat_anim.cs +++ b/Assets/scripts/tchat_anim.cs @@ -8,6 +8,7 @@ public class tchat_anim : MonoBehaviour { public Text charac_nb; public InputField myfield; public Text timer; + public Image img_bg; float timer_sec; int max_timer; @@ -31,8 +32,12 @@ public class tchat_anim : MonoBehaviour { //print (machine.GetInteger("etat_chat")); + if (myfield.isFocused) { + img_bg.color = Color.green; + } else + img_bg.color = Color.white; + if(machine.GetInteger("etat_chat")==0){ - myfield.textComponent.resizeTextForBestFit=false; myfield.gameObject.SetActive(true); } @@ -74,7 +79,6 @@ public class tchat_anim : MonoBehaviour { //En cas de validation du message if(Input.GetKeyDown("space") && myfield.isFocused){ - myfield.gameObject.SetActive(false); myfield.text=" "; charac_nb.text=""; print ("space pressed");