Просмотр исходного кода

Linux Support (#417)

* Patch for linux(ubuntu) platform

Co-authored-by: yqs <yiquanshui@gmail.com>
yiquanshui 3 лет назад
Родитель
Сommit
d973fe9f83

BIN
Unity/Assets/Plugins/x86_64/libRecastDll.so


+ 76 - 0
Unity/Assets/Plugins/x86_64/libRecastDll.so.meta

@@ -0,0 +1,76 @@
+fileFormatVersion: 2
+guid: 455b6d98e2d48ae6b999fb92ea1dd130
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      : Any
+    second:
+      enabled: 0
+      settings:
+        Exclude Android: 0
+        Exclude Editor: 0
+        Exclude Linux64: 0
+        Exclude OSXUniversal: 0
+        Exclude WebGL: 0
+        Exclude Win: 0
+        Exclude Win64: 0
+  - first:
+      Android: Android
+    second:
+      enabled: 1
+      settings:
+        CPU: ARMv7
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 1
+      settings:
+        CPU: AnyCPU
+        DefaultValueInitialized: true
+        OS: AnyOS
+  - first:
+      Standalone: Linux64
+    second:
+      enabled: 1
+      settings:
+        CPU: x86_64
+  - first:
+      Standalone: OSXUniversal
+    second:
+      enabled: 1
+      settings:
+        CPU: None
+  - first:
+      Standalone: Win
+    second:
+      enabled: 1
+      settings:
+        CPU: None
+  - first:
+      Standalone: Win64
+    second:
+      enabled: 1
+      settings:
+        CPU: None
+  - first:
+      WebGL: WebGL
+    second:
+      enabled: 1
+      settings: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 4 - 1
Unity/Assets/Scripts/Editor/BuildEditor/BuildEditor.cs

@@ -15,8 +15,9 @@ namespace ET
 		None,
 		Android,
 		IOS,
-		PC,
+		Windows,
 		MacOS,
+		Linux
 	}
 	
 	public enum BuildType
@@ -56,6 +57,8 @@ namespace ET
 			activePlatform = PlatformType.PC;
 #elif UNITY_STANDALONE_OSX
 			activePlatform = PlatformType.MacOS;
+#elif UNITY_STANDALONE_LINUX
+			activePlatform = PlatformType.Linux;
 #else
 			activePlatform = PlatformType.None;
 #endif

+ 6 - 2
Unity/Assets/Scripts/Editor/BuildEditor/BuildHelper.cs

@@ -115,7 +115,7 @@ namespace ET
             string exeName = programName;
             switch (type)
             {
-                case PlatformType.PC:
+                case PlatformType.Windows:
                     buildTarget = BuildTarget.StandaloneWindows64;
                     exeName += ".exe";
                     break;
@@ -129,6 +129,10 @@ namespace ET
                 case PlatformType.MacOS:
                     buildTarget = BuildTarget.StandaloneOSX;
                     break;
+                
+                case PlatformType.Linux:
+                    buildTarget = BuildTarget.StandaloneLinux64;
+                    break;
             }
 
             string fold = string.Format(BuildFolder, type);
@@ -162,7 +166,7 @@ namespace ET
             }
             else
             {
-                if (isContainAB && type == PlatformType.PC)
+                if (isContainAB && type == PlatformType.Windows)
                 {
                     string targetPath = Path.Combine(relativeDirPrefix, $"{programName}_Data/StreamingAssets/");
                     FileHelper.CleanDirectory(targetPath);

+ 1 - 1
Unity/Assets/Scripts/Editor/Helper/ShellHelper.cs

@@ -11,7 +11,7 @@ namespace ET
             Process process = new();
             try
             {
-#if UNITY_EDITOR_OSX
+#if UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX
                 string app = "bash";
                 string splitChar = ":";
                 string arguments = "-c";

+ 2 - 2
Unity/Assets/Scripts/Editor/ToolEditor/ToolsEditor.cs

@@ -6,7 +6,7 @@ namespace ET
     {
         public static void ExcelExporter()
         {
-#if UNITY_EDITOR_OSX
+#if UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX
             const string tools = "./Tool";
 #else
             const string tools = ".\\Tool.exe";
@@ -16,7 +16,7 @@ namespace ET
         
         public static void Proto2CS()
         {
-#if UNITY_EDITOR_OSX
+#if UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX
             const string tools = "./Tool";
 #else
             const string tools = ".\\Tool.exe";