void Awake() { NotificationCentre.AddObserver(this, "OnBGMFadeIn"); NotificationCentre.AddObserver(this, "OnBGMFadeOut"); NotificationCentre.AddObserver(this, "DisplayHowToPlay"); NotificationCentre.AddObserver(this, "OnHoldingGunHigh"); NotificationCentre.AddObserver(this, "OnBattleBGM"); NotificationCentre.AddObserver(this, "OnSFXSwift"); NotificationCentre.AddObserver(this, "OnSFXVFX1"); NotificationCentre.AddObserver(this, "OnSFXVFX2"); NotificationCentre.AddObserver(this, "OnMonsterCry"); NotificationCentre.AddObserver(this, "OnExclamation"); NotificationCentre.AddObserver(this, "OnQuestion"); NotificationCentre.AddObserver(this, "OnPauseEnter"); NotificationCentre.AddObserver(this, "OnPauseExit"); NotificationCentre.AddObserver(this, "OnCrosshairAppear"); NotificationCentre.AddObserver(this, "OnCannonFire"); NotificationCentre.AddObserver(this, "OnGooey1"); NotificationCentre.AddObserver(this, "OnGooey2"); NotificationCentre.AddObserver(this, "OnZombunnyLaugh"); NotificationCentre.AddObserver(this, "OnMissionClear"); NotificationCentre.AddObserver(this, "OnIgniteCannon"); NotificationCentre.AddObserver(this, "OnPlayerDeath"); src = GetComponent <AudioSource> (); one = gameObject.AddComponent <AudioSource> () as AudioSource; pause = gameObject.AddComponent <AudioSource> () as AudioSource; InitializeAudioSource(one); InitializeAudioSource(pause); pause.ignoreListenerVolume = true; }
void Awake() { /** * Won't throw error even if it doesn't exist. */ player = GameObject.FindWithTag("Player").transform; /** * Will throw error if they don't exist. */ nav = GetComponent <NavMeshAgent> (); animator = GetComponent <Animator> (); rigidBody = GetComponent <Rigidbody> (); hitBox = GetComponentInChildren <EnemyHitBox> (); myHealth = GetComponent <EnemyHealth> (); timer = 0f; attackEnd = false; isDead = false; isGameOver = false; audioSrc = gameObject.AddComponent <AudioSource> (); audioSrc.playOnAwake = false; audioSrc.loop = false; // Stay idle when player die. NotificationCentre.AddObserver(this, "OnPlayerDeath"); // Reassign player object when new one is created. NotificationCentre.AddObserver(this, "OnUpdatePlayer"); }
void Awake() { NotificationCentre.AddObserver(this, "OnNewGame"); NotificationCentre.AddObserver(this, "OnQuit"); cg = GetComponent <CanvasGroup> (); }
void Awake() { NotificationCentre.AddObserver(this, "OnEnemyAppear"); NotificationCentre.AddObserver(this, "OnZombunnyAppear"); if (vfxcam) { vfxcam.SetActive(false); } if (splashEffect) { splashEffect.SetActive(false); } if (splashEffect2) { splashEffect2.SetActive(false); } if (splashEffect3) { splashEffect3.SetActive(false); } if (textZombunny) { textZombunny.SetActive(false); } if (textZombear) { textZombear.SetActive(false); } }
void Awake() { icon = GetComponent <Image> (); NotificationCentre.AddObserver(this, "OnLoading"); NotificationCentre.AddObserver(this, "OnFinishLoading"); }
void Awake() { NotificationCentre.AddObserver(this, "OnIntroEvent"); NotificationCentre.AddObserver(this, "OnIntroEventExit"); NotificationCentre.AddObserver(this, "OnPickUpGun"); NotificationCentre.AddObserver(this, "OnHoldingGunHigh"); NotificationCentre.AddObserver(this, "OnPlayerActivate"); NotificationCentre.AddObserver(this, "OnEnemyAppear"); NotificationCentre.AddObserver(this, "OnBattleBegin"); NotificationCentre.AddObserver(this, "OnZoomInCannon"); NotificationCentre.AddObserver(this, "OnCameraNormalize"); NotificationCentre.AddObserver(this, "OnUpdatePlayer"); player = GameObject.FindWithTag("Player"); pe = GameObject.FindWithTag("PlayerEvent"); cam = GameObject.FindWithTag("MainCamera").GetComponent <CameraMovement> (); if (cam) { cam.gameObject.SetActive(true); cam.SetCameraOffset(new Vector3(0, 5, -7)); cam.SetCameraTarget(player); cam.SetCameraFollow(true); SetCamPosRot(new Vector3(0, 6, -7), new Vector3(40, 0, 0)); } }
void Awake() { // Set max number of enemies allowed. SSGlobals.MAX_NUM_ENEMY = 30; spawnPoints = GetComponentsInChildren <EnemySpawn> (); NotificationCentre.AddObserver(this, "OnEnemyAppear"); NotificationCentre.AddObserver(this, "OnZombearAppear"); NotificationCentre.AddObserver(this, "OnPanOut"); NotificationCentre.AddObserver(this, "OnBattleBegin"); NotificationCentre.AddObserver(this, "ReportEnemyDeath"); NotificationCentre.AddObserver(this, "OnPlayerDeath"); NotificationCentre.AddObserver(this, "OnNaturalSpawn"); NotificationCentre.AddObserver(this, "OnResumeFromCheckpoint"); if (zombunny) { zombunny.gameObject.SetActive(false); } if (zombear) { zombear.gameObject.SetActive(false); } }
void Awake() { Initialize(); NotificationCentre.AddObserver(this, "OnBlockInitialize"); NotificationCentre.AddObserver(this, "OnBlockDestructible"); NotificationCentre.AddObserver(this, "OnBlockIndestructible"); }
void Awake() { NotificationCentre.AddObserver(this, "ActivateCannon"); NotificationCentre.AddObserver(this, "DeactivateCannon"); NotificationCentre.AddObserver(this, "OnEventEnter"); NotificationCentre.AddObserver(this, "OnIgniteCannon"); OnPutOutCannon(); }
void Awake() { // // Force developers to fix bugs. // ExceptionHandler.SetupExceptionHandling(); NotificationCentre.AddObserver(this, "OnGameOver"); }
void Awake() { floorMask = LayerMask.GetMask("Floor"); animator = GetComponent <Animator>(); rigidBody = GetComponent <Rigidbody>(); NotificationCentre.AddObserver(this, "OnEventEnter"); NotificationCentre.AddObserver(this, "OnEventExit"); NotificationCentre.AddObserver(this, "OnPlayerDeath"); }
void Awake() { cg = GetComponent <CanvasGroup> (); cg.alpha = 0; coroutine = null; NotificationCentre.AddObserver(this, "DisplayHowToPlay"); NotificationCentre.AddObserver(this, "HideHowToPlay"); NotificationCentre.AddObserver(this, "Continue"); }
void Awake() { img = GetComponent <Image> (); lastCoroutine = null; // Register on Awake so you won't miss any early notification. NotificationCentre.AddObserver(this, "OnNewGame"); NotificationCentre.AddObserver(this, "OnIntroEvent"); NotificationCentre.AddObserver(this, "OnFadeIn"); NotificationCentre.AddObserver(this, "OnFadeOut"); }
void Awake() { NotificationCentre.AddObserver(this, "PauseAllow"); NotificationCentre.AddObserver(this, "PauseDisallow"); NotificationCentre.AddObserver(this, "Pause"); NotificationCentre.AddObserver(this, "PressEnterToContinue"); pauseAllowed = false; paused = false; pressEnterToContinue = false; }
void Awake() { NotificationCentre.AddObserver(this, "OnIntroEvent"); NotificationCentre.AddObserver(this, "OnEnemyRushOver"); NotificationCentre.AddObserver(this, "OnActivateFlammableBlock"); NotificationCentre.AddObserver(this, "OnResumeFromCheckpoint"); if (flammableBlock) { flammableBlock.SetActive(false); } }
void Awake() { c = GetComponent <SphereCollider> (); eventTriggered = false; NotificationCentre.AddObserver(this, "OnIntroEvent"); NotificationCentre.AddObserver(this, "OnHoldingGunHigh"); NotificationCentre.AddObserver(this, "Continue"); // Activate only in new game. SetActiveGun(false); }
void Awake() { canShoot = true; shootableMask = LayerMask.GetMask("Shootable", "Enemy"); gunParticles = GetComponent <ParticleSystem> (); gunLine = GetComponent <LineRenderer> (); gunAudio = gameObject.AddComponent <AudioSource> (); gunAudio.clip = gunClip; gunAudio.playOnAwake = false; gunLight = GetComponent <Light> (); NotificationCentre.AddObserver(this, "OnPlayerDeath"); }
void Awake() { //NotificationCentre.AddObserver (this, "OnEventEnter"); //NotificationCentre.AddObserver (this, "OnEventExit"); NotificationCentre.AddObserver(this, "OnIntroEvent"); NotificationCentre.AddObserver(this, "OnPlayerActivate"); NotificationCentre.AddObserver(this, "OnBattleBegin"); NotificationCentre.AddObserver(this, "OnEnemyRushOver"); NotificationCentre.AddObserver(this, "OnEnemyRushOverExit"); NotificationCentre.AddObserver(this, "OnResumeFromCheckpoint"); GetPlayer(); }
//private MeshRenderer [] meshes; //private SkinnedMeshRenderer [] skins; void Awake() { //NotificationCentre.AddObserver (this, "OnEventEnter"); //NotificationCentre.AddObserver (this, "OnEventExit"); NotificationCentre.AddObserver(this, "OnIntroEvent"); NotificationCentre.AddObserver(this, "OnIntroEventCameraDone"); NotificationCentre.AddObserver(this, "OnPickUpGun"); NotificationCentre.AddObserver(this, "OnPlayerActivate"); GetPlayer(); if (pe) { pe.SetActive(false); } }
void Awake() { anim = GetComponent <Animator> (); hitParticles = GetComponentInChildren <ParticleSystem> (); capsuleCollider = GetComponent <CapsuleCollider> (); meshRenderer = GetComponentInChildren <SkinnedMeshRenderer> (); currentHealth = startingHealth; enemyAudio = gameObject.AddComponent <AudioSource> (); enemyAudio.loop = false; enemyAudio.playOnAwake = false; // Listen to annihilation command, which instantly destroys all enemies. NotificationCentre.AddObserver(this, "OnDestroyAllEnemies"); // Initialize AudioQueue AudioQueue.AddData(hurtClip, 0.1f); AudioQueue.AddData(deathClip, 0.1f); }
void Awake() { healthBar = GetComponent <Slider> (); healthBar.minValue = 0; healthBar.maxValue = maxHP; cGroup = GetComponent <CanvasGroup> (); playerSFX = GameObject.FindWithTag("Player").GetComponent <PlayerSFXManager> (); VFX = GameObject.FindWithTag("VisualEffect").GetComponent <VFXManager> (); // Add invincibility. Player is invincible during event. NotificationCentre.AddObserver(this, "OnEventEnter"); NotificationCentre.AddObserver(this, "OnEventExit"); NotificationCentre.AddObserver(this, "OnResumeFromCheckpoint"); invincible = false; Initialize(); }
private void Awake() { NotificationCentre.AddObserver(this, "DisplayText"); NotificationCentre.AddObserver(this, "HideText"); }
void Awake() { NotificationCentre.AddObserver(this, "OnEventEnter"); }
void Awake() { NotificationCentre.AddObserver(this, "OnPauseEnter"); NotificationCentre.AddObserver(this, "OnPauseExit"); }
void Awake() { NotificationCentre.AddObserver(this, "OnNewGame"); }