Beispiel #1
0
    private void CreateContexts()
    {
        _contexts = new Dictionary <UiContext.Identifier, UiContext>();

        // create dialog context
        var dialogContext = new UiContext();

        dialogContext.RegisterPanel(_dialogUIPanelInstance);
        dialogContext.Dismiss();

        // create farm context
        var farmContext = new UiContext();

        farmContext.RegisterPanel(_quickSlotUIPanelInstance);
        farmContext.RegisterPanel(_ammoUIPanelInstance);
        farmContext.Dismiss();

        // create dungeon context
        var dungeonContext = new UiContext();

        dungeonContext.RegisterPanel(_quickSlotUIPanelInstance);
        dungeonContext.RegisterPanel(_ammoUIPanelInstance);
        dungeonContext.Dismiss();

        // create inventory context
        var inventoryContext = new UiContext();

        inventoryContext.RegisterPanel(_quickSlotUIPanelInstance);
        inventoryContext.RegisterPanel(_inventorySlotUIPanelInstance);
        inventoryContext.Dismiss();

        // create crafting context
        var craftingContext = new UiContext();

        craftingContext.RegisterPanel(_inventorySlotUIPanelInstance);
        craftingContext.RegisterPanel(_craftingUIPanelInstance);
        craftingContext.RegisterPanel(_recipesUIPanelInstance);
        craftingContext.Dismiss();

        var gunCraftingContext = new UiContext();

        gunCraftingContext.RegisterPanel(_gunCraftingUIPanelInstance);
        gunCraftingContext.Dismiss();

        // register all created contexts
        RegisterContext(UiContext.Identifier.Dialog, dialogContext);
        RegisterContext(UiContext.Identifier.Farm, farmContext);
        RegisterContext(UiContext.Identifier.Dungeon, dungeonContext);
        RegisterContext(UiContext.Identifier.Inventory, inventoryContext);
        RegisterContext(UiContext.Identifier.Crafting, craftingContext);
        RegisterContext(UiContext.Identifier.GunCrafting, gunCraftingContext);
    }