64 lines
1.7 KiB
C#
64 lines
1.7 KiB
C#
|
|
using System.Collections;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using UnityEngine;
|
|||
|
|
using UnityEngine.UI;
|
|||
|
|
using UnityEngine.SceneManagement;
|
|||
|
|
|
|||
|
|
public class Gamification_HUDControl : MonoBehaviour
|
|||
|
|
{
|
|||
|
|
public Animator anim;
|
|||
|
|
public Text gameTitleTxt, gameDescTxt;
|
|||
|
|
public static Gamification_HUDControl instance;
|
|||
|
|
public int sceneToLoad = 0;
|
|||
|
|
private Gamification_GameInfo toShow;
|
|||
|
|
|
|||
|
|
Animator animeCamera;
|
|||
|
|
|
|||
|
|
public void Awake()
|
|||
|
|
{
|
|||
|
|
instance = this;
|
|||
|
|
animeCamera = GameObject.Find("CameraMove").GetComponent<Animator>();
|
|||
|
|
if (Camera.main.name != "Main Camera")
|
|||
|
|
{
|
|||
|
|
Destroy(GameObject.Find("MainMenu Camera").gameObject);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//Destroy(transform.Find("Begin-Ending").gameObject, 2);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void ReceiveInfo(Gamification_GameInfo rInfo, int n)
|
|||
|
|
{
|
|||
|
|
Debug.Log("Scene is: " + n);
|
|||
|
|
toShow = rInfo;
|
|||
|
|
sceneToLoad = n;
|
|||
|
|
DisplayInfo();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void DisplayInfo()
|
|||
|
|
{
|
|||
|
|
if (toShow != null)
|
|||
|
|
{
|
|||
|
|
anim.SetTrigger("Display");
|
|||
|
|
gameTitleTxt.text = toShow.gameTitle;
|
|||
|
|
gameDescTxt.text = toShow.gameDescription;
|
|||
|
|
Gamification_CameraMove.instance.dif = new Vector2(4, 0);
|
|||
|
|
Gamification_PlayerMove.instance.SetAnime(true);
|
|||
|
|
animeCamera.SetBool("zoom", true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void HideInfo()
|
|||
|
|
{
|
|||
|
|
anim.SetTrigger("Hide");
|
|||
|
|
Gamification_CameraMove.instance.dif = new Vector2(0, 0);
|
|||
|
|
Gamification_PlayerMove.instance.SetAnime(false);
|
|||
|
|
animeCamera.SetBool("zoom", false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void LoadGame()
|
|||
|
|
{
|
|||
|
|
Debug.Log("Scene Loading: " + sceneToLoad);
|
|||
|
|
SceneManager.LoadSceneAsync(sceneToLoad, LoadSceneMode.Single);
|
|||
|
|
}
|
|||
|
|
}
|