public void OnResumeButtonClicked() { AUD_Manager.PlayerDialogue(closePauseMenuDialog, gameObject, Player.Value); UIManager.Instance.ShowScreen <GameScreen>(); AUD_Manager.PostEvent("IG_UI_MenuClose_ST", gameObject); AUD_Manager.SetState("PauseMenu", "ResumeGame"); }
// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { // AUD_Manager.SetSwitch("Voice", "Banter", gameObject); // AUD_Manager.PostEvent("VC_ALIENGRUNT_ST", gameObject); // Play a different sound as well // AUD_Manager.PostEvent("PC_OilSplash_LP_PL", gameObject); // AUD_Manager.PostEvent("PC_OilThrow_LP_PL", gameObject); if (usesSwitch) { Debug.Log("Switch Group: " + switchGroup); Debug.Log("Switch State: " + switchState); AUD_Manager.SetSwitch(switchGroup, switchState, gameObject); } if (usesSwitch2) { Debug.Log("Switch Group: " + switchGroup2); Debug.Log("Switch State: " + switchState2); AUD_Manager.SetSwitch(switchGroup2, switchState2, gameObject); } AUD_Manager.PostEvent(nameOfEvent, gameObject); } }
public virtual void GetHitByMelee() { AUD_Manager.PostEvent("EN_Hit_ST", gameObject); // here we check if we have a shield, and just return it if true. if (GetComponentInChildren <EnemyForceField>() != null) { return; } Instantiate(hitParticles, transform.position, transform.rotation); owner.TakeDamage(50f); if (owner.GetHealth() > 0f && GetComponent <AI_FlyLogic>() != null) { owner.mStateChange = STATE.FLYING; // now add a force slightly up and away from the player. Vector3 dirFromPlayer = transform.position - owner.mPlayerTrans.Value.position; dirFromPlayer.y = 0f; // need a small percentage in the y dir though. float strength = Vector3.Magnitude(dirFromPlayer); dirFromPlayer.y = strength * 0.3f; dirFromPlayer = Vector3.Normalize(dirFromPlayer); // dirFromPlayer.y+=0.3f; // gotta make them fly up. GetComponent <Rigidbody>().AddForce(dirFromPlayer * mMeleeForce.Value); GetComponent <AI_FlyLogic>().mTimeStartedFlying = Time.time; // we also gotta "cheat" a little bit by pushing them up a little bit, to ensure no early collisions with the ground. Vector3 newPos = transform.position; newPos.y += 0.5f; transform.position = newPos; AUD_Manager.PostEvent("PC_MeleeImpact_ST_LP", gameObject); } }
private void Die() { // For now, not using object pooling. In the future, potentially just set GEtComponent<Renderer>().enabled = false; mState = STATE.DEAD; if (mRed) { Instantiate(mBase.mRedDeathParticles, transform.position, transform.rotation); } else { Instantiate(mBase.mBlueDeathParticles, transform.position, transform.rotation); } if (mRed) { Instantiate(mBase.mRedDeathMark, transform.position, transform.rotation); } else { Instantiate(mBase.mBlueDeathMark, transform.position, transform.rotation); } Instantiate(mBase.mDeathScream, transform.position, transform.rotation); mMaster.HandleDeadNPC(this); AUD_Manager.DynamicDialogueFromData(mBase.mDeathDialogue, gameObject); Destroy(transform.parent.gameObject); }
public void HandleStopSliding() { AUD_Manager.PostEvent("PC_SlideStop_ST", gameObject); // Play dialogue for when we stop. AUD_Manager.PlayerDialogue(mSlideStop, gameObject, Player.Value); }
public void OnSecondSectionOver() { Debug.Log("Third section audio"); AUD_Manager.PostEvent("MS_GAMEPLAY_LP_SP", gameObject); AUD_Manager.EventFromData(mThirdStage, gameObject); mInd = 2; }
public void OnThirdSectionOver() { Debug.Log("Fourth Section audio"); AUD_Manager.PostEvent("MS_GAMEPLAY_LP_SP", gameObject); AUD_Manager.EventFromData(mFourthStage, gameObject); mInd = 3; }
public void HandleStartSliding() { AUD_Manager.PostEvent("PC_SlideStart_ST", gameObject); // Play some dialogue line when we start. AUD_Manager.PlayerDialogue(mSlideStart, gameObject, Player.Value); }
public void Die() { AUD_Manager.PostEvent("AM_ShieldBarrierImpact_ST", gameObject); Instantiate(ThrowableArrow, transform.position, transform.rotation); Instantiate(DeathParticles, transform.position, transform.rotation); Destroy(gameObject); }
private void StartSlowMotion() { lastSlowMotionEffectStartTimestamp = Time.unscaledTime; Time.timeScale = slowDownFactor; Time.fixedDeltaTime = Time.timeScale * 0.02f; // Because fixed update runs at 50fps AUD_Manager.PostEvent("FX_Slomo_LP_PL", gameObject); }
protected override void UIScreenEnabled() { currentTipIndex = 0; currentTip.sprite = tips[currentTipIndex]; StartCoroutine(SetPreselectedObject()); AUD_Manager.PostEvent("FE_UI_Enter_ST", gameObject); }
public void OnJonSelected() { CharSelect.Value = "jon"; MN_Manager.Instance.ShowScreen <MN_DiffSelect>(); AUD_Manager.PlayerDialogue(mGratitudeLine, mCam.gameObject, CharSelect.Value); Events.OnButtonPress.Raise(null); }
// Run from the player, also plays sound at this point. public void Run() { mMover.mCanUsePath = false; // if we're not already charging, set our state to charging if (!mIsFleeing) { string[] args = new string[] { "Grunt", "Cower" }; AUD_Manager.DynamicDialogue("VO_Negatives_E", args, gameObject); mAnim.mState = AnimState.FLEEING; mIsFleeing = true; mTimeStartedFlee = Time.time; // set the goal to somewhere behind the player. Vector3 dir = transform.position - mEntity.mPlayerTrans.Value.position; dir.y = 0f; Vector3 spot = transform.position + Vector3.Normalize(dir) * 100f; mEntity.mGoalPos = spot; } mEntity.mCurMaxVel = mEntity.GetBase().mMaxSpd * 1.2f; mRigid.rotation = mOrienter.OrientToDirection(mRigid.velocity); // handle if the flee state has finished. if (Time.time - mTimeStartedFlee > mEntity.GetBase().mFleeTime.Value) { mMover.mCanUsePath = true; mIsFleeing = false; mCanFlee = false; Invoke("CanFlee", 0.2f); mAnim.mState = AnimState.IDLE; } }
private void HandleWorkoutTipSwitch() { if ((input.leftStickX >= 0.5f || input.leftStickX <= -0.5f) && Time.unscaledTime >= lastChangeTimestamp + timeBetweenChanges) { lastChangeTimestamp = Time.unscaledTime; if (input.leftStickX >= 0.5f) { if (currentTipIndex == tips.Length - 1) { currentTipIndex = 0; } else { currentTipIndex++; } } else if (input.leftStickX <= 0.5f) { if (currentTipIndex == 0) { currentTipIndex = tips.Length - 1; } else { currentTipIndex--; } } currentTip.sprite = tips[currentTipIndex]; AUD_Manager.PostEvent("FE_Transitions_ST", gameObject); } }
private void OnTriggerEnter(Collider other) { if (other.GetComponent <PlayerController>()) { AUD_Manager.SetState("LocationReverb", "Interior"); } }
private void Update() { if (disableInput.Value) { return; } if (isChargingThrow.Value == false && canThrowGrenade.Value == false) { if (Time.time >= lastGrenadeThrowTimestamp.Value + grenadeLauncherProperties.coolDownTime) { grenadeCooldownStatus.Value = 1.1f; canThrowGrenade.Value = true; lastGrenadeThrowTimestamp.Value = 0f; onGrenadeAvailable.Raise(null); AUD_Manager.PostEvent("IG_UI_Oil_ST", gameObject); } else { grenadeCooldownStatus.Value = Time.time.Normalize(lastGrenadeThrowTimestamp.Value, lastGrenadeThrowTimestamp.Value + grenadeLauncherProperties.coolDownTime); } } if (input.leftBumperPressed && canThrowGrenade.Value == true && isChargingThrow.Value == false && playerState.deflecting == false && playerState.sliding == false && playerState.throwingObject == false && playerState.meleeing == false) { StartThrowingGrenade(); } ChargeGrenadeThrow(); }
public void DeflectPerfeclty(float multiplier) { // Starts as random SetStartingDeflectionState(); // If the enemy was killed in the process...we try to get another enemy, if it is the last one we make it look like random SetTarget(enemyBulletOwner); if (target == null) { AI_Master AI = FindObjectOfType <AI_Master>(); if (AI != null) { Transform newEnemy = AI.GetClosestEnemy(transform.position); if (newEnemy != null) { SetTarget(newEnemy); } } } ; if (target == null) { SetRandomDirection(); Instantiate(particlesWhenBouncedRandomly, transform.position, transform.rotation); return; } SetPerfectDirection(multiplier); ChangeColor(); Instantiate(particlesWhenBouncedPerfectly, transform.position, transform.rotation); AUD_Manager.SetSwitch("Parry", "Success", gameObject); AUD_Manager.PostEvent("PC_Perry_ST", gameObject); bouncedPerfectly = true; }
private void Update() { if (input.startButtonPressed && playerState.isPlayerDead == false) { AUD_Manager.PlayerDialogue(openPauseMenuDialog, gameObject, Player.Value); UIManager.Instance.ShowScreen <PauseScreen>(); } }
private void Start() { AUD_Manager.SetSwitch("Objective", mObjectiveState, gameObject); AUD_Manager.SetSwitch("ObjectiveProgress", "Low", gameObject); AUD_Manager.PostEvent(mGameplayMusicPlay, gameObject); mIntensityText.text = "Music Intensity: " + "Low"; }
private void OnDestroy() { if (bouncedByPlayer == false) { bulletTracker.bullets.Remove(this); } AUD_Manager.PostEvent(properties.ad_stop, gameObject); }
public void DeflectRandomly() { SetStartingDeflectionState(); SetRandomDirection(); Instantiate(particlesWhenBouncedRandomly, transform.position, transform.rotation); AUD_Manager.SetSwitch("Parry", "Almost", gameObject); AUD_Manager.PostEvent("PC_Perry_ST", gameObject); }
private void OnCollisionEnter(Collision other) { if (mEntity.mState == STATE.FLYING) { AUD_Manager.DynamicDialogueFromData(mHitsWall, gameObject); mEntity.mStateChange = STATE.COMBAT; mEntity.TakeDamage(60f); } }
// This object has a lifetime, so we can rely on that private void Start() { for (int i = 0; i < mSwitchGroups.Length; i++) { AUD_Manager.SetSwitch(mSwitchGroups[i], mSwitchStates[i], gameObject); } AUD_Manager.PostEvent(mScream, gameObject); }
// Update is called once per frame private void Start() { for (int i = 0; i < SwitchGroups.Length; i++) { AUD_Manager.SetSwitch(SwitchGroups[i], SwitchStates[i], gameObject); } AUD_Manager.PostEvent(nameOfEvent, gameObject); }
protected override void UIScreenEnabled() { StartCoroutine(SetPreselectedObject()); invertYAxisToggle.isOn = input.invertYAxis; invertXAxisToggle.isOn = input.invertXAxis; volumeToggle.isOn = musicOnOff.Value; volumeSlider.value = volumeStatus.Value / 100; gammaSlider.value = gammaStatus.Value; AUD_Manager.PostEvent("FE_UI_Enter_ST", gameObject); }
public void DestroyObject() { AUD_Manager.SetSwitch("ObjectAction", "Impact", gameObject); AUD_Manager.PostEvent(properties.soundEventName, gameObject); if (properties.explosionParticlePrefab != null) { Instantiate(properties.explosionParticlePrefab, transform.position, Quaternion.identity); } Destroy(gameObject); }
public GameObject SpawnEnemy(GameObject typeToSpawn) { mSpawnTimeStamp = Time.time; mCanSpawnNow = false; AUD_Manager.PostEvent("AM_GravLiftTeleport_ST", gameObject); var clone = Instantiate(typeToSpawn, transform.position, transform.rotation); return(clone); }
private void ThrowGrenade() { animationController.PlayThrowObjectAnimation(); onPlayerAim.Raise(false); onGrenadeThrown.Raise(null); grenadeInstance.GetComponent <TanningOilGrenade>().Throw(throwingForce.Value, transform.forward); grenadeInstance = null; ResetOriginalState(); AUD_Manager.PostEvent("PC_OilThrowWhoosh_ST_PL", gameObject); AUD_Manager.PlayerDialogue(throwDialogue, gameObject, Player.Value); }
public void Drop() { hasBeenThrown = true; transform.parent = null; rb.isKinematic = false; SetTransparency(1f); gameObject.layer = initialLayer; throwHitboxCollider.isTrigger = true; throwHitboxCollider.enabled = true; AUD_Manager.SetSwitch("ObjectSize", properties.objSize, gameObject); AUD_Manager.PostEvent("PC_ThrowWhooshes_ST_PL", gameObject); }
private void Update() { if (!mWaitingForPlayer) { return; } if (Time.time - mSectionDoneTimeStamp > mDelay) { AUD_Manager.DynamicDialogueFromData(mSectionDone, gameObject); mSectionDoneTimeStamp = Time.time; } }