Пример #1
0
    static void ImportActor(CommandTerminal.CommandArg[] args)
    {
        CreationLibrarySidebar inst = GameObject.FindObjectOfType <CreationLibrarySidebar>();

        if (inst == null)
        {
            GameBuilderConsoleCommands.Log($"Please open the custom actor library (via Creation Library) before using this command.");
            return;
        }
        string path = GameBuilderConsoleCommands.JoinTailToPath(args);

        if (path != null)
        {
            inst.ImportFromPath(path);
        }
    }
Пример #2
0
    static void ImportCards(CommandTerminal.CommandArg[] args)
    {
        CardLibrary inst = GameObject.FindObjectOfType <CardLibrary>();

        if (inst == null)
        {
            GameBuilderConsoleCommands.Log($"Please open the card library (via Logic Tool) before using this command.");
            return;
        }
        string path = GameBuilderConsoleCommands.JoinTailToPath(args);

        if (path != null)
        {
            inst.ImportLocalByPath(new string[] { path });
        }
    }
Пример #3
0
    static void CommandWorkshopTest(CT.CommandArg[] args)
    {
        var source = FindObjectOfType <WorkshopAssetSource>();
        var dir    = Util.CreateTempDirectory();

        File.WriteAllText(Path.Combine(dir, "hello.txt"), "hellllo world");
        source.Put(dir, "test from console", "this is just a test", SteamUtil.GameBuilderTags.FBX, null, null, maybeId =>
        {
            GameBuilderConsoleCommands.Log($"Put result: {maybeId}");

            if (!maybeId.IsEmpty())
            {
                source.Get(maybeId.Value, maybePath =>
                {
                    GameBuilderConsoleCommands.Log($"Get result: {maybePath}");
                    if (!maybePath.IsEmpty())
                    {
                        var actual = File.ReadAllText(Path.Combine(maybePath.Value, "hello.txt"));
                        GameBuilderConsoleCommands.Log($"actual contents: {actual}");
                    }
                });
            }
        });
    }