Esempio n. 1
0
 void Awake()
 {
     Debug.Assert(main == null);
     Util.FindIfNotSet(this, ref logHandler);
     Util.FindIfNotSet(this, ref behaviorSystem);
     Util.FindIfNotSet(this, ref voosEngine);
     Util.FindIfNotSet(this, ref monkeyTester);
     Util.FindIfNotSet(this, ref workshop);
     main = this;
 }
Esempio n. 2
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);
        }
    }
Esempio n. 3
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 });
        }
    }
Esempio n. 4
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}");
                    }
                });
            }
        });
    }