Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added compatibility with Unity 2017+ #321

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/MoonSharp.Interpreter/Loaders/UnityAssetsScriptLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class UnityAssetsScriptLoader : ScriptLoaderBase
public UnityAssetsScriptLoader(string assetsPath = null)
{
assetsPath = assetsPath ?? DEFAULT_PATH;
#if UNITY_5
#if UNITY_5 || UNITY_2017_1_OR_NEWER
LoadResourcesUnityNative(assetsPath);
#else
LoadResourcesWithReflection(assetsPath);
Expand All @@ -48,7 +48,7 @@ public UnityAssetsScriptLoader(Dictionary<string, string> scriptToCodeMap)
m_Resources = scriptToCodeMap;
}

#if UNITY_5
#if UNITY_5 || UNITY_2017_1_OR_NEWER
void LoadResourcesUnityNative(string assetsPath)
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private static void AutoDetectPlatformFlags()
IsUnityNative = true;
#endif
#else
#if UNITY_5
#if UNITY_5 || UNITY_2017_1_OR_NEWER
IsRunningOnUnity = true;
IsUnityNative = true;

Expand Down