public void Hit(float damage) { if (broken) { return; } hp -= damage; OnHit?.Invoke(); if (hp < HP_LOW_THRESHOLD) { OnBreak?.Invoke(); if (doDestroyOnBreak) { Destroy(gameObject); } if (breakFXPrefab != null) { Instantiate(breakFXPrefab, transform.position, Quaternion.identity); } hp = 0; broken = true; } }
private IEnumerator WaitAndBreakNext(float time) { yield return(new WaitForSeconds(time)); OnBreak?.Invoke(); _currentPuzzle = _puzzlesQueue.Dequeue(); _currentPuzzle.Break(); _currentPuzzle.OnFix += FixPuzzle; _solvedPuzzles.Add(_currentPuzzle); }
public void CleanBreak() { ParticleSystem tempPs = Instantiate(ps); tempPs.transform.position = this.transform.position; tempPs.Play(); sfxSet.Play(); OnBreak?.Invoke(); }
public override void Exit() { base.Exit(); if (hasBroken) { scoreMultiplier.ApplyChange(multipliers.comboMultiplier); OnBreak?.Invoke(); } breakableList.Clear(); pendingBlocks.Clear(); }
public void Shatter(int delayMultiplier, bool sound = true) { Shattering = true; ShatterCountdown = delayMultiplier * BreakDelayAdd; pitchMultiplier = Mathf.Pow(9f / 8, delayMultiplier); mover.Locked = true; OnBreak?.Invoke(); shatterSound = sound; Destroy(chainIndicator); }
public int OnModeChange(DBGMODE dbgmodeNew) { if (dbgmodeNew == DBGMODE.DBGMODE_Break) { OnBreak?.Invoke(); } else if (dbgmodeNew == DBGMODE.DBGMODE_Design) { OnDebugEnd?.Invoke(); } return(VSConstants.S_OK); }
public void CleanBreak() { IBreakable breakable; for (int i = 0; i < blocks.Count; i++) { breakable = blocks[i].breakable; breakable.CleanBreak(); } OnBreak?.Invoke(); }
public void Break() { BeforeBreak?.Invoke(); IBreakable breakable; for (int i = 0; i < blocks.Count; i++) { breakable = blocks[i].breakable; breakable.Break(); } OnBreak?.Invoke(); }
public void Break() { BeforeBreak?.Invoke(); ParticleSystem tempPs = Instantiate(ps); tempPs.transform.position = this.transform.position; tempPs.Play(); sfxSet.Play(); breakCount.ApplyChange(1); CameraShaker.Instance.ShakeOnce(Magnitude, Roughness, 0, FadeOutTime); OnBreak?.Invoke(); }
private void BreakOnHit() { GameObject instantiatedBrokenVersion = Instantiate(brokenVersion, transform.position, transform.rotation); OnBreak?.Invoke(instantiatedBrokenVersion); if (fadeAwayAfterBreaking) { ObjectFader objectFader = instantiatedBrokenVersion.GetComponent <ObjectFader>(); if (objectFader) { objectFader.FadeToTransparent(secondsLater: destroyInSeconds, destroyAfter: true); } } Rigidbody[] rigidbodies = instantiatedBrokenVersion.GetComponentsInChildren <Rigidbody>(); foreach (Rigidbody r in rigidbodies) { r.AddExplosionForce(explosionForce, transform.position, 1f); } Destroy(gameObject); }
private void OnComboChanged(int combo) { if (combo == prev_combo) { return; } if (combo < prev_combo) { combo_level = 0; OnBreak?.Invoke(Math.Abs(combo - prev_combo)); } else { if (combo >= (combo_level + 1) * COMBO_RANK_DEFAULT) { combo_level++; OnComboRankUp?.Invoke(combo_level); } } prev_combo = combo; }
private void InitCallbacks() { m_callbacksArray = new Dictionary <ManagedCallbackType, DebugEventHandler <CorEventArgs> > { { ManagedCallbackType.OnBreakpoint, (sender, args) => OnBreakpoint?.Invoke(sender, (BreakpointEventArgs)args) }, { ManagedCallbackType.OnStepComplete, (sender, args) => OnStepComplete?.Invoke(sender, (StepCompleteEventArgs)args) }, { ManagedCallbackType.OnBreak, (sender, args) => OnBreak?.Invoke(sender, (ThreadEventArgs)args) }, { ManagedCallbackType.OnException, (sender, args) => OnException?.Invoke(sender, (ExceptionEventArgs)args) }, { ManagedCallbackType.OnEvalComplete, (sender, args) => OnEvalComplete?.Invoke(sender, (EvalEventArgs)args) }, { ManagedCallbackType.OnEvalException, (sender, args) => OnEvalException?.Invoke(sender, (EvalEventArgs)args) }, { ManagedCallbackType.OnCreateProcess, (sender, args) => OnCreateProcess?.Invoke(sender, (ProcessEventArgs)args) }, { ManagedCallbackType.OnProcessExit, (sender, args) => OnProcessExit?.Invoke(sender, (ProcessEventArgs)args) }, { ManagedCallbackType.OnCreateThread, (sender, args) => OnCreateThread?.Invoke(sender, (ThreadEventArgs)args) }, { ManagedCallbackType.OnThreadExit, (sender, args) => OnThreadExit?.Invoke(sender, (ThreadEventArgs)args) }, { ManagedCallbackType.OnModuleLoad, (sender, args) => OnModuleLoad?.Invoke(sender, (ModuleEventArgs)args) }, { ManagedCallbackType.OnModuleUnload, (sender, args) => OnModuleUnload?.Invoke(sender, (ModuleEventArgs)args) }, { ManagedCallbackType.OnClassLoad, (sender, args) => OnClassLoad?.Invoke(sender, (ClassEventArgs)args) }, { ManagedCallbackType.OnClassUnload, (sender, args) => OnClassUnload?.Invoke(sender, (ClassEventArgs)args) }, { ManagedCallbackType.OnDebuggerError, (sender, args) => OnDebuggerError?.Invoke(sender, (DebuggerErrorEventArgs)args) }, { ManagedCallbackType.OnLogMessage, (sender, args) => OnLogMessage?.Invoke(sender, (LogMessageEventArgs)args) }, { ManagedCallbackType.OnLogSwitch, (sender, args) => OnLogSwitch?.Invoke(sender, (LogSwitchEventArgs)args) }, { ManagedCallbackType.OnCreateAppDomain, (sender, args) => OnCreateAppDomain?.Invoke(sender, (AppDomainEventArgs)args) }, { ManagedCallbackType.OnAppDomainExit, (sender, args) => OnAppDomainExit?.Invoke(sender, (AppDomainEventArgs)args) }, { ManagedCallbackType.OnAssemblyLoad, (sender, args) => OnAssemblyLoad?.Invoke(sender, (AssemblyEventArgs)args) }, { ManagedCallbackType.OnAssemblyUnload, (sender, args) => OnAssemblyUnload?.Invoke(sender, (AssemblyEventArgs)args) }, { ManagedCallbackType.OnControlCTrap, (sender, args) => OnControlCTrap?.Invoke(sender, (ProcessEventArgs)args) }, { ManagedCallbackType.OnNameChange, (sender, args) => OnNameChange?.Invoke(sender, (ThreadEventArgs)args) }, { ManagedCallbackType.OnUpdateModuleSymbols, (sender, args) => OnUpdateModuleSymbols?.Invoke(sender, (UpdateModuleSymbolsEventArgs)args) }, { ManagedCallbackType.OnFunctionRemapOpportunity, (sender, args) => OnFunctionRemapOpportunity?.Invoke(sender, (FunctionRemapOpportunityEventArgs)args) }, { ManagedCallbackType.OnFunctionRemapComplete, (sender, args) => OnFunctionRemapComplete?.Invoke(sender, (FunctionRemapCompleteEventArgs)args) }, { ManagedCallbackType.OnBreakpointSetError, (sender, args) => OnBreakpointSetError?.Invoke(sender, (BreakpointEventArgs)args) }, { ManagedCallbackType.OnException2, (sender, args) => OnException2?.Invoke(sender, (Exception2EventArgs)args) }, { ManagedCallbackType.OnExceptionUnwind2, (sender, args) => OnExceptionUnwind2?.Invoke(sender, (ExceptionUnwind2EventArgs)args) }, { ManagedCallbackType.OnMDANotification, (sender, args) => OnMDANotification?.Invoke(sender, (MDAEventArgs)args) }, { ManagedCallbackType.OnExceptionInCallback, (sender, args) => OnExceptionInCallback?.Invoke(sender, (ExceptionInCallbackEventArgs)args) }, }; }
public void Break() { InputConnector.RemoveConnection(this); OutputConnector.RemoveConnection(this); OnBreak?.Invoke(this, new EventArgs()); }
public void handleBreak(ushort offset, IState state) => OnBreak?.Invoke(offset, state, debugSymbols);
public void handleBreak(ushort offset, CPU cpu) => OnBreak?.Invoke(offset, cpu, debugSymbols);
public void Break() => OnBreak?.Invoke();