*
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class MenuShow : MonoBehaviour {
|
||||
public Button Predicate;
|
||||
private MenuManager Manager;
|
||||
public string MenuName;
|
||||
public bool ShowOnStart = false;
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
if (Predicate != null) {
|
||||
Predicate.EventClick += HandleEventClick;
|
||||
}
|
||||
Manager = GameObject.FindObjectOfType<MenuManager> ();
|
||||
|
||||
if (ShowOnStart) {
|
||||
if (Manager != null) {
|
||||
Manager.ActivateMenu(MenuName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HandleEventClick (Button sender)
|
||||
{
|
||||
if (Manager != null) {
|
||||
Manager.ActivateMenu(MenuName);
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user