diff --git a/Assets/scripts/OnClickChangeUI.cs b/Assets/scripts/OnClickChangeUI.cs new file mode 100644 index 0000000..59e2e25 --- /dev/null +++ b/Assets/scripts/OnClickChangeUI.cs @@ -0,0 +1,55 @@ +using UnityEngine; +using System.Collections; + +public class OnClickChangeUI : MonoBehaviour +{ + + private GameObject GOinstance; + private GameObject chat; + private GameObject deadlist; + Vector3 chatPos; + Vector3 deadListPos; + Vector3 away; + + // Use this for initialization + void Start() + { + GOinstance = this.gameObject; + chat = GameObject.Find("Canvas_chat"); + deadlist = GameObject.Find("dead_list"); + + chatPos = new Vector3(-14.64F, 15.23F, 6.039996F); //chat.transform.position; + deadListPos = new Vector3(-2.162F, 0.115F, 3.507F);//deadlist.transform.position; + away = new Vector3(1000, 1000); + + chat.transform.localPosition = away; + deadlist.transform.localPosition = away; + + Debug.Log("chat : " + chatPos); + Debug.Log("dead : " + deadListPos); + } + + void OnMouseDown() + { + switch (GOinstance.transform.name) + { + case "Taverne": + chat.transform.localPosition = chatPos; + Debug.Log("Taverne"); + break; + case "eglise_mdl": + deadlist.transform.localPosition = deadListPos; + Debug.Log("eglise"); + break; + + default: + break; + } + } + + // Update is called once per frame + void Update() + { + + } +}