Transitioner SetTransitioner(int index, System.Type transitionerType, string assetName, string propName) { DeleteChildAssetsWithName(assetName); if (transitionerType == null) { return(null); } Transitioner newChild = (Transitioner)CreateInstance(transitionerType.ToString()); newChild.Reset((AttachStrategy)target); newChild.hideFlags = HideFlags.HideInHierarchy; newChild.name = assetName; AssetDatabase.AddObjectToAsset(newChild, serializedObject.targetObject); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); SerializedProperty prop = serializedObject.FindProperty(propName); if (prop.arraySize < index + 1) { prop.arraySize = index + 1; } prop.GetArrayElementAtIndex(index).objectReferenceValue = newChild; serializedObject.ApplyModifiedProperties(); return(newChild); }
private void Awake() { transitioner = GetComponent <Transitioner>(); mainTrans = mainCanvas.GetComponent <Transitionable>(); connectTrans = connectCanvas.GetComponent <Transitionable>(); onLobbyErrorListener = new Action <IEventParam>( (e) => { connectText.text = "Error: " + ((StringParam)e).val; errorConfirmButton.gameObject.SetActive(true); }); onTryConnectListener = new Action <IEventParam>( (e) => { IpParam p = (IpParam)e; connectText.text = (p.host) ? "Hosting match" : "Connecting to " + p.ip; }); onTryConnectTimeoutListener = new Action <IEventParam>( (e) => { BoolParam p = (BoolParam)e; connectText.text = "Failed to Connect"; errorConfirmButton.gameObject.SetActive(true); }); connectListener = new Action <IEventParam>( (e) => { connectText.text = "Starting match..."; EventManager.Instance.Raise("request-scene", new IntParam(2)); }); }
void Update() { switch (GetState()) { case State.Win: if (SceneType.Hard == _sceneCurrent) { _gameBeat = true; } DisableCells(); Transitioner.TransitionOut(); break; case State.Run: while (CellsActivated.Count > 0) { CellsActivated.Dequeue().React(); } break; case State.Idle: break; default: Debug.Log("unexpected state"); break; } }
public override void Update(GameTime gameTime) { if (Keyboard.GetState().IsKeyDown(Keys.Enter)) { Transitioner.To(nameof(RoomScreen)); } }
/// <summary> /// Handles when the user holds Control, Shift and Alt, and presses R /// </summary> private void HandleKeyPressCtrlS() { // Check for modifier keys if (!(KeyboardManager.CurrentState.IsKeyDown(Keys.LeftControl) || KeyboardManager.CurrentState.IsKeyDown(Keys.RightControl))) { return; } if (!KeyboardManager.IsUniqueKeyPress(Keys.S)) { return; } // Handle skin reloading switch (CurrentScreen.Type) { case QuaverScreenType.Menu: case QuaverScreenType.Select: case QuaverScreenType.Edit: Transitioner.FadeIn(); SkinManager.TimeSkinReloadRequested = GameBase.Game.TimeRunning; break; } }
/// <inheritdoc /> /// <summary> /// UnloadContent will be called once per game and is the place to unload /// game-specific content. /// </summary> protected override void UnloadContent() { OnlineManager.Client?.Disconnect(); Transitioner.Dispose(); DiscordHelper.Shutdown(); base.UnloadContent(); }
/// <inheritdoc /> /// <summary> /// This is called when the game should draw itself. /// </summary> protected override void Draw(GameTime gameTime) { if (!IsReadyToUpdate) { return; } for (var i = ScheduledRenderTargetDraws.Count - 1; i >= 0; i--) { ScheduledRenderTargetDraws[i]?.Invoke(); ScheduledRenderTargetDraws.Remove(ScheduledRenderTargetDraws[i]); } base.Draw(gameTime); // Draw dialogs DialogManager.Draw(gameTime); NotificationManager.Draw(gameTime); // Draw the global container last. GlobalUserInterface.Draw(gameTime); Transitioner.Draw(gameTime); }
/// <inheritdoc /> /// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> protected override void Update(GameTime gameTime) { if (!IsReadyToUpdate) { return; } base.Update(gameTime); if (SteamManager.IsInitialized) { SteamAPI.RunCallbacks(); } // Run scheduled background tasks CommonTaskScheduler.Run(); BackgroundManager.Update(gameTime); BackgroundHelper.Update(gameTime); NotificationManager.Update(gameTime); ChatManager.Update(gameTime); DialogManager.Update(gameTime); HandleGlobalInput(gameTime); QuaverScreenManager.Update(gameTime); Transitioner.Update(gameTime); SkinManager.HandleSkinReloading(); LimitFpsOnInactiveWindow(); }
public EmployeeManagement() { InitializeComponent(); mEmpTransitioner = empTransitioner; AddEmployee addEmp = new AddEmployee(); }
public SideMenu() { InitializeComponent(); Loaded += (s, e) => { ContentTransitioner = ((MainWindow)Window.GetWindow(this))?.ContentTransitioner; }; }
private void Cancelar(Transitioner transitioner) { transitioner.SelectedIndex = 0; var diccionario = new Dictionary <string, bool>(); diccionario.Add("CuentaCorrienteEntrada", false); eventAggregator.GetEvent <PubSubEvent <Dictionary <string, bool> > >().Publish(diccionario); }
/// <summary> /// Updates the screen manager /// </summary> /// <param name="gameTime"></param> public static void Update(GameTime gameTime) { var game = GameBase.Game as QuaverGame; if (QueuedScreen == game?.CurrentScreen || QueuedScreen == null) { return; } // Handle delayed screen changes. if (DelayedScreenChangeTime != 0) { TimeElapsedSinceDelayStarted += GameBase.Game.TimeSinceLastFrame; if (!(TimeElapsedSinceDelayStarted >= DelayedScreenChangeTime)) { return; } Transitioner.FadeIn(); TimeElapsedSinceDelayStarted = 0; DelayedScreenChangeTime = 0; return; } // Wait for fades to complete first. if (Transitioner.Blackness.Animations.Count != 0) { return; } var oldScreen = game.CurrentScreen; switch (ChangeType) { case QuaverScreenChangeType.CompleteChange: ChangeScreen(QueuedScreen); break; case QuaverScreenChangeType.AddToStack: AddScreen(QueuedScreen); break; case QuaverScreenChangeType.RemoveTopScreen: RemoveTopScreen(); Button.IsGloballyClickable = true; var screen = (QuaverScreen)ScreenManager.Screens.Peek(); screen.Exiting = false; break; default: throw new ArgumentOutOfRangeException(); } Transitioner.FadeOut(); }
// Use this for initialization void Start() { gameControl = FindObjectOfType <Transitioner> (); EffectControl = FindObjectOfType <MovementTimeControl> (); Controller = GetComponent <SteamVR_Behaviour_Pose>(); BeginAction.AddOnStateDownListener(TriggerAction, handType); }
// Use this for initialization void Start() { TransitionControl = FindObjectOfType <Transitioner> (); CurrentRate = StartRate; Controller = GetComponent <SteamVR_Behaviour_Pose>(); Debug.Log(Controller); }
/// <summary> /// Starts the fade out process for the game on play completion. /// </summary> /// <param name="gameTime"></param> private void HandlePlayCompletion(GameTime gameTime) { if (!Screen.Failed && !Screen.IsPlayComplete) { return; } Screen.TimeSincePlayEnded += gameTime.ElapsedGameTime.TotalMilliseconds; // If the play was a failure, we want to immediately show // a red screen. if (Screen.Failed && !ScreenChangedToRedOnFailure) { Transitioner.Tint = Color.Red; Transitioner.Alpha = 0.65f; ScreenChangedToRedOnFailure = true; } // Load the results screen asynchronously, so that we don't run through any freezes. if (!ResultsScreenLoadInitiated) { Screen.Exit(() => new ResultScreen(Screen), 500); ResultsScreenLoadInitiated = true; } // Don't fade unless we're fully clear to do so. if (Screen.TimeSincePlayEnded <= 1200 || !ClearToExitScreen) { return; } // If the play was a failure, immediately start fading to black. if (Screen.Failed) { Transitioner.FadeToColor(Color.Black, gameTime.ElapsedGameTime.TotalMilliseconds, 150); } // Start fading out the screen. if (!FadingOnPlayCompletion) { Transitioner.Animations.Clear(); // Get the initial alpha of the sceen transitioner, because it can be different based // on if the user failed or not, and use this in the Animation var initialAlpha = Screen.Failed ? 0.65f : 0; Transitioner.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, initialAlpha, 1, 1000)); FadingOnPlayCompletion = true; } if (Screen.TimeSincePlayEnded >= 3000) { // Change background dim before switching screens. BackgroundManager.Background.Dim = 0; } }
public override void Update(GameTime gameTime) { var keyboardState = Keyboard.GetState(); if (keyboardState.IsKeyDown(Keys.Escape)) { Transitioner.To(nameof(MainMenuScreen)); } Hero.Update(keyboardState); }
public bool Match(Transitioner transitioner, TransitionerSlide oldSlide, TransitionerSlide newSlide, int oldIndex, int newIndex, int count, out ITransitionWipe wipe) { if (Wipes.Count > 0) { wipe = Wipes[_random.Next(0, Wipes.Count - 1)]; } else { wipe = _wipes[_random.Next(0, _wipes.Count - 1)]; } return(true); }
public void StartTransitioner(Transitioner transitioner) { if (transitioner == null) { return; } int key = transitioner.GetInstanceID(); if (!_transitionsToStart.ContainsKey(key) && !_transitionsToStop.ContainsKey(key) && !_transitionsCurrentlyRunning.ContainsKey(key)) { _transitionsToStart.Add(key, transitioner); } }
private void Awake() { transitioner = GameObject.FindGameObjectWithTag("Transitioner").GetComponent <Transitioner>(); int x = 0; int y = 0; int routeLength = 0; GenerateSquare(x, y, 1); Vector2Int previousPos = new Vector2Int(x, y); y += 3; GenerateSquare(x, y, 1); NewRoute(x, y, routeLength, previousPos); FillWalls(); }
/// <summary> /// Called every frame. Waits for a skin reload to be queued up. /// </summary> public static void HandleSkinReloading() { // Reload skin when applicable if (TimeSkinReloadRequested != 0 && GameBase.Game.TimeRunning - TimeSkinReloadRequested >= 400) { Load(); TimeSkinReloadRequested = 0; ThreadScheduler.RunAfter(() => { Transitioner.FadeOut(); NotificationManager.Show(NotificationLevel.Success, "Skin has been successfully loaded!"); }, 200); } }
void OnPress(){ if(playerscript.playerName == "" || playerscript.playerName == "Player Name"){ audio.PlayOneShot(error, 0.2f); } else { transition = transitioner.GetComponent<Transitioner>(); PlayerServerInfo.Instance.localOptions.username = playerscript.playerName; //PlayerServerInfo.instance.servername = playerscript.gameName; audio.PlayOneShot(pageturn); transition.Flip("FindingGames", false); } }
// Use this for initialization void Start() { //A_Sources = GetComponentsInChildren<AudioSource> (); GameTransitioner = GetComponent <Transitioner>(); A_StartPitch = new float[A_Sources.Length]; for (int i = 0; i < A_Sources.Length; i++) { A_StartPitch [i] = A_Sources [i].pitch; } //Controllers = FindObjectsOfType<StaffController> (); }
/// <summary> /// Called every frame. Waits for a skin reload to be queued up. /// </summary> private void HandleSkinReloading() { // Reload skin when applicable if (TimeSkinReloadRequested != 0 && GameBase.Game.TimeRunning - TimeSkinReloadRequested >= 400) { SkinManager.Load(); NewQueuedSkin = null; TimeSkinReloadRequested = 0; IsGloballyClickable = true; ThreadScheduler.RunAfter(() => { Transitioner.FadeOut(); NotificationManager.Show(NotificationLevel.Success, "Skin has been successfully loaded!"); }, 200); } }
void OnPress() { if (playerscript.playerName == "" || playerscript.playerName == "Player Name") { audio.PlayOneShot(error, 0.2f); } else { transition = transitioner.GetComponent<Transitioner>(); PlayerServerInfo.Instance.localOptions.username = playerscript.playerName; PlayerServerInfo.Instance.choice = "Host"; audio.PlayOneShot(pageturn); transition.Flip("HostMenu", false); } }
public void TriggerDarkness() { GameObject siljaGO = GameObject.FindGameObjectWithTag("Player"); SiljaBehaviour siljaBeh = siljaGO.GetComponent <SiljaBehaviour>(); Transitioner transitionContoller = Component.FindObjectOfType(typeof(Transitioner)) as Transitioner; transitionContoller.doTransition(true); // siljaBeh.LookAtPointFP(false, null); // COMMENTED AS I THINK THERE IS SOME DIFFERENCE //firstPersonCamera.gameObject.SetActive(false); //charMotor.enabled = true; //transform.gameObject.GetComponent<MovementController>().canMove = true; //camInput.enabled = true; }
public void StopTransitioner(Transitioner transitioner) { if (transitioner == null) { return; } int key = transitioner.GetInstanceID(); if (_transitionsToStart.ContainsKey(key)) { _transitionsToStart.Remove(key); } else if (!_transitionsToStop.ContainsKey(key)) { _transitionsToStop.Add(key, transitioner); } }
/// <inheritdoc /> /// <summary> /// This is called when the game should draw itself. /// </summary> protected override void Draw(GameTime gameTime) { if (!IsReadyToUpdate) { return; } base.Draw(gameTime); // Draw dialogs DialogManager.Draw(gameTime); NotificationManager.Draw(gameTime); // Draw the global container last. GlobalUserInterface.Draw(gameTime); Transitioner.Draw(gameTime); }
/// <summary> /// Creates the button to save changes /// </summary> private void CreateOkButton() { OkButton = new BorderedTextButton("OK", Color.LimeGreen) { Parent = FooterContainer, Alignment = Alignment.MidRight, X = -20 }; OkButton.Clicked += (o, e) => { // Determines whether we'll be dismissing the dialog if no changes have been made. var dismissDalog = true; // Handle skin reloads if (SkinManager.NewQueuedSkin != null || NewQueuedDefaultSkin != ConfigManager.DefaultSkin.Value) { ConfigManager.Skin.Value = SkinManager.NewQueuedSkin; ConfigManager.DefaultSkin.Value = NewQueuedDefaultSkin; Transitioner.FadeIn(); SkinManager.TimeSkinReloadRequested = GameBase.Game.TimeRunning; // IsGloballyClickable = false; dismissDalog = false; } // Handle screen resolution changes. if (NewQueuedScreenResolution.X != ConfigManager.WindowWidth.Value && NewQueuedScreenResolution.Y != ConfigManager.WindowHeight.Value) { ConfigManager.WindowWidth.Value = NewQueuedScreenResolution.X; ConfigManager.WindowHeight.Value = NewQueuedScreenResolution.Y; WindowManager.ChangeScreenResolution(NewQueuedScreenResolution); dismissDalog = false; } if (dismissDalog) { DialogManager.Dismiss(this); } }; }
/// <inheritdoc /> /// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { base.LoadContent(); Resources.AddStore(new DllResourceStore("Quaver.Resources.dll")); SteamManager.SendAvatarRetrievalRequest(SteamUser.GetSteamID().m_SteamID); // Load all game assets. Fonts.Load(); BackgroundHelper.Initialize(); // Load the user's skin SkinManager.Load(); // Create the global FPS counter. CreateFpsCounter(); VolumeController = new VolumeController() { Parent = GlobalUserInterface }; BackgroundManager.Initialize(); Transitioner.Initialize(); // Make the cursor appear over the volume controller. ListHelper.Swap(GlobalUserInterface.Children, GlobalUserInterface.Children.IndexOf(GlobalUserInterface.Cursor), GlobalUserInterface.Children.IndexOf(VolumeController)); IsReadyToUpdate = true; Logger.Debug($"Currently running Quaver version: `{Version}`", LogType.Runtime); #if VISUAL_TESTS Window.Title = $"Quaver Visual Test Runner"; #else Window.Title = !IsDeployedBuild ? $"Quaver - {Version}" : $"Quaver v{Version}"; QuaverScreenManager.ScheduleScreenChange(() => new MenuScreen()); #endif }
/// <summary> /// Updates the screen manager /// </summary> /// <param name="gameTime"></param> public static void Update(GameTime gameTime) { var game = GameBase.Game as QuaverGame; if (QueuedScreen == game?.CurrentScreen || QueuedScreen == null) { return; } // Handle delayed screen changes. if (DelayedScreenChangeTime != 0) { TimeElapsedSinceDelayStarted += GameBase.Game.TimeSinceLastFrame; if (!(TimeElapsedSinceDelayStarted >= DelayedScreenChangeTime)) { return; } Transitioner.FadeIn(); TimeElapsedSinceDelayStarted = 0; DelayedScreenChangeTime = 0; return; } // Wait for fades to complete first. if (Transitioner.Blackness.Animations.Count != 0) { return; } var oldScreen = game.CurrentScreen; ChangeScreen(QueuedScreen); oldScreen = null; Transitioner.FadeOut(); }
/// <summary> /// Schedules the current screen to start changing to the next /// </summary> /// <param name="newScreen"></param> /// <param name="delayFade"></param> public static void ScheduleScreenChange(Func <QuaverScreen> newScreen, bool delayFade = false) { if (!delayFade) { Transitioner.FadeIn(); } ThreadScheduler.Run(() => { if (QueuedScreen != null) { lock (QueuedScreen) QueuedScreen = newScreen(); } else { QueuedScreen = newScreen(); } Logger.Important($"Scheduled screen change to: '{QueuedScreen.Type}'. w/ {DelayedScreenChangeTime}ms delay", LogType.Runtime); }); }
/// <summary> /// Imports a skin file. /// </summary> public static void Import(string path) { Transitioner.FadeIn(); try { ThreadScheduler.Run(() => { var skinName = Path.GetFileNameWithoutExtension(path); var dir = $"{ConfigManager.SkinDirectory.Value}/{skinName}"; Directory.CreateDirectory(dir); // Extract the skin into a directory. using (var archive = ArchiveFactory.Open(path)) { foreach (var entry in archive.Entries) { if (!entry.IsDirectory) { entry.WriteToDirectory(dir, new ExtractionOptions() { ExtractFullPath = true, Overwrite = true }); } } } // Reload the skin. ConfigManager.Skin.Value = skinName; NewQueuedSkin = skinName; TimeSkinReloadRequested = GameBase.Game.TimeRunning; }); } catch (Exception e) { Logger.Error(e, LogType.Runtime); } }
void Awake(){ fader = transitioner.GetComponent<Transitioner>(); }
// Use this for initialization void Awake () { transitionContoller = Component.FindObjectOfType(typeof(Transitioner)) as Transitioner; }