-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# This .gitignore file should be placed at the root of your Unity project directory | ||
# | ||
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore | ||
# | ||
/[Ll]ibrary/ | ||
/[Tt]emp/ | ||
/[Oo]bj/ | ||
/[Bb]uild/ | ||
/[Bb]uilds/ | ||
/[Ll]ogs/ | ||
/[Uu]ser[Ss]ettings/ | ||
|
||
# MemoryCaptures can get excessive in size. | ||
# They also could contain extremely sensitive data | ||
/[Mm]emoryCaptures/ | ||
|
||
# Asset meta data should only be ignored when the corresponding asset is also ignored | ||
!/[Aa]ssets/**/*.meta | ||
|
||
# Uncomment this line if you wish to ignore the asset store tools plugin | ||
# /[Aa]ssets/AssetStoreTools* | ||
|
||
# Autogenerated Jetbrains Rider plugin | ||
/[Aa]ssets/Plugins/Editor/JetBrains* | ||
|
||
# System | ||
.DS_Store | ||
|
||
# Visual Studio cache directory | ||
.vs/ | ||
|
||
# Rider cache directory | ||
.idea/ | ||
|
||
# Gradle cache directory | ||
.gradle/ | ||
|
||
# Autogenerated VS/MD/Consulo solution and project files | ||
ExportedObj/ | ||
.consulo/ | ||
*.csproj | ||
*.unityproj | ||
*.sln | ||
*.suo | ||
*.tmp | ||
*.user | ||
*.userprefs | ||
*.pidb | ||
*.booproj | ||
*.svd | ||
*.pdb | ||
*.mdb | ||
*.opendb | ||
*.VC.db | ||
|
||
# Unity3D generated meta files | ||
*.pidb.meta | ||
*.pdb.meta | ||
*.mdb.meta | ||
|
||
# Unity3D generated file on crash reports | ||
sysinfo.txt | ||
|
||
# Builds | ||
*.apk | ||
*.unitypackage | ||
|
||
# Crashlytics generated file | ||
crashlytics-build.properties |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"files.exclude": | ||
{ | ||
"**/.DS_Store":true, | ||
"**/.git":true, | ||
"**/.gitignore":true, | ||
"**/.gitmodules":true, | ||
"**/*.booproj":true, | ||
"**/*.pidb":true, | ||
"**/*.suo":true, | ||
"**/*.user":true, | ||
"**/*.userprefs":true, | ||
"**/*.unityproj":true, | ||
"**/*.dll":true, | ||
"**/*.exe":true, | ||
"**/*.pdf":true, | ||
"**/*.mid":true, | ||
"**/*.midi":true, | ||
"**/*.wav":true, | ||
"**/*.gif":true, | ||
"**/*.ico":true, | ||
"**/*.jpg":true, | ||
"**/*.jpeg":true, | ||
"**/*.png":true, | ||
"**/*.psd":true, | ||
"**/*.tga":true, | ||
"**/*.tif":true, | ||
"**/*.tiff":true, | ||
"**/*.3ds":true, | ||
"**/*.3DS":true, | ||
"**/*.fbx":true, | ||
"**/*.FBX":true, | ||
"**/*.lxo":true, | ||
"**/*.LXO":true, | ||
"**/*.ma":true, | ||
"**/*.MA":true, | ||
"**/*.obj":true, | ||
"**/*.OBJ":true, | ||
"**/*.asset":true, | ||
"**/*.cubemap":true, | ||
"**/*.flare":true, | ||
"**/*.mat":true, | ||
"**/*.meta":true, | ||
"**/*.prefab":true, | ||
"**/*.unity":true, | ||
"build/":true, | ||
"Build/":true, | ||
"Library/":true, | ||
"library/":true, | ||
"obj/":true, | ||
"Obj/":true, | ||
"ProjectSettings/":true, | ||
"temp/":true, | ||
"Temp/":true | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
using System.Collections; | ||
using System; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using Backtrace.Unity; | ||
|
||
public class BacktraceGameController : MonoBehaviour | ||
{ | ||
|
||
private const string LastAction = "action.last"; | ||
private BacktraceClient _client; | ||
|
||
void Start() | ||
{ | ||
QualitySettings.vSyncCount = 0; | ||
Application.targetFrameRate = 10; | ||
_client = BacktraceClient.Instance; | ||
} | ||
|
||
public void Crash() | ||
{ | ||
_client[LastAction] = "Crash"; | ||
#if UNITY_EDITOR | ||
Debug.LogError("Crashing the game will crash your Editor. Preventing the crash in the editor mode."); | ||
return; | ||
#endif | ||
|
||
Debug.LogWarning("Crashing the game"); | ||
UnityEngine.Diagnostics.Utils.ForceCrash(UnityEngine.Diagnostics.ForcedCrashCategory.Abort); | ||
} | ||
|
||
|
||
public void HandledException() | ||
{ | ||
try | ||
{ | ||
Debug.LogError("Handled exception action"); | ||
ReadFile(); | ||
} | ||
catch (Exception e) | ||
{ | ||
_client.Send(e); | ||
} | ||
} | ||
|
||
public void UnhandledException() | ||
{ | ||
Debug.LogWarning("Unhandled exception action"); | ||
ReadFile(); | ||
} | ||
|
||
public void Oom() | ||
{ | ||
#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR | ||
Debug.LogWarning("Starting OOM"); | ||
StartCoroutine(StartOom()); | ||
#else | ||
Debug.LogError("Action not supported."); | ||
#endif | ||
} | ||
|
||
private bool _doOom = true; | ||
private List<Texture2D> _textures = new List<Texture2D>(); | ||
private IEnumerator StartOom() | ||
{ | ||
while (_doOom) | ||
{ | ||
var texture = new Texture2D(512, 512, TextureFormat.ARGB32, true); | ||
texture.Apply(); | ||
_textures.Add(texture); | ||
yield return new WaitForSecondsRealtime(0.5f); | ||
} | ||
} | ||
|
||
private void FreezeMainThread() | ||
{ | ||
const int anrTime = 11000; | ||
System.Threading.Thread.Sleep(anrTime); | ||
} | ||
|
||
public void StartAnr() | ||
{ | ||
Debug.LogWarning("Starting ANR in the managed Unity thread."); | ||
FreezeMainThread(); | ||
} | ||
|
||
/// <summary> | ||
/// Use this function to extend stack trace information | ||
/// </summary> | ||
private void ReadFile() | ||
{ | ||
ReadNotExistingFileFromTheStorage(); | ||
} | ||
|
||
private void ReadNotExistingFileFromTheStorage() | ||
{ | ||
throw new Exception("ReadNotExistingFileFromTheStorage"); | ||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./../../../ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.