You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
809 B
C#
41 lines
809 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
using Duality;
|
|
using Duality.Components;
|
|
using Duality.Drawing;
|
|
using Duality.Components.Renderers;
|
|
|
|
namespace BasicMenu
|
|
{
|
|
[RequiredComponent(typeof(Camera))]
|
|
public abstract class MenuController : Component
|
|
{
|
|
private MenuPage startingMenu;
|
|
|
|
[DontSerialize]
|
|
protected MenuPage currentMenu;
|
|
|
|
/// <summary>
|
|
/// [GET / SET] The starting MenuPage that should be displayed when the Scene opens.
|
|
/// </summary>
|
|
public MenuPage StartingMenu
|
|
{
|
|
get { return this.startingMenu; }
|
|
set { this.startingMenu = value; }
|
|
}
|
|
|
|
public void SwitchToMenu(MenuPage page)
|
|
{
|
|
if (this.currentMenu != null)
|
|
{
|
|
this.currentMenu.GameObj.Active = false;
|
|
}
|
|
|
|
page.GameObj.Active = true;
|
|
this.currentMenu = page;
|
|
}
|
|
}
|
|
}
|