Пример #1
0
    private static DynValue HasItem(DynValue itemName)
    {
        ItemData item = ItemData.ItemByName(itemName.String);

        Assert.IsNotNull(item);
        return(Global.Instance().Lua.Marshal(GGlobal.Instance().Party.Inventory.HasItem(item)));
    }
Пример #2
0
    private static void DeductItem(DynValue itemName)
    {
        ItemData item = ItemData.ItemByName(itemName.String);

        Assert.IsNotNull(item);
        GGlobal.Instance().Party.Inventory.DeductItem(item);
    }
Пример #3
0
    public void Populate()
    {
        inventory  = GGlobal.Instance().Party.Inventory;
        categories = ItemCategory.AllCategories();

        scrollOffset         = 0;
        categoryCursor       = 0;
        transitioning        = false;
        ItemDescription.text = "";
        ImageIcon.sprite     = null;

        ReloadCategory();
        categoryMode = (categoryItems.Count == 0);
        UpdateDisplay();
    }
Пример #4
0
    public static Global Instance()
    {
        if (instance == null)
        {
            GameObject globalObject = new GameObject();
            // debug-ish and we don't serialize scenes
            // globalObject.hideFlags = HideFlags.HideAndDontSave;
            instance = globalObject.AddComponent <Global>();
            instance.InstantiateManagers();
        }

        // this should be the only game/engine binding
        GGlobal.Instance();

        return(instance);
    }