コード例 #1
0
        public async Task ShowTurnCompare(CombatUtil.CombatAction playerAction,
                                          CombatUtil.CombatAction enemyAction,
                                          float duration = 1.5f)
        {
            _playerActionLabel.Text     = CombatUtil.GetActionName(playerAction);
            _playerActionLabel.Modulate = CombatUtil.GetActionColor(playerAction);
            _enemyActionLabel.Text      = CombatUtil.GetActionName(enemyAction);
            _enemyActionLabel.Modulate  = CombatUtil.GetActionColor(enemyAction);
            _lineLabel.Visible          = true;
            compareContainer.Visible    = true;

            if (duration > 0)
            {
                var color = _playerActionLabel.Modulate;
                color.a = 0;
                _playerActionLabel.Modulate = color;
                color   = _enemyActionLabel.Modulate;
                color.a = 0;
                _enemyActionLabel.Modulate = color;

                _tween.InterpolateProperty(_enemyActionLabel, "modulate:a", 0f, 1f,
                                           actionTweenDuration, Tween.TransitionType.Quad, Tween.EaseType.Out,
                                           actionTweenDelay);
                _tween.InterpolateProperty(_playerActionLabel, "modulate:a", 0f, 1f,
                                           actionTweenDuration, Tween.TransitionType.Quad, Tween.EaseType.Out,
                                           actionTweenDelay);
                _tween.Start();

                await ToSignal(_tween, "tween_all_completed");
                await ToSignal(GetTree().CreateTimer(duration), "timeout");

                _lineLabel.Visible       = false;
                compareContainer.Visible = false;
            }
        }
コード例 #2
0
 private void SetWinLabel(string actor, CombatUtil.CombatAction action)
 {
     _winActorLabel.Text      = actor;
     _winActionLabel.Text     = CombatUtil.GetActionName(action);
     _winActionLabel.Modulate = CombatUtil.GetActionColor(action);
 }