Nextrek
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
/*
*
* Adventure Creator
* by Chris Burton, 2013-2014
*
* "MenuSystem.cs"
* This script can be used to add extra functionality to menus.
* When a menu is enabled, OnMenuEnable is called,
* and when an element is clicked on, OnElementClick is (optionally) called.
*
*/
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace AC
{
public class MenuSystem : MonoBehaviour
{
public static void OnMenuEnable (Menu _menu)
{
// This function is called whenever a menu is enabled.
if (_menu.title == "Pause")
{
MenuElement saveButton = _menu.GetElementWithName ("SaveButton");
if (saveButton)
{
saveButton.isVisible = !PlayerMenus.IsSavingLocked ();
}
_menu.Recalculate ();
}
}
public static void OnElementClick (Menu _menu, MenuElement _element, int _slot, int _buttonPressed)
{
// This function is called whenever a clickable element has a click type of "Custom Script".
}
}
}
|
Revision |
Author |
Commited |
Message |
83
|
FMMortaroli
|
Tue 13 May, 2014 11:32:51 +0000 |
|