示例#1
0
    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;
        }
    }
示例#2
0
    private IEnumerator WaitAndBreakNext(float time)
    {
        yield return(new WaitForSeconds(time));

        OnBreak?.Invoke();
        _currentPuzzle = _puzzlesQueue.Dequeue();
        _currentPuzzle.Break();
        _currentPuzzle.OnFix += FixPuzzle;
        _solvedPuzzles.Add(_currentPuzzle);
    }
示例#3
0
        public void CleanBreak()
        {
            ParticleSystem tempPs = Instantiate(ps);

            tempPs.transform.position = this.transform.position;
            tempPs.Play();
            sfxSet.Play();

            OnBreak?.Invoke();
        }
示例#4
0
        public override void Exit()
        {
            base.Exit();
            if (hasBroken)
            {
                scoreMultiplier.ApplyChange(multipliers.comboMultiplier);
                OnBreak?.Invoke();
            }

            breakableList.Clear();
            pendingBlocks.Clear();
        }
示例#5
0
    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);
        }
示例#7
0
        public void CleanBreak()
        {
            IBreakable breakable;

            for (int i = 0; i < blocks.Count; i++)
            {
                breakable = blocks[i].breakable;

                breakable.CleanBreak();
            }

            OnBreak?.Invoke();
        }
示例#8
0
        public void Break()
        {
            BeforeBreak?.Invoke();

            IBreakable breakable;

            for (int i = 0; i < blocks.Count; i++)
            {
                breakable = blocks[i].breakable;

                breakable.Break();
            }

            OnBreak?.Invoke();
        }
示例#9
0
        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();
        }
示例#10
0
    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);
    }
示例#11
0
        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;
        }
示例#12
0
 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());
 }
示例#14
0
 public void handleBreak(ushort offset, IState state) => OnBreak?.Invoke(offset, state, debugSymbols);
示例#15
0
 public void handleBreak(ushort offset, CPU cpu) => OnBreak?.Invoke(offset, cpu, debugSymbols);
示例#16
0
 public void Break() => OnBreak?.Invoke();