protected override void Update() { if (FlaiInput.IsNewKeyPress(this.LoadFirstSceneKey)) { SceneFader.Fade(SceneDescription.FromIndex(0), Fade.Create(0.75f), Fade.Create(0.75f)); } else if (FlaiInput.IsNewKeyPress(this.ReloadSceneKey)) { SceneFader.Fade(SceneDescription.FromIndex(Application.loadedLevel), Fade.Create(0.15f), Fade.Create(0.15f)); } else if (FlaiInput.IsNewKeyPress(this.PreviousSceneKey)) { SceneFader.Fade(SceneDescription.FromIndex(Application.loadedLevel - 1), Fade.Create(0.15f), Fade.Create(0.15f)); } else if (FlaiInput.IsNewKeyPress(this.NextSceneKey)) { SceneFader.Fade(SceneDescription.FromIndex((Application.loadedLevel == Application.levelCount - 1) ? 0 : Application.loadedLevel + 1), Fade.Create(0.15f), Fade.Create(0.15f)); } }
protected override void Update() { if (this.IsControllingEnabled) { if (FlaiInput.IsButtonOrKeyPressed(this.MoveLeftButton, this.MoveLeftAlternativeKey)) { _characterController2D.MoveLeft(); } if (FlaiInput.IsButtonOrKeyPressed(this.MoveRightButton, this.MoveRightAlternativeKey)) { _characterController2D.MoveRight(); } if (FlaiInput.IsButtonOrKeyPressed(this.JumpButton, this.JumpAlternativeKey)) { _characterController2D.Jump(); } } }
protected override void LateUpdate() { this.Position2D = FlaiInput.GetMousePositionInWorld2D(this.Camera ?? Camera.main); }