少年修仙传客户端基础资源
hch
2024-05-11 cc9183fd3d8888d533197e6351e99a2cca6b1ada
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * Copyright (c) 2020 Beebyte Limited. All rights reserved.
 */
using System.IO;
using UnityEditor;
 
namespace Beebyte.Obfuscator
{
    public class GlobalGameManagersPath
    {
        internal static string GetPathToGlobalGameManagersAsset(BuildTarget buildTarget, string buildPath)
        {
            if ((int) buildTarget == 2)
            {
                return GetPathForMac(buildPath);
            }
 
#if UNITY_2018_2_OR_NEWER
            if (EditorUserBuildSettings.GetPlatformSettings("Standalone", "CreateSolution").Equals("true"))
            {
                return GetPathForVSProjectWindowsAndLinuxStandalone(buildPath);
            }
#endif
            return GetPathForWindowsAndLinuxStandalone(buildPath);
        }
 
        private static string GetPathForMac(string buildPath)
        {
            return Path.GetDirectoryName(buildPath) +
                   Path.DirectorySeparatorChar.ToString() +
                   Path.GetFileNameWithoutExtension(buildPath) +
                   ".app" +
                   Path.DirectorySeparatorChar.ToString() +
                   "Contents" +
                   Path.DirectorySeparatorChar.ToString() +
                   "Resources" +
                   Path.DirectorySeparatorChar.ToString() +
                   "Data" +
                   Path.DirectorySeparatorChar.ToString() +
                   "globalgamemanagers.assets";
        }
        
        private static string GetPathForWindowsAndLinuxStandalone(string buildPath)
        {
            return Path.GetDirectoryName(buildPath) +
                   Path.DirectorySeparatorChar.ToString() +
                   Path.GetFileNameWithoutExtension(buildPath) +
                   "_Data" +
                   Path.DirectorySeparatorChar.ToString() +
                   "globalgamemanagers.assets";
        }
        
        private static string GetPathForVSProjectWindowsAndLinuxStandalone(string buildPath)
        {
           return Path.GetDirectoryName(buildPath) +
                  Path.DirectorySeparatorChar.ToString() +
                  "build" +
                  Path.DirectorySeparatorChar.ToString() +
                  "bin" +
                  Path.DirectorySeparatorChar.ToString() +
                  Path.GetFileNameWithoutExtension(buildPath) +
                  "_Data" +
                  Path.DirectorySeparatorChar.ToString() +
                  "globalgamemanagers.assets";
        }
    }
}