//Creates a menu based on the definition in the object's Menu method
        public override void CreateMenu(IMetamodelBuilder metamodel)
        {
            var menu = new MenuImpl(metamodel, method.DeclaringType, false, GetMenuName(Spec));

            InvokeUtils.InvokeStatic(method, new object[] { menu });
            Menu = menu;
        }
예제 #2
0
        public void CreateDefaultMenu(IMetamodelBuilder metamodel, Type type, string menuName, string id)
        {
            var menu = new MenuImpl(metamodel, type, false, menuName)
            {
                Id = id
            };

            menu.AddRemainingNativeActions();
            menu.AddContributedActions();
            Menu = menu;
        }
예제 #3
0
    void Setup()
    {
        GuiBindInData inData = new GuiBindInData(null, null);

        PrefabReplacer[] componentsInChildren = this._layout.GetComponentsInChildren <PrefabReplacer>(true);
        for (int i = 0; i < componentsInChildren.Length; i++)
        {
            componentsInChildren[i].Apply();
        }
        GuiBindData data;

        if (this._layoutIsPrefab)
        {
            data = GuiNode.CreateAndConnect(this._layout, inData);
        }
        else
        {
            data = GuiNode.Connect(this._layout, inData);
        }
        this.menuImpl = new MenuImpl <PauseMenu>(this);
        this.menuImpl.AddScreen(new PauseMenu.MainScreen(this, "pauseRoot", data));
        this.menuImpl.AddScreen(new PauseMenu.OptionsScreen(this, "optionsRoot", data));
        this.menuImpl.AddScreen(new PauseMenu.MapScreen(this, "mapRoot", data));
        this.menuImpl.AddScreen(new PauseMenu.InfoScreen(this, "infoRoot", data));
        this.menuImpl.AddScreen(new PauseMenu.ItemScreen(this, "itemRoot", data));
        this.menuImpl.AddScreen(new PauseMenu.CardsScreen(this, "cardsRoot", data));
        if (this._debugMenu != null)
        {
            this.menuImpl.AddScreen(new PauseMenu.DebugScreen(this, "debugRoot", data));
        }
        PerPlatformData.DebugCodeData debugCode = PlatformInfo.Current.DebugCode;
        if (debugCode != null && debugCode.useOverride)
        {
            this._debugStartCode     = debugCode.startCode;
            this._debugStartSequence = debugCode.sequence;
        }
    }
예제 #4
0
 public static void Compare(MenuImpl menu1, MenuImpl menu2, string name)
 {
     Compare(menu1.SuperMenu, menu2.SuperMenu, name);
     Compare(menu1 as IMenu, menu2, name);
 }
 protected MenuFacetAbstract(ISpecification holder)
     : base(typeof(IMenuFacet), holder)
 {
     Menu = null;
 }