private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } if (!PlayerPrefs.HasKey("VIBRATION")) { PlayerPrefs.SetInt("VIBRATION", 1); VibrationButton.GetComponent <Image>().sprite = on; } else { if (PlayerPrefs.GetInt("VIBRATION") == 1) { VibrationButton.GetComponent <Image>().sprite = on; } else { VibrationButton.GetComponent <Image>().sprite = off; } } if (PlayerPrefs.GetInt("FromMenu") == 1) { ContinueText.SetActive(false); PlayerPrefs.SetInt("FromMenu", 0); } else { PlayText.SetActive(false); } currentLevel = PlayerPrefs.GetInt("LevelId"); LevelText.text = currentLevel.ToString(); NeededPeopleCount.text = playerController.NeededPeopleCount.ToString(); CurrentPeopleCount.text = "0"; Application.targetFrameRate = 60; maxAmount = Vector3.Distance(FinishTransform.position, BullTransform.position); UpdateLevelStateImage(); }
public PopupQuestion(string text, string negative, string positive) { QuestionText = text; NegativeText = negative; PositiveText = positive; InitializeComponent(); MessageText.SetBinding(TextBlock.TextProperty, new Binding("QuestionText") { Source = this }); CancelText.SetBinding(TextBlock.TextProperty, new Binding("NegativeText") { Source = this }); ContinueText.SetBinding(TextBlock.TextProperty, new Binding("PositiveText") { Source = this }); Loaded += (o, e) => { Topmost = false; }; }