Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added NB15230赵铭骐/IOS大作业文档.doc
Binary file not shown.
Binary file added NB15230赵铭骐/大作业 test4ios/._build
Binary file not shown.
30 changes: 30 additions & 0 deletions NB15230赵铭骐/大作业 test4ios/Classes/CrashReporter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#pragma once

// Enabling this will force app to do a hard crash instead of a nice exit when UnhandledException
// is thrown. This will force iOS to generate a standard crash report, that can be submitted to
// iTunes by app users and inspected by developers.
#define ENABLE_IOS_CRASH_REPORTING 1

// Enabling this will add a custom Objective-C Uncaught Exception handler, which will print out
// exception information to console.
#define ENABLE_OBJC_UNCAUGHT_EXCEPTION_HANDLER 1

// Enable custom crash reporter to capture crashes. Crash logs will be available to scripts via
// CrashReport API.
#define ENABLE_CUSTOM_CRASH_REPORTER 0

// Enable submission of custom crash reports to Unity servers. This will enable custom crash
// reporter.
#define ENABLE_CRASH_REPORT_SUBMISSION 0


#if ENABLE_CRASH_REPORT_SUBMISSION && !ENABLE_CUSTOM_CRASH_REPORTER
#undef ENABLE_CUSTOM_CRASH_REPORTER
#define ENABLE_CUSTOM_CRASH_REPORTER 0
#endif


void WaitWhileCrashReportsAreSent();
void SubmitCrashReportsAsync();
void UnityInstallPostCrashCallback();
void InitCrashHandling();
111 changes: 111 additions & 0 deletions NB15230赵铭骐/大作业 test4ios/Classes/CrashReporter.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@

#import "PLCrashReporter.h"
#import "CrashReporter.h"


extern NSString* GetCrashReportsPath();
void CrashedCheckBellowForHintsWhy();


static NSUncaughtExceptionHandler* gsCrashReporterUEHandler = NULL;


static void SavePendingCrashReport()
{
if (![[UnityPLCrashReporter sharedReporter] hasPendingCrashReport])
return;

NSFileManager *fm = [NSFileManager defaultManager];
NSError *error;

if (![fm createDirectoryAtPath:GetCrashReportsPath() withIntermediateDirectories:YES attributes:nil error:&error])
{
::printf("CrashReporter: could not create crash report directory: %s\n", [[error localizedDescription] UTF8String]);
return;
}

NSData *data = [[UnityPLCrashReporter sharedReporter] loadPendingCrashReportDataAndReturnError: &error];
if (data == nil)
{
::printf("CrashReporter: failed to load crash report data: %s\n", [[error localizedDescription] UTF8String]);
return;
}

NSString* file = [GetCrashReportsPath() stringByAppendingPathComponent: @"crash-"];
unsigned long long seconds = (unsigned long long)[[NSDate date] timeIntervalSince1970];
file = [file stringByAppendingString:[NSString stringWithFormat:@"%llu", seconds]];
file = [file stringByAppendingString:@".plcrash"];
if ([data writeToFile:file atomically:YES])
{
::printf("CrashReporter: saved pending crash report.\n");
if (![[UnityPLCrashReporter sharedReporter] purgePendingCrashReportAndReturnError: &error])
{
::printf("CrashReporter: couldn't remove pending report: %s\n", [[error localizedDescription] UTF8String]);
}
}
else
{
::printf("CrashReporter: couldn't save crash report.\n");
}
}


static void InitCrashReporter()
{
NSError *error;

UnityInstallPostCrashCallback();
if ([[UnityPLCrashReporter sharedReporter] enableCrashReporterAndReturnError: &error])
::printf("CrashReporter: initialized\n");
else
NSLog(@"CrashReporter: could not enable crash reporter: %@", error);

SavePendingCrashReport();
}


static void UncaughtExceptionHandler(NSException *exception) {
NSLog(@"Uncaught exception: %@: %@\n%@", [exception name], [exception reason], [exception callStackSymbols]);
if (gsCrashReporterUEHandler)
gsCrashReporterUEHandler(exception);
}


static void InitObjCUEHandler()
{
// Crash reporter sets its own handler, so we have to save it and call it manually
gsCrashReporterUEHandler = NSGetUncaughtExceptionHandler();
NSSetUncaughtExceptionHandler(&UncaughtExceptionHandler);
}


void InitCrashHandling()
{
#if ENABLE_CUSTOM_CRASH_REPORTER
InitCrashReporter();
#endif

#if ENABLE_OBJC_UNCAUGHT_EXCEPTION_HANDLER
InitObjCUEHandler();
#endif
}


// This function will be called when AppDomain.CurrentDomain.UnhandledException event is triggered.
// When running on device the app will do a hard crash and it will generate a crash log.
void CrashedCheckBellowForHintsWhy()
{
#if ENABLE_CRASH_REPORT_SUBMISSION
// Wait if app has crashed before we were able to submit an older pending crash report. This
// could happen if app crashes at startup.
WaitWhileCrashReportsAreSent();
#endif

#if ENABLE_IOS_CRASH_REPORTING || ENABLE_CUSTOM_CRASH_REPORTER
// Make app crash hard here
__builtin_trap();

// Just in case above doesn't work
abort();
#endif
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif



#include "mscorlib_System_Array.h"

#pragma once
// UnityStandardAssets.CrossPlatformInput.AxisTouchButton[]
// UnityStandardAssets.CrossPlatformInput.AxisTouchButton[]
struct AxisTouchButtonU5BU5D_t149 : public Array_t { };
// UnityStandardAssets.CrossPlatformInput.CrossPlatformInputManager/VirtualAxis[]
// UnityStandardAssets.CrossPlatformInput.CrossPlatformInputManager/VirtualAxis[]
struct VirtualAxisU5BU5D_t1852 : public Array_t { };
// UnityStandardAssets.CrossPlatformInput.CrossPlatformInputManager/VirtualButton[]
// UnityStandardAssets.CrossPlatformInput.CrossPlatformInputManager/VirtualButton[]
struct VirtualButtonU5BU5D_t1876 : public Array_t { };
// UnityStandardAssets.Utility.AutoMobileShaderSwitch/ReplacementDefinition[]
// UnityStandardAssets.Utility.AutoMobileShaderSwitch/ReplacementDefinition[]
struct ReplacementDefinitionU5BU5D_t81 : public Array_t { };
// UnityStandardAssets.Utility.TimedObjectActivator/Entry[]
// UnityStandardAssets.Utility.TimedObjectActivator/Entry[]
struct EntryU5BU5D_t116 : public Array_t { };
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>


#include "UnityEngine_UnityEngine_MonoBehaviour.h"

// ForcedReset
struct ForcedReset_t96 : public MonoBehaviour_t2
{
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>
#include <assert.h>
#include <exception>

// ForcedReset
struct ForcedReset_t96;

#include "codegen/il2cpp-codegen.h"

// System.Void ForcedReset::.ctor()
extern "C" void ForcedReset__ctor_m303 (ForcedReset_t96 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Void ForcedReset::Update()
extern "C" void ForcedReset_Update_m304 (ForcedReset_t96 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>



// <Module>
struct U3CModuleU3E_t0
{
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>
#include <assert.h>
#include <exception>


#include "codegen/il2cpp-codegen.h"

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>


#include "mscorlib_System_Enum.h"
#include "AssemblyU2DCSharpU2Dfirstpass_UnityStandardAssets_Cameras_Ab.h"

// UnityStandardAssets.Cameras.AbstractTargetFollower/UpdateType
struct UpdateType_t13
{
// System.Int32 UnityStandardAssets.Cameras.AbstractTargetFollower/UpdateType::value__
int32_t ___value___1;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>
#include <assert.h>
#include <exception>


#include "codegen/il2cpp-codegen.h"

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

// UnityEngine.Transform
struct Transform_t3;
// UnityEngine.Rigidbody
struct Rigidbody_t15;

#include "UnityEngine_UnityEngine_MonoBehaviour.h"
#include "AssemblyU2DCSharpU2Dfirstpass_UnityStandardAssets_Cameras_Ab.h"

// UnityStandardAssets.Cameras.AbstractTargetFollower
struct AbstractTargetFollower_t14 : public MonoBehaviour_t2
{
// UnityEngine.Transform UnityStandardAssets.Cameras.AbstractTargetFollower::m_Target
Transform_t3 * ___m_Target_2;
// System.Boolean UnityStandardAssets.Cameras.AbstractTargetFollower::m_AutoTargetPlayer
bool ___m_AutoTargetPlayer_3;
// UnityStandardAssets.Cameras.AbstractTargetFollower/UpdateType UnityStandardAssets.Cameras.AbstractTargetFollower::m_UpdateType
int32_t ___m_UpdateType_4;
// UnityEngine.Rigidbody UnityStandardAssets.Cameras.AbstractTargetFollower::targetRigidbody
Rigidbody_t15 * ___targetRigidbody_5;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>
#include <assert.h>
#include <exception>

// UnityStandardAssets.Cameras.AbstractTargetFollower
struct AbstractTargetFollower_t14;
// UnityEngine.Transform
struct Transform_t3;

#include "codegen/il2cpp-codegen.h"

// System.Void UnityStandardAssets.Cameras.AbstractTargetFollower::.ctor()
extern "C" void AbstractTargetFollower__ctor_m20 (AbstractTargetFollower_t14 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Void UnityStandardAssets.Cameras.AbstractTargetFollower::Start()
extern "C" void AbstractTargetFollower_Start_m21 (AbstractTargetFollower_t14 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Void UnityStandardAssets.Cameras.AbstractTargetFollower::FixedUpdate()
extern "C" void AbstractTargetFollower_FixedUpdate_m22 (AbstractTargetFollower_t14 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Void UnityStandardAssets.Cameras.AbstractTargetFollower::LateUpdate()
extern "C" void AbstractTargetFollower_LateUpdate_m23 (AbstractTargetFollower_t14 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Void UnityStandardAssets.Cameras.AbstractTargetFollower::ManualUpdate()
extern "C" void AbstractTargetFollower_ManualUpdate_m24 (AbstractTargetFollower_t14 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Void UnityStandardAssets.Cameras.AbstractTargetFollower::FindAndTargetPlayer()
extern "C" void AbstractTargetFollower_FindAndTargetPlayer_m25 (AbstractTargetFollower_t14 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Void UnityStandardAssets.Cameras.AbstractTargetFollower::SetTarget(UnityEngine.Transform)
extern "C" void AbstractTargetFollower_SetTarget_m26 (AbstractTargetFollower_t14 * __this, Transform_t3 * ___newTransform, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// UnityEngine.Transform UnityStandardAssets.Cameras.AbstractTargetFollower::get_Target()
extern "C" Transform_t3 * AbstractTargetFollower_get_Target_m27 (AbstractTargetFollower_t14 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
Loading