Ejemplo n.º 1
0
    void Update()
    {
        if (isGameStarted)
        {
            currentGameTime = Time.time - startGameTime;
            if (currentGameTime > gameTime)
            {
                endOfGame = true;
            }
            if (lastLevel != DeserializeJson.instance.points / pointPerLevel)
            {
                lastLevel = DeserializeJson.instance.points / pointPerLevel;
                if (lastLevel % 10 == 0)
                {
                    ChoiceMenu.SetUpgradeCards(gunUpgradeList[indexGunUpgradeList], swordUpgradeList[indexSwordUpgradeList], otherUpgradeList[indexOtherUpgradeList]);
                }
                else
                {
                    ChoiceMenu.SetUpgradeCards(stat1UpgradeList[indexStatUpgradeList].type, stat2UpgradeList[indexStatUpgradeList].type, stat3UpgradeList[indexStatUpgradeList].type);
                }
            }
            scoreTExt.text = (DeserializeJson.instance.points / pointPerLevel).ToString();
        }

        if (endOfGame)
        {
            StartCoroutine("saveGame");
            SceneManager.UnloadSceneAsync("Scenes/Game");
            SceneManager.LoadScene("Scenes/MenuLost", LoadSceneMode.Additive);
        }
    }
Ejemplo n.º 2
0
    void Start()
    {
        choiceMenu      = GameObject.Find("Main Menu").GetComponent <ChoiceMenu>();
        languageManager = GameObject.Find("Main Menu").GetComponent <LanguageManager>();

        FetchResultWithoutDatabase();
        StartCoroutine(UpdateResult());
        StartCoroutine(Fetch());
    }
Ejemplo n.º 3
0
    static public void SetUpgradeCards(AMJ.GunUpgrade gunCard, AMJ.SwordUpgrade swordCard, AMJ.OtherUpgrade otherCard)
    {
        CharacterController.Instance.menuChoice.SetActive(true);
        instance          = CharacterController.Instance.menuChoice.GetComponent <ChoiceMenu>();
        instance.timeOpen = Time.unscaledTime;

        instance.cards[0].Set(gunCard);
        instance.cards[1].Set(swordCard);
        instance.cards[2].Set(otherCard);
    }
Ejemplo n.º 4
0
    static public void SetUpgradeCards(Stat.Type card1, Stat.Type card2, Stat.Type card3)
    {
        CharacterController.Instance.menuChoice.SetActive(true);
        instance          = CharacterController.Instance.menuChoice.GetComponent <ChoiceMenu>();
        instance.timeOpen = Time.unscaledTime;

        instance.cards[0].Set(card1);
        instance.cards[1].Set(card2);
        instance.cards[2].Set(card3);
    }
Ejemplo n.º 5
0
        static async Task Main(string[] args)
        {
            Console.WriteLine(@"
      __ _ _____   _ _ __ ___ 
     / _` |_  / | | | '__/ _ \
    | (_| |/ /| |_| | | |  __/
     \__,_/___|\__,_|_|  \___|
            ");

            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            var configuration = builder.Build();

            var azConfig = configuration.GetSection("AzureAD");

            var clientId     = azConfig["CLIENTID"];
            var clientSecret = azConfig["CLIENTSECRET"];
            var tenantId     = azConfig["TENANTID"];
            var subscription = azConfig["SUBSCRIPTION"];

            APICaller client = new APICaller(subscription, tenantId, clientId, clientSecret);

            if (await client.Login())
            {
                MenuItem selectedApp = new MenuItem();
                while (selectedApp != null)
                {
                    var response = await client.Get("https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites?api-version=2019-08-01");

                    if (!string.IsNullOrEmpty(response))
                    {
                        var        applications = AppServiceApplications.FromJson(response);
                        ChoiceMenu menu         = new ChoiceMenu();
                        foreach (var item in applications.Value.OrderBy(o => o.Name))
                        {
                            menu.Options.Add(new MenuItem
                            {
                                Title = $"{item.Name.PadRight(50, ' ')}{item.Properties.State}",
                                Value = item.Id,
                            });
                        }
                        selectedApp = menu.ReadChoice(true);

                        //TODO: Do something with selected app
                    }
                }
            }
            else
            {
                Console.WriteLine("Please check your settings.");
            }
        }
Ejemplo n.º 6
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 7
0
 // Start is called before the first frame update
 void Start()
 {
     direction = 0;
     animator  = gameObject.GetComponent <Animator>();
     audio     = gameObject.GetComponent <AudioSource>();
     PlayRolling();
     canMoveLeft  = true;
     canMoveRight = true;
     sceneMover   = (SceneMovementManager)GameObject.FindObjectOfType(typeof(SceneMovementManager));
     choiceMenu   = (ChoiceMenu)GameObject.FindObjectOfType(typeof(ChoiceMenu));
     finalScore   = (FinalScoreHandler)GameObject.FindObjectOfType(typeof(FinalScoreHandler));
 }
Ejemplo n.º 8
0
 // Start is called before the first frame update
 void Start()
 {
     if (instance == null || instance == this)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
     Time.timeScale  = 0;
     activeCardIndex = 1;
     moving          = false;
 }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            ChoiceMenu menu = new ChoiceMenu(new Settings
            {
                IntroText = "Welcome to a multiple choice menu demo..."
            });

            menu.Options.Add(new MenuItem
            {
                Title = "C#",
                Value = "1"
            });
            menu.Options.Add(new MenuItem
            {
                Title = "javascript",
                Value = "2"
            });
            menu.Options.Add(new MenuItem
            {
                Title = "typescript",
                Value = "3"
            });
            menu.Options.Add(new MenuItem
            {
                Title = "python",
                Value = "4"
            });
            menu.Options.Add(new MenuItem
            {
                Title = "swift",
                Value = "5"
            });

            var selectedLanguage = menu.ReadChoice(true);

            if (selectedLanguage == null)
            {
                Console.WriteLine("Cancelled");
            }
            else
            {
                Console.WriteLine(selectedLanguage.Title);
            }
        }
Ejemplo n.º 10
0
        static void MenuAction(ChoiceMenu option)
        {
            switch (option)
            {
            case ChoiceMenu.R:
                AskForTrainProperties();
                Start();
                break;

            case ChoiceMenu.S:
                break;

            case ChoiceMenu.B:
                AskForTrainToDelete();
                Start();
                break;

            default:
                break;
            }
        }
Ejemplo n.º 11
0
 private void Start()
 {
     choiceMenu = UIController.GetMenu <ChoiceMenu>();
     gameMenu   = UIController.GetMenu <GameMenu>();
 }