/// <summary> /// initialize feature /// </summary> public override void OnInitialInstance() { // UWP control preparation if (TargetListView == null) { Kill(new NullReferenceException("FeatureJitTemplateListPanel must have FeatureJitTemplateListPanel={Bind:****}")); return; } TargetListView.ItemsSource = Hot.TemplateList; TargetListView.SelectionChanged += TargetListView_SelectionChanged; // Add default template chip DelayUtil.Start(TimeSpan.FromMilliseconds(200), () => { AddTemplateChip("@Default", Colors.Yellow, "Free GUI space"); TargetListView.SelectedItem = Hot.TemplateList.First(); // auto select the new item }); // Template Name Parts Pane.Target = Pane["LogPanel"]; // to get priority draw layer BarParts = new PartsActiveTemplate { }; Parts.Add(Pane.Target, BarParts, LAYER.ActiveTemplate); }
private void showCopiedText(TextBlock tar) { IEnumerable <TextBlock> ls = new[] { CopiedAccount, CopiedPassword, CopiedEmail }; // Enum labeled "Copied password" foreach (var l in ls.Where(a => ReferenceEquals(a, tar) == false)) { l.Visibility = Visibility.Collapsed; } tar.Visibility = Visibility.Visible; DelayUtil.Start(TimeSpan.FromSeconds(1), () => tar.Visibility = Visibility.Collapsed); }
protected override void OnNavigatedTo(NavigationEventArgs e) { if (e.NavigationMode == NavigationMode.New) { DelayUtil.Start(TimeSpan.FromMilliseconds(97), () => { var dmy = AuthenticateAsync(); }); } base.OnNavigatedTo(e); }
private void FocusLane(int level) { DelayUtil.Start(TimeSpan.FromMilliseconds(20), () => { // auto scroll to show new cassette var alane = Screen.Children.Where(a => ((FrameworkElement)a).Name.StartsWith("Level_")).FirstOrDefault() as FrameworkElement; ScrollView.HorizontalScrollMode = ScrollMode.Enabled; ScrollView.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible; ScrollView.ChangeView(alane.Width * (level - 1), null, null, false); }); }
private void Awake() { if (_instance == null) { _instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); return; } }
private void ProcessTurn() { PreviousBattleActions = battleActions; foreach (KeyValuePair <int, BattleAction> entry in battleActions) { FighterController fc = FighterControllers[entry.Key]; fc.ActionRenderer.sprite = DataManager.Instance.BattleActionIcons[entry.Value.ActionType]; FighterController targetFC = FighterControllers[entry.Value.Target]; BattleActionResults bars = DataManager.Instance.BattleActionResults[entry.Value.ActionType]; float receivedDamage = 0; foreach (var bar in bars.BattleActionResultList) { if (bar.ActionType == battleActions[entry.Value.Target].ActionType) { receivedDamage = bar.ReceivingDamage; } } fc.Health -= receivedDamage; } DelayUtil.WaitForSeconds(TurnCooldownSeconds + 1, () => { foreach (KeyValuePair <int, BattleAction> entry in battleActions) { FighterControllers[entry.Key].ClearActionIcon(); } battleActions = new Dictionary <int, BattleAction>(); Dictionary <int, float> healthFighters = new Dictionary <int, float>(); foreach (KeyValuePair <int, FighterController> entry in FighterControllers) { healthFighters.Add(entry.Key, entry.Value.Health); } int loser = GetRoundLoser(healthFighters); if (loser >= 0) { RoundEnd(loser, FighterControllers); } else { turnInProgress = false; } }); }
protected override void OnNavigatedTo(NavigationEventArgs e) { // Reset control state StartButton.IsEnabled = true; LocalModeButton.IsEnabled = true; ErrorMessage.Text = ""; ErrorMessage.Visibility = Visibility.Collapsed; if (e.NavigationMode == NavigationMode.New) { DelayUtil.Start(TimeSpan.FromMilliseconds(23), () => { StartButton_Click(this, null); }); } base.OnNavigatedTo(e); }
/// <summary> /// Play music based on name and execute callback when done. /// </summary> /// <param name="name">Name of music clip</param> /// <param name="callback">Callback action</param> /// <returns>AudioSource playing the music</returns> public static AudioSource PlayMusic(string name, Action callback = null) { if (ShouldPlayerMusic) { try { AudioObject ao = musicDict[name]; ao.AudioSource.Play(); DelayUtil.WaitForSeconds(ao.AudioClip.length, callback); return(ao.AudioSource); } catch (KeyNotFoundException knfEx) { return(null); } } return(null); }
void Start() { LeanTween.init(); DelayUtil.WaitForFrame(InitializeGame); }