Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        DataManager.Instance.Latch(this);
        if (!DataManager.Instance.AuthEstablished)
        {
            DataManager.Instance.BypassAuth("DEV [email protected]");
        }


        StartCoroutine(DataManager.Instance.FetchInitialData(success =>
        {
            if (!success)
            {
                return;
            }

            userBots = new List <BotInfo>(DataManager.Instance.AllBots);


            IEnumerator <BotInfo> userBotEnum = userBots.GetEnumerator();
            userBotEnum.MoveNext();
            foreach (var bot in userBotArray)
            {
                bot.BotInfo = userBotEnum.Current;
                botPreviews.Add(bot.gameObject);
                userBotEnum.MoveNext();
            }
            userBotEnum.Dispose();

            userTeams = DataManager.Instance.UserTeams;
            BotPreviewGenerator.BotGenerators = botPreviews;
            BotPreviewGenerator.CreateAllBotImages();
            defaultBody    = DataManager.Instance.GetPart(100);
            defaultBotInfo = new BotInfo(0, "default", 0, new List <PartInfo>(), defaultBody, new List <BehaviorInfo>());
            InstantiateTeams();
        }));
    }
Ejemplo n.º 2
0
 //Generates all of the bot images for the current user's bots
 private void CreateAllBotImages()
 {
     BotPreviewGenerator.BotGenerators = BotGenerators;
     BotGenerators.ForEach(BotPreviewGenerator.ClearBotImage);
     BotPreviewGenerator.CreateAllBotImages();
 }
Ejemplo n.º 3
0
 //Generates all of the bot images for the current user's bots
 public static void CreateBotPreviews()
 {
     BotPreviewGenerator.BotGenerators = Instance.selectableBotPreviews;
     BotPreviewGenerator.CreateAllBotImages();
 }