From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Export/ScriptAssets.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Runtime/Export/ScriptAssets.txt (limited to 'Runtime/Export/ScriptAssets.txt') diff --git a/Runtime/Export/ScriptAssets.txt b/Runtime/Export/ScriptAssets.txt new file mode 100644 index 0000000..6002497 --- /dev/null +++ b/Runtime/Export/ScriptAssets.txt @@ -0,0 +1,33 @@ +C++RAW + +#include "UnityPrefix.h" +#include "Runtime/Mono/MonoBehaviour.h" +#include "Runtime/Scripting/ScriptingUtility.h" +#include "Runtime/Scripting/ScriptingExportUtility.h" +#include "Runtime/Scripting/TextAsset.h" + +CSRAW +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Collections; + + +namespace UnityEngine +{ + +// Text file assets. +NONSEALED_CLASS TextAsset : Object + // The text contents of the .txt file as a string. (RO) + CUSTOM_PROP string text { return scripting_string_new(self->GetScript().c_str()); } + + // The raw bytes of the text asset. (RO) + + CUSTOM_PROP byte[] bytes { return CreateScriptingArray( self->GetScript().c_str(), self->GetScript().size(), GetScriptingManager().GetCommonClasses().byte ); } + + CSRAW public override string ToString() { return text; } +END + + +CSRAW +} -- cgit v1.1-26-g67d0