public void StopKillTimer() { lock (_timerLock) { KillTimer?.Change(Timeout.Infinite, Timeout.Infinite); } }
public void LimbShotFX(RaycastHit hitInfo) { int index = Random.Range(0, LimbShotBloodPrefabs.Length); GameObject obj = Instantiate(LimbShotBloodPrefabs[index], hitInfo.point, Quaternion.FromToRotation(Vector3.forward, hitInfo.normal), hitInfo.collider.transform) as GameObject; KillTimer t = obj.AddComponent <KillTimer>(); t.StartTimer(killDelay); }
public void DisposeKillTimer() { if (KillTimer != null) { KillTimer.Dispose(); KillTimer = null; } }
/// <summary> /// Updates the AwardHandler. /// </summary> public static void Update() { KillTimer.Update(); HandleKillAwards(); StepTimer.Update(); RegenTimer.Update(); HandleSpeedAwards(); }
public void StopKillTimer() { lock (_timerLock) { if (KillTimer != null) { KillTimer.Change(Timeout.Infinite, Timeout.Infinite); } } }
public void DisposeKillTimer() { lock (_timerLock) { if (KillTimer != null) { KillTimer.Dispose(); KillTimer = null; } } }
public void ChangeKillTimerIfStarted(int intervalMs) { CheckHasExited(); lock (_timerLock) { if (KillTimer != null) { Logger.Debug("Changing kill timer to {0}ms. JobId {1} PlaySessionId {2}", intervalMs, Id, PlaySessionId); KillTimer.Change(intervalMs, Timeout.Infinite); } } }
/// <summary> /// Dispose all resources. /// </summary> /// <param name="disposing">Whether to dispose all resources.</param> protected virtual void Dispose(bool disposing) { if (disposing) { Process?.Dispose(); Process = null; KillTimer?.Dispose(); KillTimer = null; CancellationTokenSource?.Dispose(); CancellationTokenSource = null; TranscodingThrottler?.Dispose(); TranscodingThrottler = null; } }
void TakeHit(Bullet b) { bloodFX.TorsoShotFX(b.hitInfo); playsplat.Instance.PlaySplatSound(); Debug.Log("hit eater"); Zanim.SetTrigger("TookHit"); iswalking = true; hitcount++; if (hitcount == 1) // gameObject.AddComponent<TimerBehavior>(); { StartCoroutine(StartGameIn18()); StartCoroutine(TriggerDeath()); KillTimer t = gameObject.transform.parent.transform.parent.gameObject.AddComponent <KillTimer>(); t.StartTimer(20); } }
public void ChangeKillTimerIfStarted() { if (HasExited) { return; } lock (_timerLock) { if (KillTimer != null) { var intervalMs = PingTimeout; //Logger.Debug("Changing kill timer to {0}ms. JobId {1} PlaySessionId {2}", intervalMs, Id, PlaySessionId); KillTimer.Change(intervalMs, Timeout.Infinite); } } }
public void StartKillTimer(TimerCallback callback, int intervalMs) { CheckHasExited(); lock (_timerLock) { if (KillTimer == null) { Logger.Debug("Starting kill timer at {0}ms. JobId {1} PlaySessionId {2}", intervalMs, Id, PlaySessionId); KillTimer = new Timer(callback, this, intervalMs, Timeout.Infinite); } else { Logger.Debug("Changing kill timer to {0}ms. JobId {1} PlaySessionId {2}", intervalMs, Id, PlaySessionId); KillTimer.Change(intervalMs, Timeout.Infinite); } } }
public void StartKillTimer(Action <object> callback, int intervalMs) { if (HasExited) { return; } lock (_timerLock) { if (KillTimer == null) { //Logger.Debug("Starting kill timer at {0}ms. JobId {1} PlaySessionId {2}", intervalMs, Id, PlaySessionId); KillTimer = _timerFactory.Create(callback, this, intervalMs, Timeout.Infinite); } else { //Logger.Debug("Changing kill timer to {0}ms. JobId {1} PlaySessionId {2}", intervalMs, Id, PlaySessionId); KillTimer.Change(intervalMs, Timeout.Infinite); } } }
// | // | // | // V //ANIMATIONEVENTLISTENER //public void OnSlideOutAnimComplete() //{ // GunPopClipOut(); // Debug.Log("yo i heard on slid complete and am not on animatorscript"); // //ready to accept a clip // //_myGunBools.BmagIn = false; _myGunBools.BHazBullets = false; _myGunBools.BisReloading = false; //_myGunBools.CanAcceptNewClip = true; //} public void MAGmngerDropRigidMAg() { if (_curActiveMagInstance != null) { GameObject rigidclip = _curActiveMagInstance; curMagInGun = null; _curActiveMagInstance = null; rigidclip.transform.parent = null; DestroyObject(_curActiveMagInstance); rigidclip.AddComponent <Rigidbody>(); rigidclip.GetComponent <Rigidbody>().AddForce(GunClipLocation.forward * -2, ForceMode.Impulse); //rigidclip.GetComponent<Mag>().InitCanPlayCollisionSound(); KillTimer t = rigidclip.AddComponent <KillTimer>(); t.StartTimer(5.0f); } //_myGunBools.BmagIn = false; //// _myGunBools.BmagIn = false; _myGunBools.BHazBullets = false; _myGunBools.BisReloading = false; //_myGunBools.CanAcceptNewClip = true; }
public void Test_Streak(Vector3 here) { if (lastShot_wasHEadHit) { curStreakLength++; if (curStreakLength > MaxRecordedStreakLength) { MaxRecordedStreakLength = curStreakLength; } BonusToAwardForThisStreakHit += 25; GameObject so = Instantiate(StreakObject, here, Quaternion.identity); points = BonusToAwardForThisStreakHit;// + ((GameSettings.Instance.ReloadDifficulty == ARZReloadLevel.EASY) ? 100 : 125); so.GetComponent <StreakText>().SetTextbox("+ " + (points + ((GameSettings.Instance.ReloadDifficulty == ARZReloadLevel.EASY) ? 100 : 125))); KillTimer t = so.AddComponent <KillTimer>(); t.StartTimer(2); } else { BonusToAwardForThisStreakHit += 0; GameObject so = Instantiate(HeadshotEffectObject, here, Quaternion.identity); points = BonusToAwardForThisStreakHit;// + ((GameSettings.Instance.ReloadDifficulty == ARZReloadLevel.EASY) ? 100 : 125); so.GetComponent <StreakText>().SetTextbox("+ " + (points + ((GameSettings.Instance.ReloadDifficulty == ARZReloadLevel.EASY) ? 100 : 125))); KillTimer t = so.AddComponent <KillTimer>(); t.StartTimer(2); } lastShot_wasHEadHit = true; GameManager.Instance.GetScoreMAnager().Update_Add_PointsTotal(points); GameManager.Instance.GetScoreMAnager().Update_Add_PointsCurWave(points); GameManager.Instance.GetScoreMAnager().Update_BonusPoints(BonusToAwardForThisStreakHit); ScoreDebugCon.Instance.update_wasHead(lastShot_wasHEadHit); ScoreDebugCon.Instance.update_curStrek(curStreakLength); ScoreDebugCon.Instance.update_MaxStrek(MaxRecordedStreakLength); }
/// <summary> /// Marks a new kill. /// </summary> public static void NewKill() { Killing = true; KillTimer.PerformAction(); KillCount++; }
// Use this for initialization void Start() { killTimer = gameObject.AddComponent <KillTimer>(); killTimer.StartTimer(destroyTime); }
void ResetPart() { KillTimer kill = GetComponent <KillTimer>(); if (kill != null) { kill.Kill(); } GetComponent <MeshRenderer>().enabled = true; GetComponent <Rigidbody>().constraints = RigidbodyConstraints.None; /* * Vector3 minS = PartsHolder.MinSpawnArea; * Vector3 maxS = PartsHolder.MaxSpawnArea; * gameObject.transform.position = new Vector3(Random.Range(minS.x, maxS.x), Random.Range(minS.y, maxS.y), Random.Range(minS.z, maxS.z)); */ gameObject.transform.position = respawnPosition; gameObject.transform.rotation = respawnRotation; ConstantForce force = gameObject.GetComponent <ConstantForce>(); if (force == null) { force = gameObject.AddComponent <ConstantForce>(); } gameObject.layer = 8; ConnectionScanning scan = gameObject.GetComponent <ConnectionScanning>(); if (scan == null) { scan = gameObject.AddComponent <ConnectionScanning>(); scan.WaitSeconds = 1; } PartBehaviour behaviour = gameObject.GetComponent <PartBehaviour>(); if (behaviour == null) { behaviour = gameObject.AddComponent <PartBehaviour>(); } if (PlacementReferences.PlacementType == PlacementReferences.PlaceChoreo.PickNChose) { scan.enabled = false; behaviour.enabled = false; } var handler = GetComponent <ConnectionScanningHandler>(); if (handler != null) { handler.FailedConnection(gameObject); } Destroy(this); }