Use Debug.Break() to pause the editor

Last updated : June 21, 2017

Posted by: 6

Use Debug.Break() in your code to pause the editor

Did you know that you can control the unity editor play state directly from your code?

Suppose, there is a moment where you want to pause the execution to check your object values. In this situation use Debug.Break().




Sample code :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DebugPauseScript : MonoBehaviour {

    public bool problem = false;

    void Update()

    {

        if (problem) {

            Debug.Break ();

        }

    }

}



Send SMS From Your Game - Unity3D

Send SMS From Your Game - Unity3D

In the game, you can use "prefer the game" feature or invite the friend(s) who...
Send Email From Your Game - Unity3D

Send Email From Your Game - Unity3D

In your game, it might be possible that user directly wants to send an email to...
Reduce a size of APK and IPA – Unity 3d

Reduce a size of APK and IPA – Unity 3d

For reducing APK size:In Unity 5.6.0f3 I have created a simple "Hello world"...
Unity3D vs. Cocos2DX

Unity3D vs. Cocos2DX

License: Unity 3D is paid while Cocos2DX is an open-source game...
You will be amazed to know that these 5 games are developed with Unity 3D

You will be amazed to know that these 5 games are developed with Unity 3D

1. Pokémon GODeveloped & published by Niantic; when both Niantic &...
Integrate Banner Ad for iOS & Android using AdMob

Integrate Banner Ad for iOS & Android using AdMob

Requirements- Unity 4 or higher- To deploy on iOS     ...
Integrate Interstitial Ad for iOS & Android using AdMob

Integrate Interstitial Ad for iOS & Android using AdMob

Requirements- Unity 4 or higher- To deploy on iOS       -...
Submit a Game to AppStore - For beginners

Submit a Game to AppStore - For beginners

Steps to submit a Game to AppStore1. Switch platform as iOS and then make a...
Use Debug.Break() to pause the editor

Use Debug.Break() to pause the editor

Use Debug.Break() in your code to pause the editorDid you know that you can...