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); }
public void OnCheckpointRestart() { AUD_Manager.PostEvent("MS_GAMEPLAY_LP_SP", gameObject); switch (mInd) { case 0: AUD_Manager.EventFromData(mFirstStage, gameObject); break; case 1: AUD_Manager.EventFromData(mSecondStage, gameObject); break; case 2: AUD_Manager.EventFromData(mThirdStage, gameObject); break; case 3: AUD_Manager.EventFromData(mFourthStage, gameObject); break; } }
public void AddScore(object data) { if (specialPowerStatus.Value < 1f && playerState.isUsingSpecialPower == false) { float scoreToAdd = (float)data; specialPowerStatus.Value += scoreToAdd.Normalize(0f, specialPowerScoreTarget); if (specialPowerStatus.Value >= 1f) { specialPowerStatus.Value = 1f; onSlowMotionPowerAvailable.Raise(null); AUD_Manager.PostEvent("PH_UI_Up_ST", gameObject); } } }
private void Update() { if (mActive) { for (int i = 0; i < mThrowSpawnPoints.Length; i++) { if (objInstances[i] == null) { objInstances[i] = Instantiate(objPrefab, mThrowSpawnPoints[i].transform.position, mThrowSpawnPoints[i].transform.rotation); AUD_Manager.PostEvent("AM_GravLiftTeleport_ST", objInstances[i].gameObject); // AUD_Manager.PostEvent("PC_Tutorial_ObjectSpawn", objInstances[i].gameObject); Instantiate(spawnParticles, mThrowSpawnPoints[i].transform.position, mThrowSpawnPoints[i].transform.rotation); } } } }
public void TakeDamage(float damage) { health -= damage; if (health <= 0) { StartCoroutine(DestroySelf()); AUD_Manager.PostEvent("EN_LankyShieldBreak_ST", gameObject); } else { if (particles != null) { Destroy(particles.gameObject); } AUD_Manager.PostEvent("EN_LankyShieldHit_ST", gameObject); } }
private void StartThrowingGrenade() { animationController.PlayChargeGrenadeAnimation(); isChargingThrow.Value = playerState.throwingGrenade = true; canThrowGrenade.Value = false; AUD_Manager.PostEvent("PC_OilPre_ST_PL", gameObject); grenadeInstance = Instantiate(grenadePrefab); grenadeInstance.transform.SetParent(gameObject.transform); grenadeInstance.transform.localPosition = Vector3.zero; grenadeInstance.transform.localRotation = Quaternion.Euler(Vector3.zero); transform.Rotate(-grenadeLauncherProperties.throwingAngle, 0f, 0f); throwingForce.Value = grenadeLauncherProperties.minThrowingForce; grenadeInstance.GetComponent <TanningOilGrenade>().throwingForce = grenadeLauncherProperties.minThrowingForce; onPlayerAim.Raise(true); }
private void Fire() { mFireTimeStamp = Time.time; Vector3 dir = Vector3.Normalize(mVictim.position - transform.position); GameObject clone = Instantiate(mTurretGunProperties.mBullet, mFirePoint.position, Quaternion.LookRotation(dir, Vector3.up)); clone.GetComponent <Bullet>().SetOwner(transform.parent); clone.GetComponent <Bullet>().SetTarget(mVictim); Instantiate(mGunProperties.mMuzzleBlast, mFirePoint.transform.position, transform.rotation); AUD_Manager.PostEvent(mGunProperties.mAudFireEvent, gameObject); mCurChargeAmt = 0f; }
// Called by the run animation at the correct frame. private void RunStep() { // Now we actually have to raycast downwards and check what type of terrain we're on. TerrainType type = FindTerrainStandingOn(); switch (type) { case TerrainType.GRASS: AUD_Manager.SetSwitch("Surface_Type", "Grass", gameObject); break; case TerrainType.SAND: AUD_Manager.SetSwitch("Surface_Type", "Sand", gameObject); break; case TerrainType.CONCRETE: AUD_Manager.SetSwitch("Surface_Type", "Concrete", gameObject); break; case TerrainType.ERROR: break; } AUD_Manager.PostEvent(mRunStepEventName, gameObject); }
public void PickUp(Transform parentTransform) { foreach (Collider coll in collidersBeforePickup) { coll.isTrigger = true; coll.enabled = false; } transform.parent = parentTransform; transform.localRotation = Quaternion.Euler(rotationWhenPickedUp); initialLayer = gameObject.layer; pickedUp = true; gameObject.layer = layerWhenPickedUp; if (properties.transparencyWhenPickedup != 0.0) { SetTransparency(properties.transparencyWhenPickedup); } AUD_Manager.SetSwitch("ObjectAction", "Pickup", gameObject); AUD_Manager.PostEvent(properties.soundEventName, gameObject); }
private void Fire() { mFireTimeStamp = Time.time; Vector3 dir = Vector3.Normalize(mVictim.position - transform.position); GameObject clone; bool red = (Random.value < 0.5); if (red) { clone = Instantiate(mCannonProperties.mRedBullet, mFirePoint.position, Quaternion.LookRotation(dir, Vector3.up)); } else { clone = Instantiate(mCannonProperties.mBlueBullet, mFirePoint.position, Quaternion.LookRotation(dir, Vector3.up)); } clone.GetComponent <Bullet>().SetOwner(mEntity.transform); clone.GetComponent <Bullet>().SetTarget(mVictim); Instantiate(mGunProperties.mMuzzleBlast, mFirePoint.transform.position, transform.rotation); AUD_Manager.PostEvent(mGunProperties.mAudFireEvent, gameObject); AUD_Manager.DynamicDialogueFromData(mEntity.GetBase().mShootLine, gameObject); mEntity.GetBase().mEnemyFired.Raise(null); // Tank cannon specific stuff. mNumFiredThisVolley++; if (mNumFiredThisVolley == mCannonProperties.mNumInVolley) { mState = CANNON_STATE.CHARGING; mCurChargeAmt = 0f; mNumFiredThisVolley = 0; } else { mState = CANNON_STATE.PREFIRE; mCurChamberAmt = 0f; } }
/************************************************************************************************ * Each individual weapon will define how it fires its projectile. * By the time this has been called we are sure that we are firing the weapon. We have already checked * that we are loaded, charged, and nothing else is preventing us from firing. * * Great opportunity to use Carlos's Event system. ************************************************************************************************/ protected virtual void FireProjectile(Transform trans) { mFireTimeStamp = Time.time; // our plasma ray gun is as basic as it gets, spawning a plasmoid and then trying to re-chamber. // The target has already been set, and the projectile now simply has to have force added in the direction Vector3 dir = Vector3.Normalize(trans.position - transform.position); // GameObject clone = PhotonNetwork.Instantiate(mGunProperties.bullet.name, transform.position, Quaternion.LookRotation(dir, Vector3.up)); dir = CalculateRandomError(dir); GameObject clone = Instantiate(mRegGunProperties.bullet, firePoint.position, Quaternion.LookRotation(dir, Vector3.up)); AI_Controller owner = UT_FindComponent.FindComponent <AI_Controller>(gameObject); if (owner != null) { clone.GetComponent <Bullet>().SetOwner(owner.transform); } else { clone.GetComponent <Bullet>().SetOwner(transform); } clone.GetComponent <Bullet>().SetTarget(trans); // Also, got to create those particles for the muzzle blast if (mGunProperties.mMuzzleBlast) { var mBlast = Instantiate(mGunProperties.mMuzzleBlast, firePoint.transform.position, transform.rotation); } for (int i = 0; i < mGunProperties.mSwitchGroups.Length; i++) { AUD_Manager.SetSwitch(mGunProperties.mSwitchGroups[i], mGunProperties.mSwitchStates[i], gameObject); } AUD_Manager.PostEvent(mGunProperties.mAudFireEvent, gameObject); // play the dialogue for our character shooting. AUD_Manager.DynamicDialogueFromData(owner.GetBase().mShootLine, gameObject); // Now push the event that a weapon has fired. owner.GetBase().mEnemyFired.Raise(null); }
private void Update() { if (isGamePaused == false && Time.unscaledTime >= lastSlowMotionEffectStartTimestamp + timeBeforeStartRecovering) { Time.timeScale += (1f / slowDownRecoveryTime) * Time.unscaledDeltaTime; // Not affected Time.fixedDeltaTime = Time.timeScale * 0.02f; // Because fixed update runs at 50fps Time.timeScale = Mathf.Clamp(Time.timeScale, 0f, 1f); if (Time.timeScale == 1f && cachedTimeScale != Time.timeScale) { AUD_Manager.PostEvent("FX_Slomo_LP_SP", gameObject); if (triggeredBySpecialMove) { onSlowMotionEffectEnded.Raise(null); triggeredBySpecialMove = false; } } cachedTimeScale = Time.timeScale; } }
private void Awake() { rb = GetComponent <Rigidbody>(); damage = properties.defaultDamage; speed = properties.defaultSpeed; if (Difficulty.Value == "EASY") { damage *= properties.easyDamageMult; speed *= properties.easySpeedMult; } if (Difficulty.Value == "NORMAL") { damage *= properties.normalDamageMult; speed *= properties.normalSpeedMult; } SetVelocity(); bulletTracker.bullets.Add(this); isHoming = properties.startHomingInmediatly; AUD_Manager.PostEvent(properties.ad_loop, gameObject); }
public void OnPoseStarted(object data) { AUD_Manager.PlayerDialogue(mPoseDialogue, gameObject, Player.Value); AUD_Manager.PostEvent(mEvent, gameObject); }
protected override void UIScreenDisabled() { AUD_Manager.PostEvent("FE_UI_Back_ST", gameObject); }
public void OnSelect(BaseEventData eventData) { AUD_Manager.PostEvent("FE_UI_Down_ST", gameObject); }
public void PlayMeleeSounds() { AUD_Manager.PlayerDialogue(mAttack, gameObject, Player.Value); AUD_Manager.PostEvent("PC_MeleeWhoosh_ST_PL", gameObject); }
public void OnScreenTransitioned() { AUD_Manager.PostEvent("FE_Transitions_ST", gameObject); }
public void HandleSlideReplenish() { AUD_Manager.PostEvent("IG_UI_Slide_ST", gameObject); }
protected override void UIScreenEnabled() { StartCoroutine(SetPreselectedObject()); AUD_Manager.PostEvent("IG_UI_MenuOpen_ST", gameObject); AUD_Manager.SetState("PauseMenu", "PauseGame"); }
public void HandleLand() { AUD_Manager.PostEvent("PC_JumpStart_ST", gameObject); AUD_Manager.PlayerDialogue(mJumpLand, gameObject, Player.Value); }
public void OnButtonPress() { AUD_Manager.PostEvent("FE_UI_Enter_ST", gameObject); }
private void OnDestroy() { AUD_Manager.PostEvent("AM_GravLift_LP_SP", gameObject); }
private void Awake() { Instantiate(explosionParticles, transform.position, Quaternion.identity); AUD_Manager.PostEvent("PC_OilSplash_ST_PL", gameObject); Destroy(gameObject, 0.2f); }
public void OnBackScreen() { AUD_Manager.PostEvent("FE_UI_Back_ST", gameObject); }
public void EnemySpawnLiftSound() { AUD_Manager.PostEvent(eName, gameObject); }
private void OnDestroy() { AUD_Manager.PostEvent("PC_SlideStop_ST", gameObject); }
public void OnScrollDown() { AUD_Manager.PostEvent("FE_UI_Up_ST", gameObject); }
// Use this for initialization void Start() { AUD_Manager.PostEvent("AM_GravLift_LP_PL", gameObject); }
protected override void UIScreenEnabled() { AUD_Manager.PostEvent("FE_UI_Enter_ST", gameObject); }