void Start() { pauseController = gameObject.GetComponent <PauseController>(); StartCoroutine("ResetAfterDeath"); playerHasDied = false; GameObject gameController = GameObject.FindWithTag("GameController"); GameObject gameOverObject = GameObject.FindWithTag("GameOverText"); areaToCheck = GameObject.FindWithTag("AlienArea"); if (gameController != null && gameOverObject != null && areaToCheck != null) { alienShooter = areaToCheck.GetComponent <ChooseAliensThatWillShoot>(); alienController = gameController.GetComponent <AlienController>(); tankSpawner = gameController.GetComponent <TankSpawn>(); lifeController = gameController.GetComponent <LifeController>(); gameOverText = gameOverObject.GetComponent <GameOverController>(); alienSpawnController = gameController.GetComponent <InitializeAlienPosition>(); StartCoroutine("CheckIfWaveShouldBeReset"); } else { Debug.Log("Cannot find game controller in reset Controller"); } }
// Use this for initialization void Start() { _instace = this; pauseOrNot = false; anim = this.GetComponent <Animator>(); clicked = false; }
IEnumerator TransitionToGameScene() { yield return(new WaitForSeconds(.4f)); PauseController.UnPauseGame(); SceneManager.LoadScene("Game"); }
void Update() { if (this.AllowReassignment && !PauseController.IsPaused()) { for (int i = 0; i < DynamicData.MAX_PLAYERS; ++i) { SessionPlayer p = DynamicData.GetSessionPlayer(i); if (!p.HasJoined) { // Assignment foreach (Player rewiredPlayer in ReInput.players.Players) { if (!rewiredPlayer.isPlaying && rewiredPlayer.GetButtonDown(JOIN_ACTION)) { joinPlayer(p, rewiredPlayer); break; } } } else { // Unassignment if (ReInput.players.GetPlayer(p.RewiredId).GetButtonDown(MenuInput.EXIT)) { //TODO - Should be checking if button held rather than just pressed dropPlayer(p); } } } } }
private void OnLevelStart() // level start delegate { //Plugin.Log.Debug("Level Started"); isLevel = true; isPaused = false; if (modEnabled) { Plugin.Log.Debug("Level started... Looking for PauseController"); PauseController = Resources.FindObjectsOfTypeAll <PauseController>().FirstOrDefault(); FindSabers(); if (PauseController == null) { Plugin.Log.Warn("PauseController not found."); CriticalErrorHandler(true, 392); } if (rSaber == null || lSaber == null) { Plugin.Log.Warn("FindSabers() not fired or failed..."); CriticalErrorHandler(true, 393); } if (!criticalError) { Plugin.Log.Debug("Success! Found PauseController and Sabers."); } } }
void Update() { if (_began && !_dead && !PauseController.IsPaused()) { _stateMachine.Update(); } }
public override void Enter() { PauseController.Show(null); PauseController.AddPlayButtonListener(OnContinue); PauseController.AddHomeButtonListener(OnExitGame); PauseController.AddRestartButtonListener(OnRestartGame); }
void Update() { if (!PauseController.IsPaused()) { rotate(); } }
// Use this for initialization void Start() { instance = this; Time.timeScale = 1; paused = false; panel = false; }
private void GameEnd() { StopCoroutine(TimerCounter()); endMenu.SetActive(true); mainUI.SetActive(false); PauseController.GetInstance().Pause(); }
void Start() { playerRigidBody = GetComponent <Rigidbody>(); colourController = GameObject.FindObjectOfType <ColourController>(); pauseController = GameObject.FindObjectOfType <PauseController>(); colourController.AssignBulletColour(shot, colourController.GetBulletColourIndex()); }
public void Awake() { if (gameControl == null) { DontDestroyOnLoad(gameObject); gameControl = this; } else if (gameControl != this) { Destroy(gameObject); } ui = GetComponent <UIController> (); dialog = GetComponent <DialogController> (); gameEnd = GetComponent <GameEndHandler> (); stage = GetComponent <StageHandler> (); scene = GetComponent <SceneHandler> (); enemySpawner = GetComponent <EnemySpawner> (); spriteLib = GetComponent <SpriteLibrary> (); enemyLib = GetComponent <EnemyLib> (); pause = GetComponent <PauseController> (); stats = GetComponent <PlayerStats> (); sound = soundObject.GetComponent <SoundController> (); menu = GetComponent <MenuController> (); menu.InitMenu(); sound.InitSound(); scene.CheckScene(); }
// Use this for initialization public void Start () { PauseController = GameObject.Find("PauseCanvas").GetComponent<PauseController>(); _timeAffected = GetComponent<TimeAffected> (); _timeAffected.ShadowBlinkHandler += OnShadowBlink; _timeAffected.PassPauseController (PauseController); _layeredController = GetComponent<LayeredController> (); _targetable = gameObject.GetComponent<Targetable> (); _targetable.DeathEventHandler += OnDeath; _camera = Camera.main.GetComponent<CameraController> (); _musicController = gameObject.GetComponent<MusicController> (); GetComponent<LayeredController> ().LayerChangedEventHandler += UpdateLayerTransparencyOnLayerChange; GetComponent<LayeredController> ().LayerChangedEventHandler += UpdateMusicOnLayerChange; _bigGearPrefab = (GameObject)Resources.Load ("BigGear"); _smallGearPrefab = (GameObject)Resources.Load ("SmallGear"); _bigGear = Instantiate (_bigGearPrefab).GetComponent<GearController> (); _bigGear.PassPauseController (PauseController); _smallGear = Instantiate (_smallGearPrefab).GetComponent<GearController> (); _smallGear.PassPauseController (PauseController); _bigGear.Player = this; _smallGear.Player = this; _bigGear.RotationSpeed = _bigGearDefaultRotationSpeed; _smallGear.RotationSpeed = _smallGearDefaultRotationSpeed; _bigGear.Damage = _bigGearDamage; _smallGear.Damage = _smallGearDamage; _layeredController.Initialize(); UpdateLayerTransparencyOnLayerChange(); SaveCheckpoint (); }
// Use this for initialization public void Start() { PauseController = GameObject.Find("PauseCanvas").GetComponent <PauseController>(); _timeAffected = GetComponent <TimeAffected> (); _timeAffected.ShadowBlinkHandler += OnShadowBlink; _timeAffected.PassPauseController(PauseController); _layeredController = GetComponent <LayeredController> (); _targetable = gameObject.GetComponent <Targetable> (); _targetable.DeathEventHandler += OnDeath; _camera = Camera.main.GetComponent <CameraController> (); _musicController = gameObject.GetComponent <MusicController> (); GetComponent <LayeredController> ().LayerChangedEventHandler += UpdateLayerTransparencyOnLayerChange; GetComponent <LayeredController> ().LayerChangedEventHandler += UpdateMusicOnLayerChange; _bigGearPrefab = (GameObject)Resources.Load("BigGear"); _smallGearPrefab = (GameObject)Resources.Load("SmallGear"); _bigGear = Instantiate(_bigGearPrefab).GetComponent <GearController> (); _bigGear.PassPauseController(PauseController); _smallGear = Instantiate(_smallGearPrefab).GetComponent <GearController> (); _smallGear.PassPauseController(PauseController); _bigGear.Player = this; _smallGear.Player = this; _bigGear.RotationSpeed = _bigGearDefaultRotationSpeed; _smallGear.RotationSpeed = _smallGearDefaultRotationSpeed; _bigGear.Damage = _bigGearDamage; _smallGear.Damage = _smallGearDamage; _layeredController.Initialize(); UpdateLayerTransparencyOnLayerChange(); SaveCheckpoint(); }
public SinglePlayerSubScene(int backBufferWidth, int backBufferHeight) : base(backBufferWidth, backBufferHeight) { _motionController = new MotionController(); _animationController = new AnimationController(); _timerController = new TimerController(); _pauseController = new PauseController(); _pauseController.AddPausableObject(_timerController); _pauseController.AddPausableObject(_animationController); _cameraController = new Bopscotch.Gameplay.Controllers.PlayerTrackingCameraController(); _cameraController.Viewport = new Rectangle(0, 0, backBufferWidth, backBufferHeight); _cameraController.ScrollBoundaryViewportFractions = new Vector2(Definitions.Horizontal_Scroll_Boundary_Fraction, Definitions.Vertical_Scroll_Boundary_Fraction); Renderer.ClipOffCameraRendering(_cameraController, Camera_Clipping_Margin); _playerCollisionController = new OneToManyCollisionController(); _opaqueParticleEffectManager = new OpaqueLayerParticleEffectManager(_cameraController); _additiveParticleEffectManager = new AdditiveLayerParticleEffectManager(_cameraController); _levelFactory = new Bopscotch.Gameplay.LevelFactory(RegisterGameObject, _timerController.RegisterUpdateCallback); _levelFactory.BackgroundDimensions = new Point(backBufferWidth, backBufferHeight); _smashBlockItemFactory = new Effects.SmashBlockItems.SmashBlockItemFactory(RegisterGameObject, _timerController.RegisterUpdateCallback); _speedometer = new Bopscotch.Gameplay.Objects.Display.Speedometer(); _speedometer.CenterPosition = new Vector2(backBufferWidth, 0.0f); _playerEventPopup = new PlayerEventPopup(); _playerEventPopup.DisplayPosition = new Vector2(backBufferWidth / 2.0f, backBufferHeight / 4.0f); _active = false; }
void Update() { if (_callbackEntries != null && (!this.ListenToPause || !PauseController.IsPaused())) { foreach (Object owner in _callbackEntries.Keys) { List <CallbackEntry> entries = _callbackEntries[owner]; for (int i = 0; i < entries.Count;) { CallbackEntry entry = entries[i]; entry.timeRemaining -= Time.deltaTime; if (entry.timeRemaining <= 0.0f) { entries.RemoveAt(i); entry.callback(); } else { ++i; } } } } }
private void Construct( PluginConfig config, SiraLog logger, [InjectOptional] PauseController pauseController, MovementController movementController, InputManager inputManager, SaberControllerBearer saberControllerBearer, SaberType saberType, SaberTrickModel saberTrickModel, AudioTimeSyncController audioTimeSyncController, Trick.Factory trickFactory) { _config = config; _logger = logger; _pauseController = pauseController; _movementController = movementController; _inputManager = inputManager; _audioTimeSyncController = audioTimeSyncController; SaberTrickModel = saberTrickModel; _saber = saberControllerBearer[saberType].Saber; _vrController = saberControllerBearer[saberType].VRController; _trickFactory = trickFactory; }
private void OnEnable() { var pauseController = new PauseController(); pauseController.Enable(); pauseController.Main.Pause.performed += PauseOnPerformed; }
void Start() { if (Pauser == null) { Pauser = GameObject.FindGameObjectWithTag("Player").GetComponent <PauseController>(); } }
private void createPause() { GameObject go = GameObject.FindGameObjectWithTag("EventSystem"); PauseController pause = (PauseController)go.GetComponent(typeof(PauseController)); pause.GamePause(); }
public PauseMenuController(PauseMenuManager pauseMenuManager, IDifficultyBeatmap difficultyBeatmap, AudioTimeSyncController audioTimeSyncController, PauseController pauseController) { this.pauseMenuManager = pauseMenuManager; DifficultyBeatmap = difficultyBeatmap; this.audioTimeSyncController = audioTimeSyncController; this.pauseController = pauseController; }
private void OnExitGame() { Conductor.Stop(); PauseController.Hide(() => { this.Owner.ChangeState <ShowResultState>(); }); }
private void Awake() { inputs = new InputMaster(); pm = FindObjectOfType <PlayerMoveMent>(); bg = FindObjectOfType <BasicGun>(); pc = FindObjectOfType <PauseController>(); }
private void Start() { if (instance == null) { instance = this; } }
public GameplaySceneBase(string sceneID) : base(sceneID) { _inputProcessor = Input.TouchControls.CreateController(); _motionController = new MotionController(); _animationController = new AnimationController(); _timerController = new TimerController(); _pauseController = new PauseController(); _pauseController.AddPausableObject(_timerController); _pauseController.AddPausableObject(_animationController); _cameraController = new Bopscotch.Gameplay.Controllers.PlayerTrackingCameraController(); _cameraController.Viewport = new Rectangle(0, 0, Definitions.Back_Buffer_Width, Definitions.Back_Buffer_Height); _cameraController.ScrollBoundaryViewportFractions = new Vector2(Definitions.Horizontal_Scroll_Boundary_Fraction, Definitions.Vertical_Scroll_Boundary_Fraction); Renderer.ClipOffCameraRendering(_cameraController, Camera_Clipping_Margin); _playerCollisionController = new OneToManyCollisionController(); _opaqueParticleEffectManager = new OpaqueLayerParticleEffectManager(_cameraController); _additiveParticleEffectManager = new AdditiveLayerParticleEffectManager(_cameraController); _levelFactory = new Bopscotch.Gameplay.LevelFactory(RegisterGameObject, _timerController.RegisterUpdateCallback); _smashBlockItemFactory = new Effects.SmashBlockItems.SmashBlockItemFactory(RegisterGameObject, _timerController.RegisterUpdateCallback); _speedometer = new Bopscotch.Gameplay.Objects.Display.Speedometer(); _playerEventPopup = new Bopscotch.Gameplay.Objects.Display.PlayerEventPopup(); _objectWithGlowEffect = new List <ICanHaveGlowEffect>(); }
void Start() { deathAudio = GetComponent <AudioSource>(); pause = FindObjectOfType <PauseController> (); sm = FindObjectOfType <ScoreManager> (); player = FindObjectOfType <PlayerController> (); }
public override void Start() { base.Start(); _controller = PauseController.Instance; if(_controller == null) DebugMessage("Could not find a Pause Controller instance!", LogLevel.Warning); }
void Awake() { PauseController.EnablePausing(false); if (this.LevelGenManager != null) { this.LevelGenManager.AddUpdateDelegate(levelGenUpdate); } }
public void LevelStartOut() { PauseController.EnablePausing(true); if (this.LevelIntroPanel != null) { this.LevelIntroPanel.GetComponent <Animator>().SetTrigger("LevelStartOut"); } }
// Use this for initialization void Start() { animatorPlayer = mesh.GetComponent <Animator>(); rigidBird = GetComponent <Rigidbody2D>(); gameController = FindObjectOfType(typeof(GameController)) as GameController; GetComponent <Rigidbody2D>().freezeRotation = true; pauseController = FindObjectOfType(typeof(PauseController)) as PauseController; }
void Awake() { if (pc == null) //If Player Controller is not on then... { pc = GameObject.FindGameObjectWithTag("PC").GetComponent <PauseController>(); //Find Game Object which has the tag if "PC" and obtain Pause Controller } ml = GetComponent <MouseLook>(); }
void Start() { pauseGame = PausedControlObject.GetComponent <PauseController>(); player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>(); inventorySlots = GameObject.FindGameObjectsWithTag("InventorySlot"); inventoryPanel.SetActive(false); audiosource = GetComponent <AudioSource>(); }
void Awake() { if (!instance) { instance = this; } guiTexture.pixelInset = new Rect(0f, 0f, Screen.width, Screen.height); }
void Awake() { if (pause == null) { DontDestroyOnLoad (gameObject); pause = this; } else if (pause != this) { Destroy(gameObject); } }
public void Update( PauseController to_watch ) { if( !inversely && to_watch.activatePause != pauseController.activatePause ) { pauseController.activatePause = to_watch.activatePause ; } else if( inversely && to_watch.activatePause == pauseController.activatePause ) { pauseController.activatePause = !to_watch.activatePause ; } }
void SeekPauseControllersOnGameObject( ActivationBehaviour behaviour ) { pauseController = (PauseController)gameObject.GetComponent< PauseController >() ; if( pauseController ) { pauseControllerName = pauseController.pauseName ; } }
void Start() { if (GameObject.FindGameObjectWithTag(Tags.gameController)) { gameController = GameObject.FindGameObjectWithTag(Tags.gameController); pc = gameController.GetComponent<PauseController>(); gec = gameController.GetComponent<GUIElementsController>(); } if (GameObject.FindGameObjectWithTag(Tags.timesDisplay)) { tdc = GameObject.FindGameObjectWithTag(Tags.timesDisplay).GetComponent<TimesDisplayController>(); } }
public void PassPauseController (PauseController input) { _pauseController = input; }
public override void Start() { base.Start(); _controller = PauseController.Instance; }