private void DoInterruptionCleanUp() { bool flag = this.IsPreviousSceneActive(); object[] args = new object[] { this.m_phase, flag }; Log.LoadingScreen.Print("LoadingScreen.DoInterruptionCleanUp() - m_phase={0} previousSceneActive={1}", args); if (this.m_phase == Phase.WAITING_FOR_BLOCKERS) { base.StopCoroutine("HackWaitThenStartTransitionEffects"); } if (this.IsFading()) { this.StopFading(); if (this.IsFadingIn()) { this.m_prevTransitionParams = null; } } if (flag) { long assetLoadNextStartTimestamp = this.m_assetLoadNextStartTimestamp; long endTimestamp = TimeUtils.BinaryStamp(); this.ClearAssets(assetLoadNextStartTimestamp, endTimestamp); this.m_transitionUnfriendlyData.Clear(); this.m_transitionParams = new TransitionParams(); this.m_phase = Phase.WAITING_FOR_SCENE_LOAD; } }
public TransitionParams(TransitionParams other) { UseFadeOut = other.UseFadeOut; FadeOutTime = other.FadeOutTime; FadeOutOffset = other.FadeOutOffset; UseFadeIn = other.UseFadeIn; FadeInTime = other.FadeInTime; FadeInOffset = other.FadeInOffset; }
public async Task ChangeSceneDoubleTransition(string scenePath, TransitionParams @params) { var invertParams = @params; invertParams.invert = [email protected]; StartTransition(invertParams); await ToSignal(_tween, "tween_completed"); ChangeScene(scenePath, @params); }
public void ChangeScene(string scenePath, TransitionParams @params) { var error = GetTree().ChangeScene(scenePath); if (error != Error.Ok) { GD.PrintErr( $"Error {error} occurred while attempting to change to the {scenePath} scene."); } StartTransition(@params); }
public override void FillTransitionParams(TransitionParams param) { DrawChart(null); float p = 0; for (int i = 0; i < darawingValuesPercentage.Length; i++) { p += darawingValuesPercentage[i]; param.angle[i] = p * 360 - 180; } }
public void StartTransition(TransitionParams @params) { _transitionShader.SetShaderParam("mask_tex", GetTransitionTextures(@params.transitionType)); _transitionShader.SetShaderParam("transition_invert_mask", @params.invert); _transitionShader.SetShaderParam("transition_col", @params.color); _transitionShader.SetShaderParam("transition_feather", @params.transitionFeather); _transitionShader.SetShaderParam("transition_time", 1); _tween.InterpolateProperty(_transitionShader, "shader_param/transition_time", 1, 0, @params.duration, @params .tweenTransitionType, @params.tweenEaseType); _tween.Start(); }
private void CutoffTransition() { if (!this.IsTransitioning()) { this.m_transitionParams = new TransitionParams(); } else { this.StopFading(); this.FinishPreviousScene(); this.FinishFxCamera(); this.m_prevTransitionParams = null; this.m_transitionParams = new TransitionParams(); this.m_phase = Phase.INVALID; this.FireFinishedTransitionListeners(true); } }
/// Create the player for <c>conn</c> and register it with <see cref="GameController" />. public override GameObject OnLobbyServerCreateGamePlayer(NetworkConnection conn, short playerControllerId) { string playerName; if ((playerName = TransitionParams.GetPlayerName(conn)) == null) { playerName = "Newton"; } var prefab = spawnPrefabs.Find(p => p.name == playerName); var obj = Instantiate(prefab, Vector3.zero, Quaternion.identity); lock (threadLock) { playersToRegister.Add(obj); displayNames.Add(TransitionParams.GetDisplayName(conn)); clientConnections.Add(conn); } return(obj); }
IEnumerator InitializeWhenGameControllerReady() { yield return(new WaitUntil(() => GameController.Instance != null)); GameController.Instance.SetClientCount(numPlayers); yield return(new WaitUntil(() => playersToRegister.Count == numPlayers)); lock (threadLock) { for (int i = 0; i < playersToRegister.Count; i++) { var player = playersToRegister[i]; var displayName = displayNames[i]; var conn = clientConnections[i]; var team = TransitionParams.GetTeam(conn); var leaderboardId = TransitionParams.GetLeaderboardId(conn); var playerId = GameController.Instance.RegisterNewPlayer(player, displayName, team, conn); if (leaderboardId != -1) { GameController.Instance.SetLeaderboardId(playerId, leaderboardId); } } } }
void SetPlayerLeaderboardId(NetworkMessage msg) { TransitionParams.AddLeaderboardId(msg.conn, msg.reader.ReadInt32()); }
void SetPlayerTeam(NetworkMessage msg) { TransitionParams.AddTeam(msg.conn, msg.reader.ReadInt32()); }
/// Receive a display name set message from the client. void SetPlayerDisplayName(NetworkMessage msg) { TransitionParams.AddDisplayName(msg.conn, msg.reader.ReadString()); }
private ValueAnimator CreateTransitionAnimator(long d, bool inz) { //((Activity)getContext()).getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE, // WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE); //chartView.enabled = false; //zoomedChartView.enabled = false; chartView.transitionMode = BaseChartView.TRANSITION_MODE_PARENT; zoomedChartView.transitionMode = BaseChartView.TRANSITION_MODE_CHILD; var param = new TransitionParams(); param.pickerEndOut = chartView.pickerDelegate.pickerEnd; param.pickerStartOut = chartView.pickerDelegate.pickerStart; param.date = d; int dateIndex = Array.BinarySearch(data.chartData.x, d); if (dateIndex < 0) { dateIndex = data.chartData.x.Length - 1; } param.xPercentage = data.chartData.xPercentage[dateIndex]; zoomedChartView.Visibility = Visibility.Visible; zoomedChartView.transitionParams = param; chartView.transitionParams = param; int max = 0; int min = int.MaxValue; for (int i = 0; i < data.chartData.lines.Count; i++) { if (data.chartData.lines[i].y[dateIndex] > max) { max = data.chartData.lines[i].y[dateIndex]; } if (data.chartData.lines[i].y[dateIndex] < min) { min = data.chartData.lines[i].y[dateIndex]; } } float pYPercentage = ((float)min + (max - min) - chartView.currentMinHeight) / (chartView.currentMaxHeight - chartView.currentMinHeight); var hidden = chartView.Visibility == Visibility.Collapsed; chartView.FillTransitionParams(param); zoomedChartView.FillTransitionParams(param); ValueAnimator animator = ValueAnimator.OfFloat(inz ? 0f : 1f, inz ? 1f : 0f); animator.AddUpdateListener(new AnimatorUpdateListener(animation => { float fullWidth = chartView.chartWidth / (chartView.pickerDelegate.pickerEnd - chartView.pickerDelegate.pickerStart); float offset = fullWidth * chartView.pickerDelegate.pickerStart - BaseChartView.HORIZONTAL_PADDING; param.pY = (float)chartView.chartArea.Top + (1f - pYPercentage) * (float)chartView.chartArea.Height; param.pX = chartView.chartFullWidth * param.xPercentage - offset; param.progress = (float)animation.GetAnimatedValue(); zoomedChartView.Invalidate(); zoomedChartView.FillTransitionParams(param); chartView.Invalidate(); if (hidden) { _ = chartView.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { chartView.Visibility = Visibility.Visible; }); } })); animator.SetDuration(400); animator.setInterpolator(new FastOutSlowInInterpolator()); return(animator); }