少年修仙传客户端基础资源
dabaoji
2023-11-13 0a23e1b83f8fda8ab9f9e32fe71c26c431faf63a
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
/*
using UnityEngine;
using UnityEditor;
 
//Options are read in the same way as normal Obfuscation, i.e. from the ObfuscatorOptions.asset
namespace Beebyte.Obfuscator
{
    public class ObfuscatorMenuExample 
    {
        private static Options _options = null;
 
        [MenuItem("Tools/Obfuscate External DLL")]
        private static void ObfuscateExternalDll()
        {
            const string dllPath = @"C:\path\to\External.dll";
 
            Debug.Log("Obfuscating");
 
            if (System.IO.File.Exists(dllPath))
            {
                if (_options == null) _options = OptionsManager.LoadOptions();
 
                bool oldSkipRenameOfAllPublicMonobehaviourFields = _options.skipRenameOfAllPublicMonobehaviourFields;
                try
                {
                     //Preserving monobehaviour public field names is an common step for obfuscating external DLLs that
                     //allow MonoBehaviours to be dragged into the scene's hierarchy.
                    _options.skipRenameOfAllPublicMonobehaviourFields = true;
 
                    //Consider setting this hidden value to false to allow classes like EditorWindow to be obfuscated.
                    //ScriptableObjects would normally be treated as Serializable to avoid breaking loading/saving,
                    //but for Editor windows this might not be necessary.
                    //options.treatScriptableObjectsAsSerializable = false;
 
                    Obfuscator.SetExtraAssemblyDirectories(_options.extraAssemblyDirectories);
                    Obfuscator.Obfuscate(dllPath, _options, EditorUserBuildSettings.activeBuildTarget);
                }
                finally
                {
                    _options.skipRenameOfAllPublicMonobehaviourFields = oldSkipRenameOfAllPublicMonobehaviourFields;
                    EditorUtility.ClearProgressBar();
                }
            }
            else Debug.Log("Obfuscating could not find file at " + dllPath);
        }
    }
}
*/