52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
|
using UnityEngine;
|
|||
|
using System.Collections;
|
|||
|
|
|||
|
public class Gui_OnClickChangeUi : MonoBehaviour {
|
|||
|
|
|||
|
public GameObject Canvas_chat;
|
|||
|
public GameObject dead_list;
|
|||
|
public Gui_ChatWindow chatWindow;
|
|||
|
public Vector3 chatPosition;
|
|||
|
public Vector3 deadListPosition;
|
|||
|
|
|||
|
public CanvasGroup cg;
|
|||
|
|
|||
|
// Use this for initialization
|
|||
|
void Start () {
|
|||
|
//manage canvas chat
|
|||
|
Canvas_chat = GameObject.Find("Canvas_chat");
|
|||
|
chatPosition = Canvas_chat.transform.localPosition;
|
|||
|
Canvas_chat.transform.localPosition = new Vector3(1000, 1000);
|
|||
|
|
|||
|
//manage dead_list
|
|||
|
dead_list = GameObject.Find("dead_list");
|
|||
|
deadListPosition = dead_list.transform.localPosition;
|
|||
|
dead_list.transform.localPosition = new Vector3(1000, 1000);
|
|||
|
//canvas.GetComponentInChildren();
|
|||
|
}
|
|||
|
|
|||
|
void OnMouseDown()
|
|||
|
{
|
|||
|
//Manage show/hide status of canvas (hidden by default, shown when the user clicks on the associate building)
|
|||
|
switch (this.gameObject.name)
|
|||
|
{
|
|||
|
case "Maison":
|
|||
|
Debug.logger.Log("Maison !");
|
|||
|
break;
|
|||
|
case "Taverne":
|
|||
|
Debug.logger.Log("Taverne !");
|
|||
|
Canvas_chat.transform.localPosition = chatPosition;
|
|||
|
break;
|
|||
|
case "eglise_mdl":
|
|||
|
Debug.logger.Log("Eglise !");
|
|||
|
dead_list.transform.localPosition = deadListPosition;
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
// Update is called once per frame
|
|||
|
void Update () {
|
|||
|
|
|||
|
}
|
|||
|
}
|