public override void OnFrameEntered(int enteredFrame) { if (framesToShakeCameraOn.Contains(enteredFrame)) { SceneUtils.FindObject <CameraShaker> ().ZoomShakeCamera(cameraShakeAmount); } }
private void ShowNextTextBalloon() { if (currentTextBox < textBoxes.Count) { //SceneUtils.FindObject<PressActionDisplay>().Show("Skip"); DispatchMessage("OnShowNextTextBalloon", null); if (currentTextBox > 0) { textBoxes[currentTextBox - 1].RemoveEventListener(this.gameObject); textBoxes[currentTextBox - 1].active = false; } textBoxes[currentTextBox].AddEventListener(this.gameObject); textBoxes[currentTextBox].active = true; textBoxes[currentTextBox].OnStart(); currentTextBox++; } else { if (onHideAnimation) { isBusy = true; textBoxes[currentTextBox - 1].RemoveEventListener(this.gameObject); textBoxes[currentTextBox - 1].active = false; } DispatchMessage("OnTextDone", null); SceneUtils.FindObject <PressActionDisplay>().Hide(); Hide(); } }
public override void OnActivated() { Vector3 praisePositionTarget = Vector3.zero; WizardKing wizardKing = SceneUtils.FindObject <WizardKing>(); WizardKingSolo wizardKingSolo = SceneUtils.FindObject <WizardKingSolo>(); if (wizardKingSolo) { praisePositionTarget = wizardKingSolo.transform.position; wizardKingSolo.CannotDie(); } else if (wizardKing) { praisePositionTarget = wizardKing.transform.position; } foreach (Transformer transformer in SceneUtils.FindObjects <Transformer>()) { if (!transformer.IsTranformed()) { Direction directionToKing = MathUtils.GetHorizontalDirection(praisePositionTarget, transformer.transform.position); transformer.GetComponent <BodyControl>().Turn((float)directionToKing); transformer.DoPraise(); } } DeActivate(); }
void Update() { if (alienInputActions.reset) { SceneUtils.FindObject <AlienGameManager>().ResetGame(); } if (canExplodeAllEnemies) { if (alienInputActions.explode.IsPressed) { timeExplodePressed += 1f; cameraShaker.ShakeShakeCamera( new Vector3( timeExplodePressed / 100, timeExplodePressed / 100 ), true); if (timeExplodePressed > timeCameraNeedsToShake) { canExplodeAllEnemies = false; ExplodeAllEnemies(); } } if (alienInputActions.explode.WasReleased) { timeExplodePressed = 0f; } } }
void OnTriggerEnter(Collider other) { AlienBullet bullet = other.gameObject.GetComponent <AlienBullet>(); if (bullet && bullet.GetOriginGo() != this.gameObject && bullet.GetSource() != this.gameObject) { Debug.Log("Bullet incoming from other alien"); //Add check to see if connection already exists. SceneUtils.FindObject <AlienTargetManager>().OnAlienTargetHit(this); RopeContainer ropeContainer = GameObject.Instantiate(ropeContainerPrefab, GetCenterTransform().position, Quaternion.identity); ropeContainer.transform.parent = this.transform; ropeContainer.AddEventListener(this.gameObject); Transform originTransform = bullet.GetOriginGo().transform; if (bullet.GetOriginGo().GetComponent <AlienTarget>()) { originTransform = bullet.GetOriginGo().GetComponent <AlienTarget>() .GetCenterTransform(); } ropeContainer.PrepareRope(originTransform, GetCenterTransform()); bullet.BeforeDestroy(); Destroy(bullet.gameObject); PlayInfectionSound(); OnControlled(); } }
public void Update() { if (Input.GetButtonDown("Back")) { SceneUtils.FindObject <SpecialBackgroundMusic>().SaveBackgroundMusicTime(); Loader.LoadSceneQuickly(Scene.Menu); } }
public override void OnFrameEntered(int enteredFrame) { if (framesToPlaySoundEffectOn.Contains(enteredFrame)) { soundEffect.Play(true); SceneUtils.FindObject <CameraShaker> ().ZoomShakeCamera(cameraShakeAmount); } }
private void OnTriggerEnter(Collider other) { AlienBullet alienBullet = other.gameObject.GetComponent <AlienBullet>(); if (alienBullet) { Destroy(alienBullet.gameObject); SceneUtils.FindObject <AlienGameManager>().ResetGame(); } }
public override void OnActivated() { if (SceneUtils.FindObject <CrossInputListener>()) { SceneUtils.FindObject <CrossInputListener>().Show(); } textBoxManager.AddEventListener(this.gameObject); textBoxManager.ResetShowAndActivate(0); }
public void Update() { playerControl.DoMove(Input.GetAxis("Horizontal")); if (Input.GetButton("Jump")) { playerControl.DoJump(); } if (Input.GetButtonUp("Jump")) { playerControl.DoStopJump(); } if (Input.GetButtonDown("Transform")) { if (player is Transformer && !GetComponent <Transformer>().IsTransformed()) { SceneUtils.FindObject <WizardKing>().CastMagic(); GetComponent <Transformer>().DoTransform(); } if (player is WizardKing) { GetComponent <WizardKing>().DoThrow(); } } if (Input.GetButtonDown("Down")) { downPressedKeyboard = true; } if (Input.GetAxis("Down") > 0.6) { downPressedController = true; } if (downPressedKeyboard) { if (Input.GetButtonUp("Down")) { downPressedKeyboard = false; } } if (downPressedController) { if (Input.GetAxis("Down") <= 0) { downPressedController = false; } } }
public override void OnActivated() { if (SceneUtils.FindObject <BabyAlienTarget>()) { SceneManager.LoadScene(sceneToLoad.ToString()); } else { SceneManager.LoadScene(sceneToLoadOnBabyDead.ToString()); } }
private void OnTextBoxDoneAndHidden() { if (SceneUtils.FindObject <CrossInputListener>()) { SceneUtils.FindObject <CrossInputListener>().Hide(); } if (waitsUntillHidingAnimationDone) { DeActivate(); } }
public void OnTextDone() { if (SceneUtils.FindObject <CrossInputListener>()) { SceneUtils.FindObject <CrossInputListener>().Hide(); } if (!waitsUntillHidingAnimationDone) { DeActivate(); } }
// Update is called once per frame void Update() { if (isActive) { if (Input.GetButtonDown("menu_select_transformer")) { isActive = false; SceneUtils.FindObject <SpecialBackgroundMusic>().SaveBackgroundMusicTime(); Loader.LoadSceneQuickly(sceneToStart); } } }
// Use this for initialization void Start() { alienUIManager = SceneUtils.FindObject <AlienUIManager>(); cameraShaker = SceneUtils.FindObject <CameraShaker>(); alienGameManager = SceneUtils.FindObject <AlienGameManager>(); alienInputActions = AlienInputActions.CreateWithDefaultBindings(); alienTargetsVisited.Add(currentAlienTarget); alienTargetPath.Add(currentAlienTarget); allAlienTargets = SceneUtils.FindObjects <AlienTarget>(); allAlienTargets.ForEach(alienTarget => alienTarget.AddEventListener(this.gameObject)); }
void Awake() { FollowCamera2D followCamera2D = SceneUtils.FindObject <FollowCamera2D>(); if (followCamera2D) { followCamera2D.AddEventListener(this.gameObject); } targetPosition = targetTransform.localPosition; startPosition = this.spawnPosition.transform.localPosition; }
// Use this for initialization public virtual void Start() { lineDrawer = SceneUtils.FindObject <LineDrawer>(); if (!lineDrawer) { Debug.Log("[WARN] lineDrawComponent needs LineDrawer!"); } lineFollowComponent = this.GetComponent <LineFollowComponent>(); lineFollowComponent.AddEventListener(this.gameObject); this.AddEventListener(lineFollowComponent.gameObject); this.canBeDragged = false; }
public static void ReloadLevelAndStopLoading() { PlayerInputHelper.ResetInputHelper(); Destroy(SceneUtils.FindObject <Loader>().gameObject); string sceneToLoad = loadingScene.ToString(); if (!Loader.HAS_USED_LOADER) { sceneToLoad = Application.loadedLevelName; } Scene scene = (Scene)System.Enum.Parse(typeof(Scene), sceneToLoad); HAS_DONE_FULL_RELOAD = true; Loader.LoadScene(scene); }
// Use this for initialization public virtual void Start() { alienTargetManager = SceneUtils.FindObject <AlienTargetManager>(); alienInputActions = AlienInputActions.CreateWithDefaultBindings(); leftStickControl = SceneUtils.FindObject <LeftStickControl>(); animationManager = GetComponentInChildren <AnimationManager2D>(); if (this.transform.Find("Sounds")) { if (this.transform.Find("Sounds/ExplosionSound")) { explosionSound = this.transform.Find("Sounds/ExplosionSound").GetComponent <SoundObject>(); } if (this.transform.Find("Sounds/FlingSound")) { flingSound = this.transform.Find("Sounds/FlingSound").GetComponent <SoundObject>(); } } if (this.transform.Find("ShootPosition")) { shootPosition = this.transform.Find("ShootPosition"); } else { shootPosition = this.transform; } if (isControlled) { OnControlled(); } if (this.transform.Find("BloodAnimations")) { bloodAnimations = this.transform.Find("BloodAnimations") .GetComponentsInChildren <Animation2D>(); } }
// Use this for initialization void Awake() { aimIndicator = this.transform.Find("AimIndicator"); alienTargetManager = SceneUtils.FindObject <AlienTargetManager>(); }
public void StartCutScene(bool disablePlayerInput = true) { StartCutScene(SceneUtils.FindObject <Player>(), disablePlayerInput); }
private void RestartLevel() { SceneUtils.FindObject <SpecialBackgroundMusic>().SaveBackgroundMusicTime(); Loader.ReloadLevelWithoutLoadingScene(); }
public override void OnActivated() { SceneUtils.FindObject <AlienTargetManager>().TogglePlayerInput(enablePlayerInput); DeActivate(); }
public override void OnActivated() { SaveUtil.SaveData(SceneUtils.FindObject <TransformerGameManager>().GetLivesSaved()); SceneUtils.FindObject <SpecialBackgroundMusic>().SaveBackgroundMusicTime(); Loader.LoadSceneQuickly(sceneToLoadOnFinish); }
// Use this for initialization public virtual void Start() { moveAndRotationComponent = this.GetComponent <MoveAndRotationComponent>(); gridMap = SceneUtils.FindObject <GridMap>(); //temp! }
public void UnSubScribe() { SceneUtils.FindObject <WorldEventManager>().RemoveEventListener(this.gameObject); }
public override void OnActivated() { SceneUtils.FindObject <AlienTargetManager>().currentAlienTarget.OnControlled(); DeActivate(); }
void Start() { transformGameManager = SceneUtils.FindObject <TransformerGameManager>(); }
// Use this for initialization void Start() { SceneUtils.FindObject <WorldEventManager>().AddEventListener(this.gameObject); }