From 5c0e52b7791314a26d552069250e6ee908cc8999 Mon Sep 17 00:00:00 2001 From: Marc Pouliquen Date: Thu, 4 Feb 2016 18:54:27 +0100 Subject: [PATCH] fixing issue : position parameters of the chat/deadlist are now hard-coded. refs issue6 --- Assets/scripts/OnClickChangeUI.cs | 55 +++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Assets/scripts/OnClickChangeUI.cs 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() + { + + } +}