Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
Marc Pouliquen | 8a654b7d22 | |
Marc Pouliquen | 8c08e4c1f3 | |
Marc Pouliquen | afc4447e8d | |
Marc Pouliquen | 5c0e52b779 | |
Marc Pouliquen | 8b5a9975b3 |
4317
Assets/scene.unity
4317
Assets/scene.unity
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,51 @@
|
|||
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 () {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.Events;
|
||||
|
||||
public class Gui_VotePendre : MonoBehaviour {
|
||||
|
||||
private Button votePenduInnocentButton;
|
||||
private Button votePenduCoupableButton;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
votePenduInnocentButton = GameObject.Find("ButtonInnocent").GetComponent<Button>();
|
||||
votePenduCoupableButton = GameObject.Find("ButtonCoupable").GetComponent<Button>();
|
||||
|
||||
votePenduInnocentButton.interactable = true;
|
||||
votePenduCoupableButton.interactable = true;
|
||||
|
||||
votePenduInnocentButton.GetComponentInChildren<Text>().text = "test";
|
||||
|
||||
votePenduInnocentButton.onClick.AddListener(() => InnocentClicked());
|
||||
votePenduCoupableButton.onClick.AddListener(() => CoupableClicked());
|
||||
|
||||
}
|
||||
|
||||
void InnocentClicked()
|
||||
{
|
||||
Debug.Log("Innocent");
|
||||
}
|
||||
|
||||
void CoupableClicked()
|
||||
{
|
||||
Debug.Log("Coupable");
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class OnClickChangeUI : MonoBehaviour
|
||||
{
|
||||
|
||||
private GameObject GOinstance;
|
||||
private GameObject chat;
|
||||
private GameObject deadlist;
|
||||
private GameObject votePendu;
|
||||
CanvasGroup votePenduCanvas;
|
||||
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");
|
||||
votePendu = GameObject.Find("PanelVotePendu");
|
||||
|
||||
chatPos = new Vector3(-14.64F, 15.23F, 6.039996F); //chat.transform.position;
|
||||
deadListPos = new Vector3(-2.162F, 0.115F, 3.507F);//deadlist.transform.position;
|
||||
votePenduCanvas = votePendu.GetComponent<CanvasGroup>();
|
||||
//votePenduCanvas.alpha = 0;
|
||||
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;
|
||||
case "arbre_pendus_mdl":
|
||||
votePenduCanvas.alpha = 1;
|
||||
Debug.Log("pendu");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue