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); } }
void Start() { choiceMenu = GameObject.Find("Main Menu").GetComponent <ChoiceMenu>(); languageManager = GameObject.Find("Main Menu").GetComponent <LanguageManager>(); FetchResultWithoutDatabase(); StartCoroutine(UpdateResult()); StartCoroutine(Fetch()); }
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); }
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); }
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."); } }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
// 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)); }
// 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; }
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); } }
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; } }
private void Start() { choiceMenu = UIController.GetMenu <ChoiceMenu>(); gameMenu = UIController.GetMenu <GameMenu>(); }