少年修仙传客户端基础资源
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
/*
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
 
namespace Beebyte.Obfuscator
{
    public class ObfuscatorMenuExample
    {
        private static Options _options = null;
 
        private static IList<string> GetDllPaths()
        {
            var dlls = new List<string> {@"C:\path\to\External.dll"};
 
            foreach (string dll in dlls.Where(dll => !File.Exists(dll)))
            {
                throw new Exception("Could not find " + dll);
            }
            return dlls;
        }
 
        [MenuItem("Tools/Obfuscate External DLL")]
        private static void ObfuscateExternalDll()
        {
            Debug.Log("Obfuscating");
 
            var dllPaths = GetDllPaths();
 
            //Options are read in the same way as normal Obfuscation, i.e. from the ObfuscatorOptions.asset
            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.AppendReferenceAssemblies(_options.referencedAssemblies);
                Obfuscator.Obfuscate(dllPaths, _options, EditorUserBuildSettings.activeBuildTarget);
            }
            finally
            {
                _options.skipRenameOfAllPublicMonobehaviourFields = oldSkipRenameOfAllPublicMonobehaviourFields;
                EditorUtility.ClearProgressBar();
            }
        }
    }
}
*/