├── .gitignore
├── Assets
├── Audio.meta
├── Audio
│ ├── scavengers_chop1.aif
│ ├── scavengers_chop1.aif.meta
│ ├── scavengers_chop2.aif
│ ├── scavengers_chop2.aif.meta
│ ├── scavengers_die.aif
│ ├── scavengers_die.aif.meta
│ ├── scavengers_enemy1.aif
│ ├── scavengers_enemy1.aif.meta
│ ├── scavengers_enemy2.aif
│ ├── scavengers_enemy2.aif.meta
│ ├── scavengers_footstep1.aif
│ ├── scavengers_footstep1.aif.meta
│ ├── scavengers_footstep2.aif
│ ├── scavengers_footstep2.aif.meta
│ ├── scavengers_fruit1.aif
│ ├── scavengers_fruit1.aif.meta
│ ├── scavengers_fruit2.aif
│ ├── scavengers_fruit2.aif.meta
│ ├── scavengers_music.aif
│ ├── scavengers_music.aif.meta
│ ├── scavengers_soda1.aif
│ ├── scavengers_soda1.aif.meta
│ ├── scavengers_soda2.aif
│ └── scavengers_soda2.aif.meta
├── Fonts.meta
├── Fonts
│ ├── OFL.txt
│ ├── OFL.txt.meta
│ ├── PressStart2P-Regular.ttf
│ └── PressStart2P-Regular.ttf.meta
├── Sprites.meta
├── Sprites
│ ├── Scavengers_SpriteSheet.png
│ └── Scavengers_SpriteSheet.png.meta
├── UnityObfuscator.meta
├── UnityObfuscator
│ ├── Editor.meta
│ ├── Editor
│ │ ├── ObfuscatorConfig.asset
│ │ ├── ObfuscatorConfig.asset.meta
│ │ ├── Res.meta
│ │ ├── Res
│ │ │ ├── NameList.txt
│ │ │ ├── NameList.txt.meta
│ │ │ ├── ObfuscateList.meta
│ │ │ ├── ObfuscateList
│ │ │ │ ├── ObfuscateList-CodeInject-Class.txt
│ │ │ │ ├── ObfuscateList-CodeInject-Class.txt.meta
│ │ │ │ ├── ObfuscateList-CodeInject-Method.txt
│ │ │ │ ├── ObfuscateList-CodeInject-Method.txt.meta
│ │ │ │ ├── ObfuscateList-CodeInject-NameSpace.txt
│ │ │ │ ├── ObfuscateList-CodeInject-Namespace.txt
│ │ │ │ ├── ObfuscateList-CodeInject-Namespace.txt.meta
│ │ │ │ ├── ObfuscateList-NameObfuscate-Class.txt
│ │ │ │ ├── ObfuscateList-NameObfuscate-Class.txt.meta
│ │ │ │ ├── ObfuscateList-NameObfuscate-ClassExceptClassName.txt
│ │ │ │ ├── ObfuscateList-NameObfuscate-ClassExceptClassName.txt.meta
│ │ │ │ ├── ObfuscateList-NameObfuscate-ClassMember.txt
│ │ │ │ ├── ObfuscateList-NameObfuscate-ClassMember.txt.meta
│ │ │ │ ├── ObfuscateList-NameObfuscate-Method.txt
│ │ │ │ ├── ObfuscateList-NameObfuscate-Method.txt.meta
│ │ │ │ ├── ObfuscateList-NameObfuscate-NameSpace.txt
│ │ │ │ ├── ObfuscateList-NameObfuscate-NameSpaceExceptNameSpaceName.txt
│ │ │ │ ├── ObfuscateList-NameObfuscate-Namespace.txt
│ │ │ │ ├── ObfuscateList-NameObfuscate-Namespace.txt.meta
│ │ │ │ ├── ObfuscateList-NameObfuscate-NamespaceExceptNamespaceName.txt
│ │ │ │ └── ObfuscateList-NameObfuscate-NamespaceExceptNamespaceName.txt.meta
│ │ │ ├── WhiteList.meta
│ │ │ └── WhiteList
│ │ │ │ ├── WhiteList-CodeInject-Class.txt
│ │ │ │ ├── WhiteList-CodeInject-Class.txt.meta
│ │ │ │ ├── WhiteList-CodeInject-Method.txt
│ │ │ │ ├── WhiteList-CodeInject-Method.txt.meta
│ │ │ │ ├── WhiteList-CodeInject-NameSpace.txt
│ │ │ │ ├── WhiteList-CodeInject-Namespace.txt
│ │ │ │ ├── WhiteList-CodeInject-Namespace.txt.meta
│ │ │ │ ├── WhiteList-NameObfuscate-Class.txt
│ │ │ │ ├── WhiteList-NameObfuscate-Class.txt.meta
│ │ │ │ ├── WhiteList-NameObfuscate-ClassMember.txt
│ │ │ │ ├── WhiteList-NameObfuscate-ClassMember.txt.meta
│ │ │ │ ├── WhiteList-NameObfuscate-ClassNameOnly.txt
│ │ │ │ ├── WhiteList-NameObfuscate-ClassNameOnly.txt.meta
│ │ │ │ ├── WhiteList-NameObfuscate-Method.txt
│ │ │ │ ├── WhiteList-NameObfuscate-Method.txt.meta
│ │ │ │ ├── WhiteList-NameObfuscate-NameSpace.txt
│ │ │ │ ├── WhiteList-NameObfuscate-NameSpace.txt.meta
│ │ │ │ ├── WhiteList-NameObfuscate-NameSpaceNameOnly.txt
│ │ │ │ ├── WhiteList-NameObfuscate-NamespaceNameOnly.txt
│ │ │ │ └── WhiteList-NameObfuscate-NamespaceNameOnly.txt.meta
│ │ ├── Scripts.meta
│ │ └── Scripts
│ │ │ ├── ClassInfo.cs
│ │ │ ├── ClassInfo.cs.meta
│ │ │ ├── CodeInject.cs
│ │ │ ├── CodeInject.cs.meta
│ │ │ ├── CodeObfuscator.cs
│ │ │ ├── CodeObfuscator.cs.meta
│ │ │ ├── Define.cs
│ │ │ ├── Define.cs.meta
│ │ │ ├── DllInfoHelper.cs
│ │ │ ├── DllInfoHelper.cs.meta
│ │ │ ├── NameFactory.cs
│ │ │ ├── NameFactory.cs.meta
│ │ │ ├── NameObfuscate.cs
│ │ │ ├── NameObfuscate.cs.meta
│ │ │ ├── ObfuscateItem.cs
│ │ │ ├── ObfuscateItem.cs.meta
│ │ │ ├── Obfuscator.cs
│ │ │ ├── Obfuscator.cs.meta
│ │ │ ├── ObfuscatorConfig.cs
│ │ │ ├── ObfuscatorConfig.cs.meta
│ │ │ ├── ObfuscatorConfigEditor.cs
│ │ │ ├── ObfuscatorConfigEditor.cs.meta
│ │ │ ├── ObfuscatorUtils.cs
│ │ │ ├── ObfuscatorUtils.cs.meta
│ │ │ ├── ProcessObfuscator.cs
│ │ │ ├── ProcessObfuscator.cs.meta
│ │ │ ├── Tools.cs
│ │ │ ├── Tools.cs.meta
│ │ │ ├── WhiteList.cs
│ │ │ └── WhiteList.cs.meta
│ ├── GarbageCode.meta
│ ├── GarbageCode
│ │ ├── GarbageCode.dll
│ │ └── GarbageCode.dll.meta
│ ├── Plugins.meta
│ └── Plugins
│ │ ├── Cecil.meta
│ │ └── Cecil
│ │ ├── Mono.Cecil.Mdb.dll
│ │ ├── Mono.Cecil.Mdb.dll.meta
│ │ ├── Mono.Cecil.Pdb.dll
│ │ ├── Mono.Cecil.Pdb.dll.meta
│ │ ├── Mono.Cecil.dll
│ │ └── Mono.Cecil.dll.meta
├── _Complete-Game.meta
└── _Complete-Game
│ ├── Animation.meta
│ ├── Animation
│ ├── Animations.meta
│ ├── Animations
│ │ ├── Enemy1Attack.anim
│ │ ├── Enemy1Attack.anim.meta
│ │ ├── Enemy1Idle.anim
│ │ ├── Enemy1Idle.anim.meta
│ │ ├── Enemy2Attack.anim
│ │ ├── Enemy2Attack.anim.meta
│ │ ├── Enemy2Idle.anim
│ │ ├── Enemy2Idle.anim.meta
│ │ ├── PlayerChop.anim
│ │ ├── PlayerChop.anim.meta
│ │ ├── PlayerHit.anim
│ │ ├── PlayerHit.anim.meta
│ │ ├── PlayerIdle.anim
│ │ └── PlayerIdle.anim.meta
│ ├── AnimatorControllers.meta
│ └── AnimatorControllers
│ │ ├── Enemy1.controller
│ │ ├── Enemy1.controller.meta
│ │ ├── Enemy2.overrideController
│ │ ├── Enemy2.overrideController.meta
│ │ ├── Player.controller
│ │ └── Player.controller.meta
│ ├── Prefabs.meta
│ ├── Prefabs
│ ├── Enemy1.prefab
│ ├── Enemy1.prefab.meta
│ ├── Enemy2.prefab
│ ├── Enemy2.prefab.meta
│ ├── Exit.prefab
│ ├── Exit.prefab.meta
│ ├── Floor1.prefab
│ ├── Floor1.prefab.meta
│ ├── Floor2.prefab
│ ├── Floor2.prefab.meta
│ ├── Floor3.prefab
│ ├── Floor3.prefab.meta
│ ├── Floor4.prefab
│ ├── Floor4.prefab.meta
│ ├── Floor5.prefab
│ ├── Floor5.prefab.meta
│ ├── Floor6.prefab
│ ├── Floor6.prefab.meta
│ ├── Floor7.prefab
│ ├── Floor7.prefab.meta
│ ├── Floor8.prefab
│ ├── Floor8.prefab.meta
│ ├── Food.prefab
│ ├── Food.prefab.meta
│ ├── GameManager.prefab
│ ├── GameManager.prefab.meta
│ ├── OuterWall1.prefab
│ ├── OuterWall1.prefab.meta
│ ├── OuterWall2.prefab
│ ├── OuterWall2.prefab.meta
│ ├── OuterWall3.prefab
│ ├── OuterWall3.prefab.meta
│ ├── Player.prefab
│ ├── Player.prefab.meta
│ ├── Soda.prefab
│ ├── Soda.prefab.meta
│ ├── SoundManager.prefab
│ ├── SoundManager.prefab.meta
│ ├── Wall1.prefab
│ ├── Wall1.prefab.meta
│ ├── Wall2.prefab
│ ├── Wall2.prefab.meta
│ ├── Wall3.prefab
│ ├── Wall3.prefab.meta
│ ├── Wall4.prefab
│ ├── Wall4.prefab.meta
│ ├── Wall5.prefab
│ ├── Wall5.prefab.meta
│ ├── Wall6.prefab
│ ├── Wall6.prefab.meta
│ ├── Wall7.prefab
│ ├── Wall7.prefab.meta
│ ├── Wall8.prefab
│ └── Wall8.prefab.meta
│ ├── Scenes.meta
│ ├── Scenes
│ ├── Main.unity
│ └── Main.unity.meta
│ ├── Scripts.meta
│ ├── Scripts
│ ├── Base.meta
│ ├── Base
│ │ ├── Base.asmdef
│ │ ├── Base.asmdef.meta
│ │ ├── BoardManager.cs
│ │ └── BoardManager.cs.meta
│ ├── Enemy.cs
│ ├── Enemy.cs.meta
│ ├── GameManager.cs
│ ├── GameManager.cs.meta
│ ├── Loader.cs
│ ├── Loader.cs.meta
│ ├── MovingObject.cs
│ ├── MovingObject.cs.meta
│ ├── Player.cs
│ ├── Player.cs.meta
│ ├── SoundManager.cs
│ ├── SoundManager.cs.meta
│ ├── Wall.cs
│ └── Wall.cs.meta
│ ├── _Complete-Game.unity
│ └── _Complete-Game.unity.meta
├── Doc
├── Game.png
├── ILSpyAfterObfuscate.png
├── ILSpyAfterObfuscate2.png
├── ILSpyAfterObfuscate3.png
├── ILSpyBeforeObfuscate.png
└── ObfuscatorConfig.png
├── ProjectSettings
├── AudioManager.asset
├── ClusterInputManager.asset
├── DynamicsManager.asset
├── EditorBuildSettings.asset
├── EditorSettings.asset
├── GraphicsSettings.asset
├── InputManager.asset
├── NavMeshAreas.asset
├── NetworkManager.asset
├── Physics2DSettings.asset
├── ProjectSettings.asset
├── ProjectVersion.txt
├── QualitySettings.asset
├── TagManager.asset
├── TimeManager.asset
├── UnityAdsSettings.asset.meta
└── UnityConnectSettings.asset
├── README.md
├── UnityObfuscator-InjectInfo.txt
└── UnityObfuscator-Name_Obfuscate_Map.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | # This .gitignore file should be placed at the root of your Unity project directory
2 | #
3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
4 | #
5 | /[Ll]ibrary/
6 | /[Tt]emp/
7 | /[Oo]bj/
8 | /[Bb]uild/
9 | /[Bb]uilds/
10 | /[Ll]ogs/
11 | /[Mm]emoryCaptures/
12 |
13 | # Asset meta data should only be ignored when the corresponding asset is also ignored
14 | !/[Aa]ssets/**/*.meta
15 |
16 | # Uncomment this line if you wish to ignore the asset store tools plugin
17 | # /[Aa]ssets/AssetStoreTools*
18 |
19 | # Autogenerated Jetbrains Rider plugin
20 | [Aa]ssets/Plugins/Editor/JetBrains*
21 |
22 | # Visual Studio cache directory
23 | .vs/
24 |
25 | # Gradle cache directory
26 | .gradle/
27 |
28 | # Autogenerated VS/MD/Consulo solution and project files
29 | ExportedObj/
30 | .consulo/
31 | *.csproj
32 | *.unityproj
33 | *.sln
34 | *.suo
35 | *.tmp
36 | *.user
37 | *.userprefs
38 | *.pidb
39 | *.booproj
40 | *.svd
41 | *.pdb
42 | *.mdb
43 | *.opendb
44 | *.VC.db
45 |
46 | # Unity3D generated meta files
47 | *.pidb.meta
48 | *.pdb.meta
49 | *.mdb.meta
50 |
51 | # Unity3D generated file on crash reports
52 | sysinfo.txt
53 |
54 | # Builds
55 | *.apk
56 | *.unitypackage
57 |
58 | # Crashlytics generated file
59 | crashlytics-build.properties
60 |
61 | UnityPackageManager/
62 |
--------------------------------------------------------------------------------
/Assets/Audio.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c62c925a338e8894486728ac6811cac2
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_chop1.aif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/Audio/scavengers_chop1.aif
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_chop1.aif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4c2332bc8245b474dad63074059bb755
3 | AudioImporter:
4 | externalObjects: {}
5 | serializedVersion: 6
6 | defaultSettings:
7 | loadType: 1
8 | sampleRateSetting: 0
9 | sampleRateOverride: 0
10 | compressionFormat: 0
11 | quality: 0.5
12 | conversionMode: 0
13 | platformSettingOverrides: {}
14 | forceToMono: 0
15 | normalize: 1
16 | preloadAudioData: 1
17 | loadInBackground: 0
18 | ambisonic: 0
19 | 3D: 0
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_chop2.aif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/Audio/scavengers_chop2.aif
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_chop2.aif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f6aaac83be9e0493493aace800b76619
3 | AudioImporter:
4 | externalObjects: {}
5 | serializedVersion: 6
6 | defaultSettings:
7 | loadType: 1
8 | sampleRateSetting: 0
9 | sampleRateOverride: 0
10 | compressionFormat: 0
11 | quality: 0.5
12 | conversionMode: 0
13 | platformSettingOverrides: {}
14 | forceToMono: 0
15 | normalize: 1
16 | preloadAudioData: 1
17 | loadInBackground: 0
18 | ambisonic: 0
19 | 3D: 0
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_die.aif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/Audio/scavengers_die.aif
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_die.aif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e2beefeb2273f4efe992adf5b8d67c29
3 | AudioImporter:
4 | externalObjects: {}
5 | serializedVersion: 6
6 | defaultSettings:
7 | loadType: 1
8 | sampleRateSetting: 0
9 | sampleRateOverride: 0
10 | compressionFormat: 0
11 | quality: 0.5
12 | conversionMode: 0
13 | platformSettingOverrides: {}
14 | forceToMono: 0
15 | normalize: 1
16 | preloadAudioData: 1
17 | loadInBackground: 0
18 | ambisonic: 0
19 | 3D: 0
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_enemy1.aif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/Audio/scavengers_enemy1.aif
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_enemy1.aif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0db8cac2749584a009540aa5671ee80d
3 | AudioImporter:
4 | externalObjects: {}
5 | serializedVersion: 6
6 | defaultSettings:
7 | loadType: 1
8 | sampleRateSetting: 0
9 | sampleRateOverride: 0
10 | compressionFormat: 0
11 | quality: 0.5
12 | conversionMode: 0
13 | platformSettingOverrides: {}
14 | forceToMono: 0
15 | normalize: 1
16 | preloadAudioData: 1
17 | loadInBackground: 0
18 | ambisonic: 0
19 | 3D: 0
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_enemy2.aif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/Audio/scavengers_enemy2.aif
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_enemy2.aif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 114514a3b3697484ebaa08f7fbf842d3
3 | AudioImporter:
4 | externalObjects: {}
5 | serializedVersion: 6
6 | defaultSettings:
7 | loadType: 1
8 | sampleRateSetting: 0
9 | sampleRateOverride: 0
10 | compressionFormat: 0
11 | quality: 0.5
12 | conversionMode: 0
13 | platformSettingOverrides: {}
14 | forceToMono: 0
15 | normalize: 1
16 | preloadAudioData: 1
17 | loadInBackground: 0
18 | ambisonic: 0
19 | 3D: 0
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_footstep1.aif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/Audio/scavengers_footstep1.aif
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_footstep1.aif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 892962212a4b74d1c9f578a3b6ea6439
3 | AudioImporter:
4 | externalObjects: {}
5 | serializedVersion: 6
6 | defaultSettings:
7 | loadType: 1
8 | sampleRateSetting: 0
9 | sampleRateOverride: 0
10 | compressionFormat: 0
11 | quality: 0.5
12 | conversionMode: 0
13 | platformSettingOverrides: {}
14 | forceToMono: 0
15 | normalize: 1
16 | preloadAudioData: 1
17 | loadInBackground: 0
18 | ambisonic: 0
19 | 3D: 0
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_footstep2.aif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/Audio/scavengers_footstep2.aif
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_footstep2.aif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a826bc3d758db43d6ae9caf415b63d1d
3 | AudioImporter:
4 | externalObjects: {}
5 | serializedVersion: 6
6 | defaultSettings:
7 | loadType: 1
8 | sampleRateSetting: 0
9 | sampleRateOverride: 0
10 | compressionFormat: 0
11 | quality: 0.5
12 | conversionMode: 0
13 | platformSettingOverrides: {}
14 | forceToMono: 0
15 | normalize: 1
16 | preloadAudioData: 1
17 | loadInBackground: 0
18 | ambisonic: 0
19 | 3D: 0
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_fruit1.aif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/Audio/scavengers_fruit1.aif
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_fruit1.aif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1cb61f83d60374c7389bb547431919e3
3 | AudioImporter:
4 | externalObjects: {}
5 | serializedVersion: 6
6 | defaultSettings:
7 | loadType: 1
8 | sampleRateSetting: 0
9 | sampleRateOverride: 0
10 | compressionFormat: 0
11 | quality: 0.5
12 | conversionMode: 0
13 | platformSettingOverrides: {}
14 | forceToMono: 0
15 | normalize: 1
16 | preloadAudioData: 1
17 | loadInBackground: 0
18 | ambisonic: 0
19 | 3D: 0
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_fruit2.aif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/Audio/scavengers_fruit2.aif
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_fruit2.aif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 062161c1897a54088a5430f8c197e1b8
3 | AudioImporter:
4 | externalObjects: {}
5 | serializedVersion: 6
6 | defaultSettings:
7 | loadType: 1
8 | sampleRateSetting: 0
9 | sampleRateOverride: 0
10 | compressionFormat: 0
11 | quality: 0.5
12 | conversionMode: 0
13 | platformSettingOverrides: {}
14 | forceToMono: 0
15 | normalize: 1
16 | preloadAudioData: 1
17 | loadInBackground: 0
18 | ambisonic: 0
19 | 3D: 0
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_music.aif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/Audio/scavengers_music.aif
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_music.aif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2d75080d0851d4613ada1117d91ee417
3 | AudioImporter:
4 | externalObjects: {}
5 | serializedVersion: 6
6 | defaultSettings:
7 | loadType: 1
8 | sampleRateSetting: 0
9 | sampleRateOverride: 0
10 | compressionFormat: 0
11 | quality: 0.5
12 | conversionMode: 0
13 | platformSettingOverrides: {}
14 | forceToMono: 0
15 | normalize: 1
16 | preloadAudioData: 1
17 | loadInBackground: 0
18 | ambisonic: 0
19 | 3D: 0
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_soda1.aif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/Audio/scavengers_soda1.aif
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_soda1.aif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b6b608537288246c9a464915db27bf52
3 | AudioImporter:
4 | externalObjects: {}
5 | serializedVersion: 6
6 | defaultSettings:
7 | loadType: 1
8 | sampleRateSetting: 0
9 | sampleRateOverride: 0
10 | compressionFormat: 0
11 | quality: 0.5
12 | conversionMode: 0
13 | platformSettingOverrides: {}
14 | forceToMono: 0
15 | normalize: 1
16 | preloadAudioData: 1
17 | loadInBackground: 0
18 | ambisonic: 0
19 | 3D: 0
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_soda2.aif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/Audio/scavengers_soda2.aif
--------------------------------------------------------------------------------
/Assets/Audio/scavengers_soda2.aif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bcb9dda73ee914d3e8f252895f73f461
3 | AudioImporter:
4 | externalObjects: {}
5 | serializedVersion: 6
6 | defaultSettings:
7 | loadType: 1
8 | sampleRateSetting: 0
9 | sampleRateOverride: 0
10 | compressionFormat: 0
11 | quality: 0.5
12 | conversionMode: 0
13 | platformSettingOverrides: {}
14 | forceToMono: 0
15 | normalize: 1
16 | preloadAudioData: 1
17 | loadInBackground: 0
18 | ambisonic: 0
19 | 3D: 0
20 | userData:
21 | assetBundleName:
22 | assetBundleVariant:
23 |
--------------------------------------------------------------------------------
/Assets/Fonts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b4c064f34e0eb1342b6fc4dbc551d032
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Fonts/OFL.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012, Cody "CodeMan38" Boisclair (cody@zone38.net), with Reserved Font Name "Press Start 2P"
2 | This Font Software is licensed under the SIL Open Font License, Version 1.1.
3 | This license is copied below, and is also available with a FAQ at:
4 | http://scripts.sil.org/OFL
5 |
6 |
7 | -----------------------------------------------------------
8 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9 | -----------------------------------------------------------
10 |
11 | PREAMBLE
12 | The goals of the Open Font License (OFL) are to stimulate worldwide
13 | development of collaborative font projects, to support the font creation
14 | efforts of academic and linguistic communities, and to provide a free and
15 | open framework in which fonts may be shared and improved in partnership
16 | with others.
17 |
18 | The OFL allows the licensed fonts to be used, studied, modified and
19 | redistributed freely as long as they are not sold by themselves. The
20 | fonts, including any derivative works, can be bundled, embedded,
21 | redistributed and/or sold with any software provided that any reserved
22 | names are not used by derivative works. The fonts and derivatives,
23 | however, cannot be released under any other type of license. The
24 | requirement for fonts to remain under this license does not apply
25 | to any document created using the fonts or their derivatives.
26 |
27 | DEFINITIONS
28 | "Font Software" refers to the set of files released by the Copyright
29 | Holder(s) under this license and clearly marked as such. This may
30 | include source files, build scripts and documentation.
31 |
32 | "Reserved Font Name" refers to any names specified as such after the
33 | copyright statement(s).
34 |
35 | "Original Version" refers to the collection of Font Software components as
36 | distributed by the Copyright Holder(s).
37 |
38 | "Modified Version" refers to any derivative made by adding to, deleting,
39 | or substituting -- in part or in whole -- any of the components of the
40 | Original Version, by changing formats or by porting the Font Software to a
41 | new environment.
42 |
43 | "Author" refers to any designer, engineer, programmer, technical
44 | writer or other person who contributed to the Font Software.
45 |
46 | PERMISSION & CONDITIONS
47 | Permission is hereby granted, free of charge, to any person obtaining
48 | a copy of the Font Software, to use, study, copy, merge, embed, modify,
49 | redistribute, and sell modified and unmodified copies of the Font
50 | Software, subject to the following conditions:
51 |
52 | 1) Neither the Font Software nor any of its individual components,
53 | in Original or Modified Versions, may be sold by itself.
54 |
55 | 2) Original or Modified Versions of the Font Software may be bundled,
56 | redistributed and/or sold with any software, provided that each copy
57 | contains the above copyright notice and this license. These can be
58 | included either as stand-alone text files, human-readable headers or
59 | in the appropriate machine-readable metadata fields within text or
60 | binary files as long as those fields can be easily viewed by the user.
61 |
62 | 3) No Modified Version of the Font Software may use the Reserved Font
63 | Name(s) unless explicit written permission is granted by the corresponding
64 | Copyright Holder. This restriction only applies to the primary font name as
65 | presented to the users.
66 |
67 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
68 | Software shall not be used to promote, endorse or advertise any
69 | Modified Version, except to acknowledge the contribution(s) of the
70 | Copyright Holder(s) and the Author(s) or with their explicit written
71 | permission.
72 |
73 | 5) The Font Software, modified or unmodified, in part or in whole,
74 | must be distributed entirely under this license, and must not be
75 | distributed under any other license. The requirement for fonts to
76 | remain under this license does not apply to any document created
77 | using the Font Software.
78 |
79 | TERMINATION
80 | This license becomes null and void if any of the above conditions are
81 | not met.
82 |
83 | DISCLAIMER
84 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
85 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
86 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
87 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
88 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
89 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
90 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
92 | OTHER DEALINGS IN THE FONT SOFTWARE.
93 |
--------------------------------------------------------------------------------
/Assets/Fonts/OFL.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5014456921e71459d869c8378fed6ca3
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Fonts/PressStart2P-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/Fonts/PressStart2P-Regular.ttf
--------------------------------------------------------------------------------
/Assets/Fonts/PressStart2P-Regular.ttf.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b284a6525342f44599e9ce79e37c2d61
3 | TrueTypeFontImporter:
4 | externalObjects: {}
5 | serializedVersion: 4
6 | fontSize: 16
7 | forceTextureCase: -2
8 | characterSpacing: 0
9 | characterPadding: 1
10 | includeFontData: 1
11 | fontName: Press Start 2P
12 | fontNames:
13 | - Press Start 2P
14 | fallbackFontReferences: []
15 | customCharacters:
16 | fontRenderingMode: 0
17 | ascentCalculationMode: 1
18 | useLegacyBoundsCalculation: 0
19 | userData:
20 | assetBundleName:
21 | assetBundleVariant:
22 |
--------------------------------------------------------------------------------
/Assets/Sprites.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 43253f702375d1e4795dfe82af7b2d0a
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Sprites/Scavengers_SpriteSheet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/Sprites/Scavengers_SpriteSheet.png
--------------------------------------------------------------------------------
/Assets/UnityObfuscator.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fcb4fbd3bf574ed499a962002bf6b09b
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d4a20b8ed761c0549b7c011a3e885277
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/ObfuscatorConfig.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/ObfuscatorConfig.asset
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/ObfuscatorConfig.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f9295009245df4647916d12c1fa989e0
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 11400000
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 93ba7bccd15ea85469d87636835818d4
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/NameList.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fe25f33758481eb499d3cf3d6b5f65b0
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 47331e22c95ae97439d349f6ca44b2d1
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-CodeInject-Class.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-CodeInject-Class.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-CodeInject-Class.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c6dc4573841a14e4f82563996de342cd
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-CodeInject-Method.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-CodeInject-Method.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-CodeInject-Method.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7e89a1199ff55ee41926f5b254745431
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-CodeInject-NameSpace.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-CodeInject-NameSpace.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-CodeInject-Namespace.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-CodeInject-Namespace.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-CodeInject-Namespace.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e28f3c39be7a99e4f95a41222243b051
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-Class.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-Class.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-Class.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 476b9827d9de47447bdcdc9e5f896896
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-ClassExceptClassName.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-ClassExceptClassName.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-ClassExceptClassName.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a8f2c70b3e0bbdb408d2bd7345a37a80
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-ClassMember.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-ClassMember.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-ClassMember.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 24a7e4cf5b667364eb068b83cabb4d76
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-Method.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-Method.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-Method.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3f35302de75be6946888472d89a10176
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-NameSpace.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-NameSpace.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-NameSpaceExceptNameSpaceName.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-NameSpaceExceptNameSpaceName.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-Namespace.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-Namespace.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-Namespace.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e45a3c0d46a2d0d4b8ba876d5a211a02
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-NamespaceExceptNamespaceName.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-NamespaceExceptNamespaceName.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-NameObfuscate-NamespaceExceptNamespaceName.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d6ccf735bf2afaf45931c2d03c68011a
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 89be741fcc80c7f49b1396b8bb1f71dc
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-CodeInject-Class.txt:
--------------------------------------------------------------------------------
1 | Completed|Wall
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-CodeInject-Class.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 91639e181efe2a045b243117476781a9
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-CodeInject-Method.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-CodeInject-Method.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-CodeInject-Method.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b69fe8d8f1c98c341aad4a384eb0b485
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-CodeInject-NameSpace.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-CodeInject-NameSpace.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-CodeInject-Namespace.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-CodeInject-Namespace.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-CodeInject-Namespace.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e5f03e7c6094300458371f43ade65673
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-Class.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-Class.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-Class.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6118afb91b5078f48a1d497253193905
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-ClassMember.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-ClassMember.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-ClassMember.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1ccc719527e8bca4db357259aa7ef16c
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-ClassNameOnly.txt:
--------------------------------------------------------------------------------
1 | Completed|BoardManager
2 | Completed|Enemy
3 | Completed|GameManager
4 | Completed|Loader
5 | Completed|MovingObject
6 | Completed|Player
7 | Completed|SoundManager
8 | Completed|Wall
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-ClassNameOnly.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a00b917a8dd88064db504160a3dd973c
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-Method.txt:
--------------------------------------------------------------------------------
1 | Completed|GameManager|HideLevelImage
2 | Completed|GameManager|CallbackInitialization
3 | Completed|Player|Restart
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-Method.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d7e190059f98a5f4196ec5ea665c433e
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-NameSpace.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-NameSpace.txt
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-NameSpace.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ae8f78b1cf4ff1d4e933a605120947be
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-NameSpaceNameOnly.txt:
--------------------------------------------------------------------------------
1 | Completed
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-NamespaceNameOnly.txt:
--------------------------------------------------------------------------------
1 | Completed
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Res/WhiteList/WhiteList-NameObfuscate-NamespaceNameOnly.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 84be318aa7f06c045ba14ff42f7e0121
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 99c74385710c84b46938b14095dc9745
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/ClassInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 | using Mono.Cecil;
5 |
6 | namespace Flower.UnityObfuscator
7 | {
8 | internal class ClassInfo
9 | {
10 |
11 | class FieldPair
12 | {
13 | private readonly FieldDefinition oldField;
14 | private readonly FieldDefinition newField;
15 |
16 | public FieldDefinition OldField
17 | {
18 | get
19 | {
20 | return oldField;
21 | }
22 | }
23 | public FieldDefinition NewField
24 | {
25 | get
26 | {
27 | return newField;
28 | }
29 | }
30 | public FieldPair(FieldDefinition oldf, FieldDefinition newf)
31 | {
32 | this.oldField = oldf;
33 | this.newField = newf;
34 | }
35 |
36 | }
37 |
38 | class MethodPair
39 | {
40 | private readonly MethodDefinition oldMethod;
41 | private readonly MethodDefinition newMethod;
42 |
43 | public MethodDefinition OldMethod
44 | {
45 | get
46 | {
47 | return oldMethod;
48 | }
49 | }
50 | public MethodDefinition NewMethod
51 | {
52 | get
53 | {
54 | return newMethod;
55 | }
56 | }
57 | public MethodPair(MethodDefinition oldm, MethodDefinition newm)
58 | {
59 | this.oldMethod = oldm;
60 | this.newMethod = newm;
61 | }
62 | }
63 |
64 | ///
65 | /// 类中的名字集合
66 | ///
67 | public HashSet nameSet;
68 | ///
69 | /// 加入的名字
70 | ///
71 | public HashSet joinName;
72 | public TypeDefinition typeDefinition;
73 |
74 | Dictionary> joinMethodDict;
75 | Dictionary> joinFieldDict;
76 | private readonly TypeDefinition _typeDefinition;
77 |
78 | public ClassInfo(TypeDefinition t)
79 | {
80 | typeDefinition = t;
81 | nameSet = new HashSet();
82 | joinName = new HashSet();
83 | joinMethodDict = new Dictionary>();
84 | joinFieldDict = new Dictionary>();
85 | GetClassNameInfo(t, nameSet);
86 | }
87 |
88 | ///
89 | /// 获取类的名字集合
90 | ///
91 | ///
92 | ///
93 | private void GetClassNameInfo(TypeDefinition t, HashSet nameSet)
94 | {
95 | if (t == null)
96 | {
97 | return;
98 | }
99 | nameSet.Add(t.Name);
100 | // * 遍历属性
101 | foreach (var prop in t.Properties)
102 | {
103 | nameSet.Add(prop.Name);
104 | }
105 | // * 遍历字段
106 | foreach (var field in t.Fields)
107 | {
108 | nameSet.Add(field.Name);
109 | }
110 | // * 遍历方法
111 | foreach (var method in t.Methods)
112 | {
113 | nameSet.Add(method.Name);
114 | }
115 | }
116 |
117 | ///
118 | /// 加入名字
119 | /// 会保证加入名字的唯一性
120 | ///
121 | ///
122 | ///
123 | public string AddName(string name)
124 | {
125 | while (nameSet.Contains(name) || joinName.Contains(name))
126 | {
127 | name = GenName(name);
128 | }
129 | joinName.Add(name);
130 | return name;
131 | }
132 |
133 | ///
134 | /// 获取方法
135 | ///
136 | /// 老方法
137 | /// 该类创建的对应的新方法
138 | /// 是否有对应的新方法
139 | public bool GetMethod(MethodDefinition oldm, out MethodDefinition newm)
140 | {
141 | newm = null;
142 | List _mpList;
143 | if (joinMethodDict.TryGetValue(oldm.FullName, out _mpList))
144 | {
145 | foreach (var item in _mpList)
146 | {
147 | if (item.OldMethod == oldm)
148 | {
149 | newm = item.NewMethod;
150 | break;
151 | }
152 | }
153 | }
154 | return newm != null;
155 | }
156 |
157 | ///
158 | /// 加入方法
159 | ///
160 | /// 老方法
161 | /// 新方法
162 | public void AddMehtod(MethodDefinition oldm, MethodDefinition newm)
163 | {
164 | List _mpList;
165 | if (!joinMethodDict.TryGetValue(oldm.FullName, out _mpList))
166 | {
167 | _mpList = new List();
168 | }
169 | _mpList.Add(new MethodPair(oldm, newm));
170 | joinMethodDict.Add(oldm.FullName, _mpList);
171 | }
172 |
173 | ///
174 | /// 获取变量
175 | ///
176 | /// 老变量
177 | /// 该类创建的对应的新变量
178 | /// 是否有对应的新方法
179 | public bool GetField(FieldDefinition oldf, out FieldDefinition newf)
180 | {
181 | newf = null;
182 | List _fpList;
183 | if (joinFieldDict.TryGetValue(oldf.FullName, out _fpList))
184 | {
185 | for (int i = 0; i < _fpList.Count; i++)
186 | {
187 | var item = _fpList[i];
188 | if (item.OldField == oldf)
189 | {
190 | newf = item.NewField;
191 | break;
192 | }
193 | }
194 | }
195 | return newf != null;
196 | }
197 | ///
198 | /// 加入变量
199 | ///
200 | /// 老变量
201 | /// 新变量
202 | public void AddField(FieldDefinition oldf, FieldDefinition newf)
203 | {
204 | List _fpList;
205 | if (!joinFieldDict.TryGetValue(oldf.FullName, out _fpList))
206 | {
207 | _fpList = new List();
208 | }
209 | _fpList.Add(new FieldPair(oldf, newf));
210 | joinFieldDict.Add(oldf.FullName, _fpList);
211 | }
212 |
213 | ///
214 | /// 生成名字(在名字参数后加一串随机数字)
215 | ///
216 | /// 名字
217 | ///
218 | private string GenName(string name)
219 | {
220 | return NameFactory.Instance.GetRandomName();
221 | }
222 | }
223 | }
224 |
225 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/ClassInfo.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aac030c242f43ec4fa9f81a0f90922c9
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/CodeInject.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 16c87394f1030bb47a63e706b29da560
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/CodeObfuscator.cs:
--------------------------------------------------------------------------------
1 | using Mono.Cecil;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using UnityEditor;
5 | using UnityEngine;
6 | using System;
7 | using System.IO;
8 |
9 | namespace Flower.UnityObfuscator
10 | {
11 | internal static class CodeObfuscator
12 | {
13 | public static void DoObfuscate(string[] assemblyPath, string uselessCodeLibAssemblyPath, int randomSeed, bool enableNameObfuscate, bool enableCodeInject,
14 | ObfuscateType nameObfuscateType, ObfuscateType codeInjectObfuscateType, ObfuscateNameType obfuscateNameType, int garbageMethodMultiplePerClass, int insertMethodCountPerMethod)
15 | {
16 | if (Application.isPlaying || EditorApplication.isCompiling)
17 | {
18 | Debug.Log("You need stop play mode or wait compiling finished");
19 | return;
20 | }
21 |
22 | if (assemblyPath.Length <= 0)
23 | {
24 | Debug.LogError("Obfuscate dll paths length: 0");
25 | }
26 |
27 | Debug.Log("Code Obfuscate Start");
28 |
29 | var resolver = new DefaultAssemblyResolver();
30 | foreach (var item in Const.ResolverSearchDirs)
31 | {
32 | resolver.AddSearchDirectory(item);
33 | }
34 | var readerParameters = new ReaderParameters { AssemblyResolver = resolver, ReadSymbols = true };
35 |
36 | AssemblyDefinition[] assemblies = new AssemblyDefinition[assemblyPath.Length];
37 | for (int i = 0; i < assemblyPath.Length; i++)
38 | {
39 | var assembly = AssemblyDefinition.ReadAssembly(assemblyPath[i], readerParameters);
40 |
41 | if (assembly == null)
42 | {
43 | Debug.LogError(string.Format("Code Obfuscate Load assembly failed: {0}", assemblyPath[i]));
44 | return;
45 | }
46 |
47 | assemblies[i] = assembly;
48 | }
49 |
50 | AssemblyDefinition garbageCodeAssmbly = null;
51 | if (enableCodeInject)
52 | {
53 | garbageCodeAssmbly = AssemblyDefinition.ReadAssembly(uselessCodeLibAssemblyPath, readerParameters);
54 |
55 | if (garbageCodeAssmbly == null)
56 | {
57 | Debug.LogError(string.Format("Code Obfuscate Load assembly failed: {0}", uselessCodeLibAssemblyPath));
58 | return;
59 | }
60 | }
61 |
62 | try
63 | {
64 | //初始化组件
65 | ObfuscatorHelper.Init(randomSeed);
66 | NameObfuscate.Instance.Init(nameObfuscateType);
67 | CodeInject.Instance.Init(codeInjectObfuscateType, garbageMethodMultiplePerClass, insertMethodCountPerMethod);
68 | NameFactory.Instance.Load(obfuscateNameType);
69 |
70 |
71 | //混淆并注入垃圾代码
72 | for (int i = 0; i < assemblies.Length; i++)
73 | {
74 | var module = assemblies[i].MainModule;
75 |
76 | if (enableCodeInject)
77 | CodeInject.Instance.DoObfuscate(assemblies[i], garbageCodeAssmbly);
78 | if (enableNameObfuscate)
79 | NameObfuscate.Instance.DoObfuscate(assemblies[i]);
80 | }
81 |
82 | //把每个dll对其他被混淆的dll的引用名字修改为混淆后的名字
83 | if (enableNameObfuscate)
84 | {
85 | foreach (var assembly in assemblies)
86 | {
87 | foreach (var item in assembly.MainModule.GetMemberReferences())
88 | {
89 | try
90 | {
91 | if (item is FieldReference)
92 | {
93 | FieldReference fieldReference = item as FieldReference;
94 | Dictionary dic = NameFactory.Instance.GetOld_New_NameDic(NameType.Filed);
95 | FieldObfuscateItem fieldObfuscateItem = new FieldObfuscateItem(fieldReference.DeclaringType.Namespace, fieldReference.DeclaringType.Name, fieldReference.Name);
96 | if (NameFactory.Instance.AlreadyHaveRandomName(NameType.Filed, fieldObfuscateItem))
97 | {
98 | item.Name = NameFactory.Instance.GetRandomName(NameType.Filed, fieldObfuscateItem);
99 | }
100 | }
101 | else if (item is PropertyReference)
102 | {
103 | PropertyReference propertyReference = item as PropertyReference;
104 |
105 | PropertyObfuscateItem propertyObfuscateItem = new PropertyObfuscateItem(propertyReference.DeclaringType.Namespace, propertyReference.DeclaringType.Name, propertyReference.Name);
106 |
107 | if (NameFactory.Instance.AlreadyHaveRandomName(NameType.Property, propertyObfuscateItem))
108 | {
109 | item.Name = NameFactory.Instance.GetRandomName(NameType.Property, propertyObfuscateItem);
110 | }
111 |
112 |
113 | }
114 | else if (item is MethodReference)
115 | {
116 | MethodReference methodReference = item as MethodReference;
117 |
118 | MethodObfuscateItem methodObfuscateItem = new MethodObfuscateItem(methodReference.DeclaringType.Namespace, methodReference.DeclaringType.Name, methodReference.Name);
119 |
120 | if (NameFactory.Instance.AlreadyHaveRandomName(NameType.Method, methodObfuscateItem))
121 | {
122 | item.Name = NameFactory.Instance.GetRandomName(NameType.Method, methodObfuscateItem);
123 | }
124 | }
125 | }
126 | catch
127 | {
128 | continue;
129 | }
130 | }
131 |
132 | foreach (var item in assembly.MainModule.GetTypeReferences())
133 | {
134 | try
135 | {
136 | TypeDefinition typeDefinition = item.Resolve();
137 | TypeObfuscateItem typeObfuscateItem = ObfuscateItemFactory.Create(typeDefinition);
138 | NamespaceObfuscateItem namespaceObfuscateItem = ObfuscateItemFactory.Create(typeDefinition.Namespace, typeDefinition.Module);
139 |
140 | if (NameFactory.Instance.AlreadyHaveRandomName(NameType.Class, typeObfuscateItem))
141 | {
142 | item.Name = NameFactory.Instance.GetRandomName(NameType.Class, typeObfuscateItem);
143 | }
144 | if (NameFactory.Instance.AlreadyHaveRandomName(NameType.Namespace, namespaceObfuscateItem))
145 | {
146 | item.Namespace = NameFactory.Instance.GetRandomName(NameType.Namespace, namespaceObfuscateItem);
147 | }
148 | }
149 | catch
150 | {
151 | continue;
152 | }
153 | }
154 | }
155 |
156 | }
157 |
158 |
159 | for (int i = 0; i < assemblies.Length; i++)
160 | {
161 | assemblies[i].Write(assemblyPath[i], new WriterParameters { WriteSymbols = true });
162 | }
163 |
164 | Debug.Log("Code Obfuscate Completed!");
165 | }
166 | catch (Exception ex)
167 | {
168 | Debug.LogError(string.Format("Code Obfuscate failed: {0}", ex));
169 | }
170 | finally
171 | {
172 | for (int i = 0; i < assemblies.Length; i++)
173 | {
174 | assemblies[i].MainModule.SymbolReader.Dispose();
175 | }
176 |
177 | if (garbageCodeAssmbly != null && garbageCodeAssmbly.MainModule.SymbolReader != null)
178 | {
179 | garbageCodeAssmbly.MainModule.SymbolReader.Dispose();
180 | }
181 |
182 | //输出 名字-混淆后名字 的map
183 | NameFactory.Instance.OutputNameMap(Const.NameMapPath);
184 | }
185 |
186 | }
187 |
188 | }
189 | }
190 |
191 |
192 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/CodeObfuscator.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 987fb9cd673d1fe4081450771fe76811
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/Define.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 |
5 | namespace Flower.UnityObfuscator
6 | {
7 | internal enum NameType
8 | {
9 | Namespace,
10 | Class,
11 | Filed,
12 | Property,
13 | Method,
14 | Other,
15 | }
16 |
17 | internal enum WhiteListType
18 | {
19 | Namespace,
20 | NameSpcaceNameOnly,
21 | Class,
22 | ClassNameOnly,
23 | Method,
24 | Member
25 | }
26 |
27 | internal enum ObfuscateType
28 | {
29 | ParticularRange,
30 | WhiteList,
31 | Both,
32 | }
33 |
34 | internal enum ObfuscateNameType
35 | {
36 | RandomChar,
37 | NameList
38 | }
39 |
40 | internal class Const
41 | {
42 | ///
43 | /// 插件配置文件路径
44 | ///
45 | public static readonly string ConfigAssetPath = @"Assets/UnityObfuscator/Editor/ObfuscatorConfig.asset";
46 |
47 | //白名单配置文件路径
48 | public static readonly string WhiteList_NamespacePath = @"/UnityObfuscator/Editor/Res/WhiteList/WhiteList-{0}-Namespace.txt";//名单内命名空间不混
49 | public static readonly string WhiteList_NamespaceNameOnlyPath = @"/UnityObfuscator/Editor/Res/WhiteList/WhiteList-{0}-NamespaceNameOnly.txt";//名单内命名空间的类都混,命名空间的名字不混
50 | public static readonly string WhiteList_ClassPath = @"/UnityObfuscator/Editor/Res/WhiteList/WhiteList-{0}-Class.txt";//名单内类不混
51 | public static readonly string WhiteList_ClassNameOnlyPath = @"/UnityObfuscator/Editor/Res/WhiteList/WhiteList-{0}-ClassNameOnly.txt";//名单内的类的成员都混,类名不混
52 | public static readonly string WhiteList_MethodPath = @"/UnityObfuscator/Editor/Res/WhiteList/WhiteList-{0}-Method.txt";//名单内的方法不混
53 | public static readonly string WhiteList_MemberPath = @"/UnityObfuscator/Editor/Res/WhiteList/WhiteList-{0}-ClassMember.txt";//名单内的类成员不混
54 |
55 | //混淆范围配置文件路径
56 | public static readonly string ObfuscateList_NamespacePath = @"/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-{0}-Namespace.txt";//名单内的命名空间所有类和类成员都混
57 | public static readonly string ObfuscateList_NamespaceExceptNamespaceNamePath = @"/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-{0}-NamespaceExceptNamespaceName.txt";//名单内命名空间的类都混,命名空间的名字不混
58 | public static readonly string ObfuscateList_ClassPath = @"/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-{0}-Class.txt";//名单内的类都混
59 | public static readonly string ObfuscateList_ClassExceptClassNamePath = @"/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-{0}-ClassExceptClassName.txt";//名单内的类的类成员都混,类名不混
60 | public static readonly string ObfuscateList_MethodPath = @"/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-{0}-Method.txt";//名单内的方法都混
61 | public static readonly string ObfuscateList_MemberPath = @"/UnityObfuscator/Editor/Res/ObfuscateList/ObfuscateList-{0}-ClassMember.txt";//名单内的类成员都混
62 |
63 | public static readonly string NameMapPath = @"UnityObfuscator-Name_Obfuscate_Map.txt";
64 | public static readonly string InjectInfoPath = @"UnityObfuscator-InjectInfo.txt";
65 |
66 | public static readonly string NameListPath = @"/UnityObfuscator/Editor/Res/NameList.txt";
67 |
68 | public static readonly string[] ResolverSearchDirs = new string[]
69 | {
70 | @"/Applications/Unity/Unity.app/Contents/Managed/UnityEngine",
71 | @"/Applications/Unity/Unity.app/Contents/Managed",
72 | @"./Assets/Plugins/gamelib",
73 | @"./Library/ScriptAssemblies",
74 | };
75 |
76 | public static readonly char[] randomCharArray = { '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
77 |
78 | ///
79 | /// 使用随机字符混淆时,命名最小长度
80 | ///
81 | public static readonly int minRandomNameLen = 4;
82 |
83 | ///
84 | /// 使用随机字符混淆时,命名最大长度
85 | ///
86 | public static readonly int maxRandomNameLen = 10;
87 |
88 | ///
89 | /// 垃圾代码库命名空间
90 | ///
91 | public static readonly string GarbageCode_Namespace = "GarbageCodeLib";
92 |
93 | ///
94 | /// 垃圾代码库类
95 | ///
96 | public static readonly string GarbageCode_Type = "GarbageCode";
97 | }
98 |
99 | }
100 |
101 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/Define.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 76603b64ea2e2f74ea823a6f4c3a0527
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/DllInfoHelper.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 | using Mono.Cecil;
5 |
6 | namespace Flower.UnityObfuscator
7 | {
8 | internal class DllInfoHelper
9 | {
10 | ///
11 | /// 获取types(TypeDefinition)的名字信息
12 | ///
13 | ///
14 | ///
15 | public static Dictionary GetTypesNameInfo(List tList)
16 | {
17 | List typeList = new List();
18 | Dictionary classNameInfoDict = new Dictionary();
19 | foreach (var t in tList)
20 | {
21 | classNameInfoDict.Add(t.FullName, new ClassInfo(t));
22 | typeList.Add(t);
23 | }
24 | Dictionary baseTypeInfo = new Dictionary();
25 | TypeReference tmpTR;
26 | TypeDefinition tmpTD;
27 | ClassInfo tmpCNI;
28 | foreach (var t in typeList)
29 | {
30 | tmpTR = t.BaseType;
31 | try
32 | {
33 | tmpTD = tmpTR.Resolve();
34 | if (!classNameInfoDict.TryGetValue(tmpTD.FullName, out tmpCNI))
35 | {
36 | if (!baseTypeInfo.TryGetValue(tmpTD.FullName, out tmpCNI))
37 | {
38 | tmpCNI = new ClassInfo(tmpTD);
39 | baseTypeInfo.Add(tmpTD.FullName, tmpCNI);
40 | }
41 | }
42 | classNameInfoDict[t.FullName].nameSet.UnionWith(tmpCNI.nameSet);
43 | tmpTR = tmpTD.BaseType;
44 | }
45 | catch
46 | {
47 | break;
48 | }
49 | }
50 | return classNameInfoDict;
51 | }
52 |
53 | ///
54 | /// 获取垃圾函数列表
55 | ///
56 | ///
57 | ///
58 | public static List GetSrcMethodList(List sList)
59 | {
60 | List mInfoList = new List();
61 | foreach (var t in sList)
62 | {
63 | foreach (var method in t.Methods)
64 | {
65 | if (!method.Name.StartsWith(".") && method.IsStatic)
66 | {
67 | mInfoList.Add(method);
68 | }
69 | }
70 | }
71 | return mInfoList;
72 | }
73 |
74 | }
75 | }
76 |
77 |
78 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/DllInfoHelper.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 23eedc5ae94350d4a8b6ba44c71498b1
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/NameFactory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using UnityEngine;
5 | using System.IO;
6 |
7 | using Random = System.Random;
8 |
9 | namespace Flower.UnityObfuscator
10 | {
11 |
12 | internal class NameFactory
13 | {
14 | private class NameCollection
15 | {
16 | private List nameList = new List();
17 | private Dictionary old_new_Dic = new Dictionary();
18 | private Dictionary new_old_Dic = new Dictionary();
19 |
20 | private Random random;
21 |
22 | public static ObfuscateNameType ObfuscateNameType { get; set; }
23 |
24 | private NameType nameType;
25 |
26 | public NameType NameType
27 | {
28 | get
29 | {
30 | return nameType;
31 | }
32 | }
33 |
34 | public Dictionary Old_New_NameDic
35 | {
36 | get
37 | {
38 | return old_new_Dic;
39 | }
40 | }
41 |
42 | public Dictionary New_Old_NameDic
43 | {
44 | get
45 | {
46 | return new_old_Dic;
47 | }
48 | }
49 |
50 | public NameCollection(NameType nameType, ICollection nameList, Random random)
51 | {
52 | this.nameType = NameType;
53 | this.nameList = new List(nameList);
54 | this.random = random;
55 | }
56 |
57 | public bool AlreadHanveRandomName(BaseObfuscateItem obfuscateItem)
58 | {
59 | return old_new_Dic.ContainsKey(obfuscateItem);
60 | }
61 |
62 | public string GetAName(BaseObfuscateItem obfuscateItem)
63 | {
64 | string newName = string.Empty;
65 |
66 | if (!old_new_Dic.TryGetValue(obfuscateItem, out newName))
67 | {
68 | newName = GetAName();
69 | old_new_Dic.Add(obfuscateItem, newName);
70 | new_old_Dic.Add(newName, obfuscateItem);
71 | }
72 |
73 | return newName;
74 | }
75 |
76 | public string GetAName(bool removeFormLib = true)
77 | {
78 | if (ObfuscateNameType == ObfuscateNameType.NameList)
79 | {
80 | string newName = string.Empty;
81 | if (nameList.Count <= 0)
82 | {
83 | throw new System.Exception("Not enough random name");
84 | }
85 |
86 | int index = random.Next(0, nameList.Count);
87 | newName = nameList[index];
88 | if (removeFormLib)
89 | nameList.Remove(newName);
90 | return newName;
91 | }
92 | else
93 | {
94 | return ObfuscatorHelper.GetANameFromRandomChar();
95 | }
96 | }
97 |
98 | }
99 |
100 |
101 | private Dictionary NameCollectionDic = new Dictionary();
102 |
103 | private static NameFactory _instance;
104 |
105 | public static NameFactory Instance
106 | {
107 | get
108 | {
109 | return _instance;
110 | }
111 | }
112 |
113 | static NameFactory()
114 | {
115 | _instance = new NameFactory();
116 | }
117 |
118 | public void Load(ObfuscateNameType obfuscateNameType)
119 | {
120 | Random random = ObfuscatorHelper.ObfuscateRandom;
121 |
122 | NameCollectionDic = new Dictionary();
123 |
124 | if (random == null)
125 | {
126 | Debug.LogError("NameFactory Init Fail: Random Param Is Null");
127 | return;
128 | }
129 |
130 | if (obfuscateNameType == ObfuscateNameType.NameList)
131 | {
132 | string[] strs = File.ReadAllLines(Application.dataPath + "/" + Const.NameListPath);
133 | int index = 0;
134 |
135 | int namesCountPerType = strs.Length / Enum.GetValues(typeof(NameType)).Length;
136 |
137 | foreach (NameType v in Enum.GetValues(typeof(NameType)))
138 | {
139 | List list = new List();
140 | for (int i = index; i < index + namesCountPerType; i++)
141 | {
142 | list.Add(strs[i]);
143 | }
144 | index += namesCountPerType;
145 |
146 | NameCollectionDic.Add(v, new NameCollection(v, list, random));
147 | }
148 | }
149 | else
150 | {
151 | foreach (NameType v in Enum.GetValues(typeof(NameType)))
152 | {
153 | List list = new List();
154 | NameCollectionDic.Add(v, new NameCollection(v, list, random));
155 | }
156 | }
157 |
158 | NameCollection.ObfuscateNameType = obfuscateNameType;
159 |
160 | }
161 |
162 | private NameFactory()
163 | {
164 |
165 | }
166 |
167 | public bool AlreadyHaveRandomName(NameType nameType, BaseObfuscateItem obfuscateItem)
168 | {
169 | bool result = false;
170 | if (NameCollectionDic.ContainsKey(nameType))
171 | {
172 | result = NameCollectionDic[nameType].AlreadHanveRandomName(obfuscateItem);
173 | }
174 |
175 | return result;
176 | }
177 |
178 | public string GetRandomName(NameType nameType, BaseObfuscateItem obfuscateItem)
179 | {
180 | string newName = string.Empty;
181 |
182 | if (NameCollectionDic.ContainsKey(nameType))
183 | {
184 | newName = NameCollectionDic[nameType].GetAName(obfuscateItem);
185 | }
186 |
187 | return newName;
188 | }
189 |
190 | public string GetRandomName()
191 | {
192 | return NameCollectionDic[NameType.Other].GetAName(false);
193 | }
194 |
195 | public Dictionary GetOld_New_NameDic(NameType nameType)
196 | {
197 | if (NameCollectionDic.ContainsKey(nameType))
198 | return NameCollectionDic[nameType].Old_New_NameDic;
199 |
200 | return null;
201 | }
202 |
203 | public Dictionary GetNew_Old_NameDic(NameType nameType)
204 | {
205 | if (NameCollectionDic.ContainsKey(nameType))
206 | return NameCollectionDic[nameType].New_Old_NameDic;
207 |
208 | return null;
209 | }
210 |
211 | public void OutputNameMap(string path)
212 | {
213 | string result = string.Empty;
214 | string str = "-------------";
215 |
216 |
217 | foreach (var collection in NameCollectionDic)
218 | {
219 | if (collection.Key == NameType.Other) continue;
220 |
221 | result += str + collection.Key.ToString() + str + "\n";
222 | foreach (var item in collection.Value.Old_New_NameDic)
223 | {
224 | result += item.Key.Name + " ===> " + item.Value + "\n";
225 | }
226 | }
227 |
228 | File.WriteAllText(path, result);
229 | }
230 |
231 | }
232 | }
233 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/NameFactory.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a1f161076ec4ccc4f9179ae0f6826c3a
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/NameObfuscate.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 | using Mono.Cecil;
5 |
6 |
7 | namespace Flower.UnityObfuscator
8 | {
9 | internal class NameObfuscate : Obfuscator
10 | {
11 | protected static NameObfuscate _instance = null;
12 |
13 | public static NameObfuscate Instance
14 | {
15 | get
16 | {
17 | if (_instance == null)
18 | {
19 | _instance = new NameObfuscate();
20 | }
21 | return _instance;
22 | }
23 | }
24 |
25 | protected override string Symbol
26 | {
27 | get
28 | {
29 | return "NameObfuscate";
30 | }
31 | }
32 |
33 | public override void Init(ObfuscateType obfuscateType)
34 | {
35 | this.obfuscateType = obfuscateType;
36 |
37 | Dictionary whiteListPathDic = new Dictionary();
38 | Dictionary obfuscateListPathDic = new Dictionary();
39 |
40 | whiteListPathDic.Add(WhiteListType.Namespace, string.Format(Const.WhiteList_NamespacePath, Symbol));
41 | whiteListPathDic.Add(WhiteListType.NameSpcaceNameOnly, string.Format(Const.WhiteList_NamespaceNameOnlyPath, Symbol));
42 | whiteListPathDic.Add(WhiteListType.Class, string.Format(Const.WhiteList_ClassPath, Symbol));
43 | whiteListPathDic.Add(WhiteListType.ClassNameOnly, string.Format(Const.WhiteList_ClassNameOnlyPath, Symbol));
44 | whiteListPathDic.Add(WhiteListType.Method, string.Format(Const.WhiteList_MethodPath, Symbol));
45 | whiteListPathDic.Add(WhiteListType.Member, string.Format(Const.WhiteList_MemberPath, Symbol));
46 |
47 | obfuscateListPathDic.Add(WhiteListType.Namespace, string.Format(Const.ObfuscateList_NamespacePath, Symbol));
48 | obfuscateListPathDic.Add(WhiteListType.NameSpcaceNameOnly, string.Format(Const.ObfuscateList_NamespaceExceptNamespaceNamePath, Symbol));
49 | obfuscateListPathDic.Add(WhiteListType.Class, string.Format(Const.ObfuscateList_ClassPath, Symbol));
50 | obfuscateListPathDic.Add(WhiteListType.ClassNameOnly, string.Format(Const.ObfuscateList_ClassExceptClassNamePath, Symbol));
51 | obfuscateListPathDic.Add(WhiteListType.Method, string.Format(Const.ObfuscateList_MethodPath, Symbol));
52 | obfuscateListPathDic.Add(WhiteListType.Member, string.Format(Const.ObfuscateList_MemberPath, Symbol));
53 |
54 | whiteList = new WhiteList(whiteListPathDic);
55 | obfuscateList = new WhiteList(obfuscateListPathDic);
56 | }
57 |
58 | public void AddInjectMethodListToWhiteList(List list)
59 | {
60 | whiteList.AddInjectMethod(CodeInject.Instance.InjectMethodList);
61 | }
62 |
63 | public override bool MethodNeedSkip(MethodDefinition method)
64 | {
65 | bool isIEnumerator = method.ReturnType.FullName == "System.Collections.IEnumerator";
66 | if (WhiteList.IsSkipMethod(method) || method.IsVirtual || isIEnumerator || method.IsConstructor || method.Name.StartsWith(".") || method.Name.Contains("<"))
67 | {
68 | return true;
69 | }
70 | else
71 | {
72 | return false;
73 | }
74 | }
75 |
76 | public override bool ClassNeedSkip(TypeDefinition type)
77 | {
78 | if (type.Name.Contains("<") || type.IsEnum || type.Name.Contains("`"))
79 | {
80 | return true;
81 | }
82 |
83 | return false;
84 | }
85 |
86 | public void DoObfuscate(AssemblyDefinition assembly)
87 | {
88 | var module = assembly.MainModule;
89 |
90 | if (module == null)
91 | {
92 | Debug.LogError("Target assembly is null");
93 | return;
94 | }
95 |
96 | AddInjectMethodListToWhiteList(CodeInject.Instance.InjectMethodList);
97 |
98 | foreach (var type in module.Types)
99 | {
100 | if (ClassNeedSkip(type))
101 | continue;
102 |
103 | ChangeFieldName(type);
104 | ChangePropertyName(type);
105 | ChangeMethodName(type);
106 | ChangeClassName(type);
107 | ChangeNamespace(type);
108 | }
109 | }
110 |
111 | private bool IsSubClassOfType(TypeDefinition t, string parentClassName)
112 | {
113 | TypeReference btype = t.BaseType;
114 | while (btype != null)
115 | {
116 | if (btype.Name == parentClassName)
117 | {
118 | return true;
119 | }
120 | try
121 | {
122 | btype = btype.Resolve().BaseType;
123 | }
124 | catch (System.Exception e)
125 | {
126 | //ModuleDefinition tmpMD = btype.Module;
127 | Debug.LogError(e);
128 | break;
129 | }
130 |
131 | }
132 | return false;
133 | }
134 |
135 |
136 | ///
137 | /// 修改字段名
138 | ///
139 | ///
140 | private void ChangeFieldName(TypeDefinition t)
141 | {
142 | foreach (var field in t.Fields)
143 | {
144 | string fieldName = field.Name;
145 | if (IsChangeField(t, fieldName))
146 | {
147 | field.Name = NameFactory.Instance.GetRandomName(NameType.Filed, ObfuscateItemFactory.Create(field));
148 | }
149 | }
150 | }
151 |
152 | ///
153 | /// 修改属性名
154 | ///
155 | ///
156 | private void ChangePropertyName(TypeDefinition t)
157 | {
158 | foreach (var property in t.Properties)
159 | {
160 | string propertyName = property.Name;
161 |
162 | if (IsChangeProperty(t, propertyName))
163 | {
164 | property.Name = NameFactory.Instance.GetRandomName(NameType.Property, ObfuscateItemFactory.Create(property));
165 | }
166 | }
167 | }
168 |
169 | ///
170 | /// 修改方法名
171 | ///
172 | ///
173 | private void ChangeMethodName(TypeDefinition t)
174 | {
175 | foreach (var method in t.Methods)
176 | {
177 | if (IsChangeMethod(t, method))
178 | method.Name = NameFactory.Instance.GetRandomName(NameType.Method, ObfuscateItemFactory.Create(method));
179 | }
180 | }
181 |
182 | ///
183 | /// 修改类名.
184 | ///
185 | ///
186 | private void ChangeClassName(TypeDefinition t)
187 | {
188 | if (IsChangeClass(t))
189 | t.Name = NameFactory.Instance.GetRandomName(NameType.Class, ObfuscateItemFactory.Create(t));
190 | }
191 |
192 | ///
193 | /// 修改名字空间名
194 | ///
195 | ///
196 | private void ChangeNamespace(TypeDefinition t)
197 | {
198 | if (IsChangeNamespace(t))
199 | t.Namespace = NameFactory.Instance.GetRandomName(NameType.Namespace, ObfuscateItemFactory.Create(t.Namespace, t.Module));
200 | }
201 |
202 |
203 | }
204 | }
205 |
206 |
207 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/NameObfuscate.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4ece1369983820f459a973695fba986b
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/ObfuscateItem.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5e289a577b0c88747a486bff94480d76
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/Obfuscator.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 | using Mono.Cecil;
5 |
6 | namespace Flower.UnityObfuscator
7 | {
8 | internal abstract class Obfuscator
9 | {
10 | //为true时只混特定范围,即ObfuscateList下的配置
11 | //为false时,除了白名单外都混,即WhiteList下的配置
12 | //protected bool OnlyParticularRange = false;
13 |
14 | protected ObfuscateType obfuscateType;
15 |
16 | protected WhiteList whiteList;
17 | protected WhiteList obfuscateList;
18 |
19 | protected abstract string Symbol { get; }
20 |
21 | public abstract void Init(ObfuscateType obfuscateType);
22 |
23 | public abstract bool MethodNeedSkip(MethodDefinition method);
24 |
25 | public abstract bool ClassNeedSkip(TypeDefinition type);
26 |
27 | protected bool IsChange(bool inObfuscateList, bool inWhiteList)
28 | {
29 | bool change = true;
30 |
31 | switch (obfuscateType)
32 | {
33 | case ObfuscateType.ParticularRange:
34 | change = inObfuscateList;
35 | break;
36 | case ObfuscateType.WhiteList:
37 | change = !inWhiteList;
38 | break;
39 | case ObfuscateType.Both:
40 | change = inObfuscateList && !inWhiteList;
41 | break;
42 | default:
43 | change = false;
44 | break;
45 | }
46 |
47 | return change;
48 | }
49 |
50 | protected virtual bool IsChangeField(TypeDefinition t, string fieldName)
51 | {
52 | bool inObfuscateList = ((obfuscateList.IsWhiteListNamespace(t.Namespace)
53 | || obfuscateList.IsWhiteListClassMember(fieldName, t.Name, t.Namespace)
54 | || obfuscateList.IsWhiteListClass(t.Name, t.Namespace))
55 | || obfuscateList.IsWhiteListClassNameOnly(t.Name, t.Namespace)
56 | && !ClassNeedSkip(t));
57 |
58 | bool inWhiteList = (whiteList.IsWhiteListNamespace(t.Namespace)
59 | || whiteList.IsWhiteListClassMember(fieldName, t.Name, t.Namespace)
60 | || whiteList.IsWhiteListClass(t.Name, t.Namespace)
61 | || ClassNeedSkip(t));
62 |
63 | return IsChange(inObfuscateList, inWhiteList);
64 | }
65 |
66 | protected virtual bool IsChangeProperty(TypeDefinition t, string propertyName)
67 | {
68 | bool inObfuscateList = (obfuscateList.IsWhiteListNamespace(t.Namespace)
69 | || obfuscateList.IsWhiteListClassMember(propertyName, t.Name, t.Namespace)
70 | || obfuscateList.IsWhiteListClass(t.Name, t.Namespace))
71 | || obfuscateList.IsWhiteListClassNameOnly(t.Name, t.Namespace)
72 | && !ClassNeedSkip(t);
73 |
74 | bool inWhiteList = (whiteList.IsWhiteListNamespace(t.Namespace)
75 | || whiteList.IsWhiteListClassMember(propertyName, t.Name, t.Namespace)
76 | || whiteList.IsWhiteListClass(t.Name, t.Namespace)
77 | || ClassNeedSkip(t));
78 |
79 | return IsChange(inObfuscateList, inWhiteList);
80 | }
81 |
82 | protected virtual bool IsChangeMethod(TypeDefinition t, MethodDefinition method)
83 | {
84 | bool inObfuscateList = (obfuscateList.IsWhiteListNamespace(t.Namespace)
85 | || obfuscateList.IsWhiteListMethod(method.Name, t.Name, t.Namespace)
86 | || obfuscateList.IsWhiteListClass(t.Name, t.Namespace)
87 | || obfuscateList.IsWhiteListClassNameOnly(t.Name, t.Namespace))
88 | && !ClassNeedSkip(t) && !MethodNeedSkip(method);
89 |
90 | bool inWhiteList = (MethodNeedSkip(method)
91 | || whiteList.IsWhiteListNamespace(t.Namespace)
92 | || whiteList.IsWhiteListMethod(method.Name, t.Name, t.Namespace)
93 | || whiteList.IsWhiteListClass(t.Name, t.Namespace)
94 | || ClassNeedSkip(t));
95 |
96 | return IsChange(inObfuscateList, inWhiteList);
97 | }
98 |
99 | protected virtual bool IsChangeClass(TypeDefinition t)
100 | {
101 | bool inObfuscateList = ((obfuscateList.IsWhiteListNamespace(t.Namespace)
102 | || obfuscateList.IsWhiteListClass(t.Name, t.Namespace)
103 | && !obfuscateList.IsWhiteListClassNameOnly(t.Name, t.Namespace))
104 | && !ClassNeedSkip(t));
105 |
106 | bool inWhiteList = (whiteList.IsWhiteListNamespace(t.Namespace)
107 | || whiteList.IsWhiteListClass(t.Name, t.Namespace)
108 | || whiteList.IsWhiteListClassNameOnly(t.Name, t.Namespace)
109 | || ClassNeedSkip(t));
110 |
111 | return IsChange(inObfuscateList, inWhiteList);
112 | }
113 |
114 | protected virtual bool IsChangeNamespace(TypeDefinition t)
115 | {
116 | bool inObfuscateList = obfuscateList.IsWhiteListNamespace(t.Namespace) && !obfuscateList.IsWhiteListNamespcaeNameOnly(t.Namespace);
117 | bool inWhiteList = whiteList.IsWhiteListNamespace(t.Namespace, true) || whiteList.IsWhiteListNamespcaeNameOnly(t.Namespace, true);
118 |
119 | return IsChange(inObfuscateList, inWhiteList);
120 | }
121 |
122 | }
123 | }
124 |
125 |
126 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/Obfuscator.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 64252b7ec21c9ee47a6bc88e15d51a74
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/ObfuscatorConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 |
5 | namespace Flower.UnityObfuscator
6 | {
7 | internal class ObfuscatorConfig : ScriptableObject
8 | {
9 | //随机种子
10 | public int randomSeed = 123;
11 | //使用时间作为随机种子
12 | public bool useTimeSpan;
13 |
14 | //启用代码混淆
15 | public bool enableCodeObfuscator;
16 |
17 | //使用随机字符命名
18 | public ObfuscateNameType obfuscateNameType;
19 |
20 | //启用名字混淆
21 | public bool enableNameObfuscate;
22 | //启用垃圾代码插入
23 | public bool enableCodeInject;
24 |
25 | //名字混淆的混淆方式
26 | public ObfuscateType nameObfuscateType;
27 | //垃圾代码插入的混淆方式
28 | public ObfuscateType codeInjectType;
29 |
30 | //每个类插入垃圾方法的倍数
31 | public int GarbageMethodMultiplePerClass = 1;
32 | //每个方法调用多少垃圾方法(影响性能)
33 | public int InsertMethodCountPerMethod = 1;
34 |
35 | //需要混淆的Dll的路径
36 | public string[] obfuscateDllPaths = new string[0];
37 |
38 | //垃圾代码库路径
39 | public string uselessCodeLibPath = "";
40 |
41 | //测试混淆输出路径
42 | public string testOutputPath = "";
43 |
44 | }
45 | }
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/ObfuscatorConfig.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 74f57c22403249a458bcae34665b38b9
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/ObfuscatorConfigEditor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f66cd74d097379c46906e5c9ac521861
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/ObfuscatorUtils.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 | using System.Text;
5 |
6 | namespace Flower.UnityObfuscator
7 | {
8 | internal static class ObfuscatorHelper
9 | {
10 | static System.Random random;
11 |
12 | static HashSet set = new HashSet();
13 |
14 |
15 | public static void Init(int randomSeed)
16 | {
17 | random = new System.Random(randomSeed);
18 | }
19 |
20 | static public System.Random ObfuscateRandom
21 | {
22 | get
23 | {
24 | return random;
25 | }
26 | }
27 |
28 | public static string GetANameFromRandomChar()
29 | {
30 | string result = "init";
31 |
32 | int max = 1000;
33 | int current = 0;
34 |
35 | do
36 | {
37 | int len = random.Next(Const.minRandomNameLen, Const.maxRandomNameLen);
38 | StringBuilder sb = new StringBuilder(len);
39 | for (int i = 0; i < len; i++)
40 | {
41 | int index = random.Next(0, Const.randomCharArray.Length);
42 | sb.Append(Const.randomCharArray[index]);
43 |
44 | }
45 | result = sb.ToString();
46 |
47 | current++;
48 | if (current > max)
49 | throw new System.Exception("Not enough random name");
50 | }
51 | while (set.Contains(result));
52 |
53 | set.Add(result);
54 |
55 | return result;
56 | }
57 |
58 |
59 | }
60 | }
61 |
62 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/ObfuscatorUtils.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 30290192c1c965d4da7f66eb4b15eae6
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/ProcessObfuscator.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 | using UnityEditor;
5 | using UnityEditor.Build;
6 | using UnityEngine.SceneManagement;
7 | using System.IO;
8 | using System;
9 |
10 | namespace Flower.UnityObfuscator
11 | {
12 |
13 | internal class ProcessObfuscator : IPreprocessBuild, IProcessScene, IPostprocessBuild
14 | {
15 | private static bool doObfuscate = false;
16 | private static bool hasObfuscated = false;
17 |
18 | public int callbackOrder { get { return 1000; } }
19 |
20 | public void OnPreprocessBuild(BuildTarget target, string path)
21 | {
22 | doObfuscate = true;
23 | }
24 |
25 | public void OnProcessScene(Scene scene)
26 | {
27 | try
28 | {
29 | if (doObfuscate && !hasObfuscated)
30 | DoObfuscate();
31 |
32 | hasObfuscated = true;
33 | }
34 | catch (System.Exception e)
35 | {
36 | throw new System.Exception("Unity Obfuscator Error:" + e);
37 | }
38 |
39 | }
40 |
41 | public void OnPostprocessBuild(BuildTarget target, string path)
42 | {
43 |
44 | }
45 |
46 | private static void DoObfuscate(string[] assemblyDllPath, string uselessCodeLibAssemblyPath, int randomSeed, bool switchNameObfuscate, bool switchCodeInject,
47 | ObfuscateType nameObfuscateType, ObfuscateType codeInjectObfuscateType, ObfuscateNameType obfuscateNameType,
48 | int garbageMethodMultiplePerClass, int insertMethodCountPerMethod)
49 | {
50 | CodeObfuscator.DoObfuscate(assemblyDllPath, uselessCodeLibAssemblyPath, randomSeed, switchNameObfuscate, switchCodeInject,
51 | nameObfuscateType, codeInjectObfuscateType, obfuscateNameType, garbageMethodMultiplePerClass, insertMethodCountPerMethod);
52 | }
53 |
54 |
55 | private static void DoObfuscateByConfig(string[] assemblyPath)
56 | {
57 | ObfuscatorConfig obfuscatorConfig = AssetDatabase.LoadAssetAtPath(Const.ConfigAssetPath);
58 |
59 | if (obfuscatorConfig == null)
60 | {
61 | Debug.Log(Const.ConfigAssetPath + "不存在");
62 | return;
63 | }
64 |
65 | if (!obfuscatorConfig.enableCodeObfuscator)
66 | return;
67 |
68 | string uselessCodeLibAssemblyPath = obfuscatorConfig.uselessCodeLibPath;
69 |
70 | int randomSeed = obfuscatorConfig.randomSeed;
71 | if (obfuscatorConfig.useTimeSpan)
72 | randomSeed = (int)DateTime.Now.Ticks;
73 |
74 | bool enableNameObfuscate = obfuscatorConfig.enableNameObfuscate;
75 | bool enableCodeInject = obfuscatorConfig.enableCodeInject;
76 | ObfuscateType nameObfuscateType = obfuscatorConfig.nameObfuscateType;
77 | ObfuscateType codeInjectObfuscateType = obfuscatorConfig.codeInjectType;
78 | ObfuscateNameType obfuscateNameType = obfuscatorConfig.obfuscateNameType;
79 | int garbageMethodMultiplePerClass = obfuscatorConfig.GarbageMethodMultiplePerClass;
80 | int insertMethodCountPerMethod = obfuscatorConfig.InsertMethodCountPerMethod;
81 |
82 | DoObfuscate(assemblyPath, uselessCodeLibAssemblyPath, randomSeed, enableNameObfuscate, enableCodeInject, nameObfuscateType, codeInjectObfuscateType, obfuscateNameType, garbageMethodMultiplePerClass, insertMethodCountPerMethod);
83 | }
84 |
85 | private static void DoObfuscate()
86 | {
87 | ObfuscatorConfig obfuscatorConfig = AssetDatabase.LoadAssetAtPath(Const.ConfigAssetPath);
88 |
89 | DoObfuscateByConfig(obfuscatorConfig.obfuscateDllPaths);
90 | }
91 |
92 |
93 | //测试混淆(不需要Build,直接输出)
94 | public static void TestObfuscate()
95 | {
96 | ObfuscatorConfig obfuscatorConfig = AssetDatabase.LoadAssetAtPath(Const.ConfigAssetPath);
97 |
98 | string[] pathsConfig = obfuscatorConfig.obfuscateDllPaths;
99 | if (pathsConfig == null)
100 | {
101 | Debug.LogError("目标DLL路径为空");
102 | return;
103 | }
104 | if (!Directory.Exists(obfuscatorConfig.testOutputPath))
105 | {
106 | Debug.LogError(string.Format("找不到混淆测试输出路径:{0}", obfuscatorConfig.testOutputPath));
107 | return;
108 | }
109 |
110 | FileInfo[] fileInfos = new FileInfo[pathsConfig.Length];
111 |
112 | for (int i = 0; i < pathsConfig.Length; i++)
113 | {
114 | string path = pathsConfig[i];
115 | //有可能记录的是相对路径,这里如果找不到对应路径就找相对路径
116 | path = File.Exists(path) ? path : (Application.dataPath.Substring(0, Application.dataPath.Length - 6) + path);
117 | bool exists = File.Exists(path);
118 |
119 | if (!exists)
120 | {
121 | Debug.Log(string.Format("找不到混淆目标文件:{0}", path));
122 | return;
123 | }
124 |
125 | FileInfo fileInfo = new FileInfo(path);
126 |
127 | string oringalMDBPath = fileInfo.FullName + ".mdb";
128 | if (!File.Exists(oringalMDBPath))
129 | {
130 | Debug.Log(string.Format("找不到该MDB文件:{0}", oringalMDBPath));
131 | return;
132 | }
133 |
134 | fileInfos[i] = fileInfo;
135 | }
136 |
137 | string[] copyDllPaths = new string[pathsConfig.Length];
138 |
139 | for (int i = 0; i < fileInfos.Length; i++)
140 | {
141 | string targetPath = obfuscatorConfig.testOutputPath + "/" + fileInfos[i].Name;
142 | string oringalMDBPath = fileInfos[i].FullName + ".mdb";
143 | string targetMDBPath = obfuscatorConfig.testOutputPath + "/" + fileInfos[i].Name + ".mdb";
144 |
145 | if (File.Exists(targetPath))
146 | {
147 | File.Delete(targetPath);
148 | }
149 |
150 | if (File.Exists(targetMDBPath))
151 | {
152 | File.Delete(targetMDBPath);
153 | }
154 |
155 |
156 | File.Copy(fileInfos[i].FullName, targetPath);
157 | File.Copy(oringalMDBPath, targetMDBPath);
158 | copyDllPaths[i] = targetPath;
159 | }
160 |
161 | DoObfuscateByConfig(copyDllPaths);
162 | }
163 |
164 | }
165 |
166 | }
167 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/ProcessObfuscator.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2253144be1c4bc647b8ce63c225f9062
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/Tools.cs:
--------------------------------------------------------------------------------
1 | //using System.Collections;
2 | //using System.Collections.Generic;
3 | //using UnityEngine;
4 | //using UnityEditor;
5 | //using System.IO;
6 | //using UnityEditor.SceneManagement;
7 | //using System;
8 |
9 | //namespace Flower.UnityObfuscator
10 | //{
11 | // internal class Tools
12 | // {
13 | // private static List whiteListClassNameOnly = new List();
14 | // private static List whiteListMethod = new List();
15 |
16 | // private static readonly string[] prefabPaths = new string[] { "Assets/Res" };
17 | // private static readonly string[] scenePaths = new string[] { "Assets/Res" };
18 |
19 | // private static readonly string whiteListClassNameOnlyFilePath = @"WhiteListClassNameOnly.txt";
20 | // private static readonly string whiteListMethodFilePath = @"WhiteListMethod.txt";
21 |
22 |
23 |
24 |
25 | // [MenuItem("Unity Obfuscator/Create Obfuscator Config Asset", false, 3)]
26 | // private static void CreateObfuscatorConfigAsset()
27 | // {
28 | // if (File.Exists(Const.ConfigAssetPath))
29 | // {
30 | // Debug.Log("ObfuscatorConfig已存在");
31 | // return;
32 | // }
33 |
34 | // var exampleAsset = ScriptableObject.CreateInstance();
35 |
36 | // AssetDatabase.CreateAsset(exampleAsset, Const.ConfigAssetPath);
37 | // AssetDatabase.Refresh();
38 | // Debug.Log("Create ObfuscatorConfig");
39 | // }
40 |
41 |
42 | // [MenuItem("Unity Obfuscator/Output WhiteList", false, 2)]
43 | // private static void OutputWhiteList()
44 | // {
45 | // UnityEngine.SceneManagement.Scene currentScene = UnityEngine.SceneManagement.SceneManager.GetActiveScene();
46 |
47 | // try
48 | // {
49 | // UnityEngine.SceneManagement.Scene scene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene);
50 | // EditorSceneManager.OpenScene(scene.path);
51 | // }
52 | // catch
53 | // {
54 |
55 | // }
56 |
57 | // whiteListClassNameOnly = new List();
58 | // whiteListMethod = new List();
59 |
60 | // AddRangeToListWithoutDuplicate(whiteListClassNameOnly, GetClassInfoOnPrefab());
61 | // AddRangeToListWithoutDuplicate(whiteListClassNameOnly, GetClassInfoOnSceneGO());
62 |
63 | // string whiteListClassNameOnlyStr = ConverListStringToLines(whiteListClassNameOnly);
64 | // string whiteListMethodStr = ConverListStringToLines(whiteListMethod);
65 |
66 | // File.WriteAllText(whiteListClassNameOnlyFilePath, whiteListClassNameOnlyStr);
67 | // File.WriteAllText(whiteListMethodFilePath, whiteListMethodStr);
68 |
69 | // EditorUtility.ClearProgressBar();
70 |
71 | // try
72 | // {
73 | // EditorSceneManager.OpenScene(currentScene.path);
74 | // }
75 | // catch
76 | // {
77 |
78 | // }
79 |
80 |
81 | // }
82 |
83 | // private static void AddRangeToListWithoutDuplicate(List resultList, List addList)
84 | // {
85 | // foreach (var item in addList)
86 | // {
87 | // if (!resultList.Contains(item))
88 | // resultList.Add(item);
89 | // }
90 | // }
91 |
92 | // private static string ConverListStringToLines(List list)
93 | // {
94 | // string str = string.Empty;
95 | // foreach (var item in list)
96 | // {
97 | // str += item + '\n';
98 | // }
99 |
100 | // return str;
101 | // }
102 |
103 |
104 | // private static List GetAssetsPathWithType(string[] path, string typeParam)
105 | // {
106 | // List list = new List();
107 | // string[] GUIDs = AssetDatabase.FindAssets(typeParam, path);
108 | // foreach (var guid in GUIDs)
109 | // {
110 | // string assetPath = AssetDatabase.GUIDToAssetPath(guid);
111 | // list.Add(assetPath);
112 | // }
113 |
114 | // return list;
115 | // }
116 |
117 | // public static List GetClassInfoOnPrefab()
118 | // {
119 | // List prefabList = GetAssetsPathWithType(prefabPaths, "t:Prefab");
120 | // List list = new List();
121 |
122 | // for (int i = 0; i < prefabList.Count; i++)
123 | // {
124 | // ShowProgress((float)i / (float)prefabList.Count, prefabList.Count, i);
125 |
126 | // GameObject prefab = AssetDatabase.LoadAssetAtPath(prefabList[i], typeof(GameObject)) as GameObject;
127 | // GameObject go = PrefabUtility.InstantiatePrefab(prefab) as GameObject;
128 | // foreach (Transform child in go.GetComponentsInChildren(true))
129 | // {
130 | // foreach (var component in child.GetComponents())
131 | // {
132 | // string classInfo = GetComponentType(component);
133 | // if (classInfo != null)
134 | // {
135 | // list.Add(classInfo);
136 | // //Debug.Log(string.Format("{0}:{1}", prefabList[i], classInfo));
137 | // }
138 | // }
139 | // }
140 | // }
141 | // return list;
142 | // }
143 |
144 | // public static List GetClassInfoOnSceneGO()
145 | // {
146 | // List sceneList = GetAssetsPathWithType(scenePaths, "t:Scene");
147 | // List list = new List();
148 | // int i = 0;
149 |
150 | // //所有场景
151 | // foreach (var scenePath in sceneList)
152 | // {
153 | // EditorSceneManager.OpenScene(scenePath);
154 | // //Debug.Log(scenePath);
155 | // ShowProgress((float)i / (float)sceneList.Count, sceneList.Count, i);
156 |
157 | // //场景根目录GO
158 | // foreach (GameObject rootObj in UnityEngine.SceneManagement.SceneManager.GetActiveScene().GetRootGameObjects())
159 | // {
160 | // //Debug.Log(string.Format("{0}:{1}", scenePath, rootObj));
161 | // //子物体
162 | // foreach (Transform child in rootObj.GetComponentsInChildren(true))
163 | // {
164 | // //物体上的所有组件
165 | // foreach (var component in child.GetComponents())
166 | // {
167 | // string classInfo = GetComponentType(component);
168 | // if (classInfo != null)
169 | // list.Add(classInfo);
170 | // }
171 | // }
172 | // }
173 | // i++;
174 | // }
175 |
176 | // return list;
177 | // }
178 |
179 | // private static bool ProcessSpecialType(Component component)
180 | // {
181 | // if (component == null)
182 | // return false;
183 |
184 | // string type = component.GetType().ToString();
185 |
186 | // if (type.StartsWith("UnityEngine."))
187 | // {
188 | // switch (type)
189 | // {
190 | // case "UnityEngine.UI.Button":
191 | // ProcessUnityEngineUIButtonType(component);
192 | // break;
193 | // }
194 |
195 | // return true;
196 | // }
197 |
198 | // return false;
199 | // }
200 |
201 | // private static void ProcessUnityEngineUIButtonType(Component component)
202 | // {
203 | // UnityEngine.UI.Button button = component as UnityEngine.UI.Button;
204 | // if (button == null || button.onClick == null) return;
205 |
206 | // int count = button.onClick.GetPersistentEventCount();
207 | // string result = null;
208 | // for (int i = 0; i < count; i++)
209 | // {
210 | // string target = button.onClick.GetPersistentTarget(i).GetType().ToString();
211 | // string method = button.onClick.GetPersistentMethodName(i);
212 |
213 | // string str = string.Format("{0}.{1}.{2}", button.onClick.GetPersistentTarget(i).GetType().Namespace, target, method);
214 |
215 | // string[] strs = str.Split('.');
216 | // result = string.Empty;
217 | // for (int j = 0; j < strs.Length - 1; j++)
218 | // {
219 | // result += strs[j];
220 | // if (j < strs.Length - 2)
221 | // result += '.';
222 | // }
223 | // if (strs.Length >= 2)
224 | // result += WhiteList.sperateChar;
225 | // else
226 | // {
227 | // result += WhiteList.nullChar;
228 | // result += WhiteList.sperateChar;
229 | // }
230 |
231 | // result += strs[strs.Length - 1];
232 | // }
233 |
234 | // if (result != null && !whiteListMethod.Contains(result))
235 | // whiteListMethod.Add(result);
236 |
237 | // }
238 |
239 |
240 |
241 | // private static string GetComponentType(Component component)
242 | // {
243 | // string result = null;
244 | // if (component == null)
245 | // return result;
246 |
247 | // if (!ProcessSpecialType(component))
248 | // {
249 | // string type = component.GetType().ToString();
250 |
251 | // string[] strs = type.Split('.');
252 | // result = string.Empty;
253 | // for (int i = 0; i < strs.Length - 1; i++)
254 | // {
255 | // result += strs[i];
256 | // if (i < strs.Length - 2)
257 | // result += '.';
258 | // }
259 | // if (strs.Length >= 2)
260 | // result += WhiteList.sperateChar;
261 | // else
262 | // {
263 | // result += WhiteList.nullChar;
264 | // result += WhiteList.sperateChar;
265 | // }
266 |
267 | // result += strs[strs.Length - 1];
268 | // }
269 | // return result;
270 | // }
271 |
272 | // private static void ShowProgress(float progress, int total, int cur)
273 | // {
274 | // EditorUtility.DisplayProgressBar("Searching", string.Format("Finding ({0}/{1}), please wait...", cur, total), progress);
275 | // }
276 |
277 | // }
278 | //}
279 |
280 |
281 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/Tools.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 23ba126879715d048b48144b29fbc57d
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/WhiteList.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 | using System.IO;
5 | using System;
6 | using Mono.Cecil;
7 |
8 | namespace Flower.UnityObfuscator
9 | {
10 | internal class WhiteList
11 | {
12 | public static readonly char sperateChar = '|';
13 | public static readonly char nullChar = '*';
14 |
15 | private Dictionary> dic = new Dictionary>();
16 |
17 | private static List injectMethod = new List();
18 |
19 | private static HashSet unityMethodWhiteList = new HashSet { //函数黑名单
20 | #region MonoBehaviour Message
21 | "Awake",
22 | "FixedUpdate",
23 | "LateUpdate",
24 | "OnAnimatorIK",
25 | "OnAnimatorMove",
26 | "OnApplicationFocus",
27 | "OnApplicationPause",
28 | "OnApplicationQuit",
29 | "OnAudioFilterRead",
30 | "OnBecameInvisible",
31 | "OnBecameVisible",
32 | "OnCollisionEnter",
33 | "OnCollisionEnter2D",
34 | "OnCollisionExit",
35 | "OnCollisionExit2D",
36 | "OnCollisionStay",
37 | "OnCollisionStay2D",
38 | "OnConnectedToServer",
39 | "OnControllerColliderHit",
40 | "OnDestroy",
41 | "OnDisable",
42 | "OnDisconnectedFromServer",
43 | "OnDrawGizmos",
44 | "OnDrawGizmosSelected",
45 | "OnEnable",
46 | "OnFailedToConnect",
47 | "OnFailedToConnectToMasterServer",
48 | "OnGUI",
49 | "OnJointBreak",
50 | "OnJointBreak2D",
51 | "OnMasterServerEvent",
52 | "OnMouseDown",
53 | "OnMouseDrag",
54 | "OnMouseEnter",
55 | "OnMouseExit",
56 | "OnMouseOver",
57 | "OnMouseUp",
58 | "OnMouseUpAsButton",
59 | "OnNetworkInstantiate",
60 | "OnParticleCollision",
61 | "OnParticleTrigger",
62 | "OnPlayerConnected",
63 | "OnPlayerDisconnected",
64 | "OnPostRender",
65 | "OnPreCull",
66 | "OnPreRender",
67 | "OnRenderImage",
68 | "OnRenderObject",
69 | "OnSerializeNetworkView",
70 | "OnServerInitialized",
71 | "OnTransformChildrenChanged",
72 | "OnTransformParentChanged",
73 | "OnTriggerEnter",
74 | "OnTriggerEnter2D",
75 | "OnTriggerExit",
76 | "OnTriggerExit2D",
77 | "OnTriggerStay",
78 | "OnTriggerStay2D",
79 | "OnValidate",
80 | "OnWillRenderObject",
81 | "Reset",
82 | "Start",
83 | "Update",
84 | #endregion
85 | };
86 |
87 | public WhiteList(Dictionary configFilePathDic)
88 | {
89 | foreach (var item in configFilePathDic)
90 | {
91 | LoadWhiteList(item.Key, item.Value);
92 | }
93 | CheckWhiteListData();
94 | }
95 |
96 | private void LoadWhiteList(WhiteListType whiteListType, string path)
97 | {
98 | if (dic.ContainsKey(whiteListType))
99 | {
100 | Debug.LogError("Init White List Error: Key Duplicated");
101 | return;
102 | }
103 | else
104 | {
105 | string[] lines = File.ReadAllLines(Application.dataPath + path);
106 | dic.Add(whiteListType, new List(lines));
107 | }
108 | }
109 |
110 | public void AddInjectMethod(List list)
111 | {
112 | injectMethod.AddRange(list);
113 | }
114 |
115 | private void CheckWhiteListData()
116 | {
117 | Func check = (str, splitCount) =>
118 | {
119 | return !(str.Contains(" ") || str.Split(sperateChar).Length != splitCount);
120 | };
121 |
122 | foreach (var item in dic)
123 | {
124 | switch (item.Key)
125 | {
126 | case WhiteListType.Namespace:
127 | foreach (var str in item.Value)
128 | {
129 | if (!check(str, 1))
130 | Debug.LogError("Check White List Data Error: " + item.Key.ToString() + ":" + str);
131 | }
132 | break;
133 | case WhiteListType.Class:
134 | foreach (var str in item.Value)
135 | {
136 | if (!check(str, 2))
137 | Debug.LogError("Check White List Data Error: " + item.Key.ToString() + ":" + str);
138 | }
139 | break;
140 | case WhiteListType.Method:
141 | foreach (var str in item.Value)
142 | {
143 | if (!check(str, 3))
144 | Debug.LogError("Check White List Data Error: " + item.Key.ToString() + ":" + str);
145 | }
146 | break;
147 | case WhiteListType.Member:
148 | foreach (var str in item.Value)
149 | {
150 | if (!check(str, 3))
151 | Debug.LogError("Check White List Data Error: " + item.Key.ToString() + ":" + str);
152 | }
153 | break;
154 | }
155 | }
156 | }
157 |
158 | public bool IsWhiteListNamespace(string _namespace, bool checkEmpty = false)
159 | {
160 | if (string.IsNullOrEmpty(_namespace))
161 | {
162 | return checkEmpty;
163 | }
164 | string[] strs = _namespace.Split('.');
165 | return Check(strs, WhiteListType.Namespace);
166 | }
167 |
168 | public bool IsWhiteListNamespcaeNameOnly(string _namespace, bool checkEmpty = false)
169 | {
170 | if (string.IsNullOrEmpty(_namespace))
171 | {
172 | return checkEmpty;
173 | }
174 | string[] strs = _namespace.Split('.');
175 | return Check(strs, WhiteListType.NameSpcaceNameOnly);
176 | }
177 |
178 | public bool IsWhiteListClass(string className, string _namespace = null)
179 | {
180 |
181 | if (string.IsNullOrEmpty(className))
182 | {
183 | Debug.LogError("Class Param Error:" + className);
184 |
185 | return false;
186 | }
187 |
188 | return Check(new string[] { (string.IsNullOrEmpty(_namespace) ? nullChar.ToString() : _namespace), className }, WhiteListType.Class);
189 | }
190 |
191 | public bool IsWhiteListClassNameOnly(string className, string _namespace = null)
192 | {
193 |
194 | if (string.IsNullOrEmpty(className))
195 | {
196 | Debug.LogError("Class Param Error:" + className);
197 |
198 | return false;
199 | }
200 |
201 | return Check(new string[] { (string.IsNullOrEmpty(_namespace) ? nullChar.ToString() : _namespace), className }, WhiteListType.ClassNameOnly);
202 | }
203 |
204 | public bool IsWhiteListMethod(string method, string className = null, string _namespace = null)
205 | {
206 | if (string.IsNullOrEmpty(method))
207 | {
208 | Debug.LogError("Method Param Error:" + method);
209 |
210 | return false;
211 | }
212 |
213 | string _namespaceStr = (string.IsNullOrEmpty(_namespace) ? nullChar.ToString() : _namespace);
214 | string _classNameStr = (string.IsNullOrEmpty(className) ? nullChar.ToString() : className);
215 |
216 | return Check(new string[] { _namespaceStr, _classNameStr, method }, WhiteListType.Method);
217 | }
218 |
219 | public bool IsWhiteListClassMember(string member, string className = null, string _namespace = null)
220 | {
221 | if (string.IsNullOrEmpty(member))
222 | {
223 | Debug.LogError("Member Param Error:" + member);
224 |
225 | return false;
226 | }
227 |
228 | return Check(new string[] { (string.IsNullOrEmpty(_namespace) ? nullChar.ToString() : _namespace), (className == null ? nullChar.ToString() : className), member }, WhiteListType.Member);
229 | }
230 |
231 | public static bool IsSkipMethod(MethodDefinition method)
232 | {
233 | string methodName = method.Name;
234 |
235 | if (string.IsNullOrEmpty(methodName))
236 | {
237 | return true;
238 | }
239 | else if (unityMethodWhiteList.Contains(methodName))
240 | {
241 | return true;
242 | }
243 | else
244 | {
245 | string _namespaceStr = (string.IsNullOrEmpty(method.DeclaringType.Namespace) ? nullChar.ToString() : method.DeclaringType.Namespace);
246 | string _classNameStr = (string.IsNullOrEmpty(method.DeclaringType.Name) ? nullChar.ToString() : method.DeclaringType.Name);
247 |
248 | string str = string.Format("{0}{1}{2}{3}{4}", _namespaceStr, sperateChar, _classNameStr, sperateChar, methodName);
249 |
250 | if (injectMethod.Contains(str))
251 | {
252 | //Debug.Log(str);
253 | return true;
254 | }
255 | }
256 |
257 | return false;
258 | }
259 |
260 | private bool Check(string[] strs, WhiteListType whiteListType)
261 | {
262 | if (!dic.ContainsKey(whiteListType))
263 | return false;
264 |
265 | string temp = string.Empty;
266 | for (int i = 0; i < strs.Length; i++)
267 | {
268 | temp += strs[i];
269 | }
270 |
271 | foreach (var item in dic[whiteListType])
272 | {
273 | string[] whiteList = item.Split(sperateChar);
274 | bool partCheck = true;
275 |
276 |
277 | for (int i = 0; i < whiteList.Length; i++)
278 | {
279 | if (!(whiteList[i] == strs[i] || (whiteList[i] == nullChar.ToString() /*&& i < whiteList.Length - 1*/)))
280 | {
281 | partCheck = false;
282 | break;
283 | }
284 |
285 | //System.Func func = (str) =>
286 | //{
287 | // return (strs[0] == str && str == whiteList[0]);
288 |
289 | //};
290 |
291 |
292 | //if (whiteListType == WhiteListType.Namespace)
293 | //{
294 | // if (func("MalbersAnimations") || func("UnityEngine") || func("Ricimi") || func("XftWeapon"))
295 | // {
296 | // Debug.Log(i + " " + temp + ":" + item + "--------" + strs[i] + ":" + whiteList[i] + " " + partCheck.ToString());
297 | // }
298 | //}
299 | }
300 |
301 | if (partCheck == true)
302 | return true;
303 | }
304 |
305 | return false;
306 | }
307 |
308 | }
309 |
310 | }
311 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Editor/Scripts/WhiteList.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 84f393dc996dea84a97dbe646d379472
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/GarbageCode.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f810b0dd3c3e0d94a8d2eedcc40a1f32
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/GarbageCode/GarbageCode.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/GarbageCode/GarbageCode.dll
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/GarbageCode/GarbageCode.dll.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bb0ce49b7f59a9e48a12fe8fafa14aa6
3 | PluginImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | iconMap: {}
7 | executionOrder: {}
8 | isPreloaded: 0
9 | isOverridable: 0
10 | platformData:
11 | - first:
12 | '': Any
13 | second:
14 | enabled: 0
15 | settings:
16 | Exclude Editor: 0
17 | Exclude Linux: 1
18 | Exclude Linux64: 1
19 | Exclude LinuxUniversal: 1
20 | Exclude OSXUniversal: 1
21 | Exclude Win: 1
22 | Exclude Win64: 1
23 | - first:
24 | Any:
25 | second:
26 | enabled: 0
27 | settings: {}
28 | - first:
29 | Editor: Editor
30 | second:
31 | enabled: 1
32 | settings:
33 | CPU: AnyCPU
34 | DefaultValueInitialized: true
35 | OS: AnyOS
36 | - first:
37 | Facebook: Win
38 | second:
39 | enabled: 0
40 | settings:
41 | CPU: AnyCPU
42 | - first:
43 | Facebook: Win64
44 | second:
45 | enabled: 0
46 | settings:
47 | CPU: AnyCPU
48 | - first:
49 | Standalone: Linux
50 | second:
51 | enabled: 0
52 | settings:
53 | CPU: x86
54 | - first:
55 | Standalone: Linux64
56 | second:
57 | enabled: 0
58 | settings:
59 | CPU: x86_64
60 | - first:
61 | Standalone: LinuxUniversal
62 | second:
63 | enabled: 0
64 | settings:
65 | CPU: None
66 | - first:
67 | Standalone: OSXUniversal
68 | second:
69 | enabled: 0
70 | settings:
71 | CPU: AnyCPU
72 | - first:
73 | Standalone: Win
74 | second:
75 | enabled: 0
76 | settings:
77 | CPU: AnyCPU
78 | - first:
79 | Standalone: Win64
80 | second:
81 | enabled: 0
82 | settings:
83 | CPU: AnyCPU
84 | - first:
85 | Windows Store Apps: WindowsStoreApps
86 | second:
87 | enabled: 0
88 | settings:
89 | CPU: AnyCPU
90 | userData:
91 | assetBundleName:
92 | assetBundleVariant:
93 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Plugins.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d43469b60f5d609489a1b9491b2ffe98
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Plugins/Cecil.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7807258a26d3f9242bcaf844023f847a
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Plugins/Cecil/Mono.Cecil.Mdb.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Plugins/Cecil/Mono.Cecil.Mdb.dll
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Plugins/Cecil/Mono.Cecil.Mdb.dll.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c60a8766e88c7fa4e846f2a7a3934ab9
3 | PluginImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | iconMap: {}
7 | executionOrder: {}
8 | isPreloaded: 0
9 | isOverridable: 0
10 | platformData:
11 | - first:
12 | Any:
13 | second:
14 | enabled: 1
15 | settings: {}
16 | - first:
17 | Editor: Editor
18 | second:
19 | enabled: 0
20 | settings:
21 | DefaultValueInitialized: true
22 | - first:
23 | Windows Store Apps: WindowsStoreApps
24 | second:
25 | enabled: 0
26 | settings:
27 | CPU: AnyCPU
28 | userData:
29 | assetBundleName:
30 | assetBundleVariant:
31 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Plugins/Cecil/Mono.Cecil.Pdb.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Plugins/Cecil/Mono.Cecil.Pdb.dll
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Plugins/Cecil/Mono.Cecil.Pdb.dll.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e14096341ae305d40b554e383ce0475d
3 | PluginImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | iconMap: {}
7 | executionOrder: {}
8 | isPreloaded: 0
9 | isOverridable: 0
10 | platformData:
11 | - first:
12 | Any:
13 | second:
14 | enabled: 1
15 | settings: {}
16 | - first:
17 | Editor: Editor
18 | second:
19 | enabled: 0
20 | settings:
21 | DefaultValueInitialized: true
22 | - first:
23 | Windows Store Apps: WindowsStoreApps
24 | second:
25 | enabled: 0
26 | settings:
27 | CPU: AnyCPU
28 | userData:
29 | assetBundleName:
30 | assetBundleVariant:
31 |
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Plugins/Cecil/Mono.Cecil.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/UnityObfuscator/Plugins/Cecil/Mono.Cecil.dll
--------------------------------------------------------------------------------
/Assets/UnityObfuscator/Plugins/Cecil/Mono.Cecil.dll.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3b3c624e2c1a2904f91f0bb10163f9ef
3 | PluginImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | iconMap: {}
7 | executionOrder: {}
8 | isPreloaded: 0
9 | isOverridable: 0
10 | platformData:
11 | - first:
12 | Any:
13 | second:
14 | enabled: 1
15 | settings: {}
16 | - first:
17 | Editor: Editor
18 | second:
19 | enabled: 0
20 | settings:
21 | DefaultValueInitialized: true
22 | - first:
23 | Windows Store Apps: WindowsStoreApps
24 | second:
25 | enabled: 0
26 | settings:
27 | CPU: AnyCPU
28 | userData:
29 | assetBundleName:
30 | assetBundleVariant:
31 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 780f6c626c5dd614f9b69337f686e5a7
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c2376951b08218f488a2f31016bd37ec
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5285022ac64480448a3bce35ff6d7b42
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations/Enemy1Attack.anim:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Animation/Animations/Enemy1Attack.anim
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations/Enemy1Attack.anim.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d27b42c7b05ae47b8a5357d81d590f01
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations/Enemy1Idle.anim:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Animation/Animations/Enemy1Idle.anim
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations/Enemy1Idle.anim.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5afd3037c1370446fb0a18a403eb806e
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations/Enemy2Attack.anim:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Animation/Animations/Enemy2Attack.anim
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations/Enemy2Attack.anim.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: cfbd97c78ee5a48bfb9c77d2557b4a03
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations/Enemy2Idle.anim:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Animation/Animations/Enemy2Idle.anim
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations/Enemy2Idle.anim.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d5eae0f1926a14fa5ad34bd8f671afb1
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations/PlayerChop.anim:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Animation/Animations/PlayerChop.anim
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations/PlayerChop.anim.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b1e7ecc239aec4292a421108d3884268
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations/PlayerHit.anim:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Animation/Animations/PlayerHit.anim
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations/PlayerHit.anim.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bb6a8b9e76955449ea0a724eb706705d
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations/PlayerIdle.anim:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Animation/Animations/PlayerIdle.anim
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/Animations/PlayerIdle.anim.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9ae8e07f178274cb0bc69285d1aa5ef1
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/AnimatorControllers.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 30f99ba47bf3bb94aab03d6189f3424a
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/AnimatorControllers/Enemy1.controller:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Animation/AnimatorControllers/Enemy1.controller
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/AnimatorControllers/Enemy1.controller.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d2980f4165a534b529ce669cbe3e8246
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/AnimatorControllers/Enemy2.overrideController:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Animation/AnimatorControllers/Enemy2.overrideController
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/AnimatorControllers/Enemy2.overrideController.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 48a3eefec5b8d447a8b8ce0e78f6813c
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/AnimatorControllers/Player.controller:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Animation/AnimatorControllers/Player.controller
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Animation/AnimatorControllers/Player.controller.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ed88edb0ae145440684f0bf998629c0c
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f6dcf88a90e2baa469935f07cb420796
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Enemy1.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Enemy1.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Enemy1.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ebfba08a213d34c46ba2b1947aeaea83
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Enemy2.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Enemy2.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Enemy2.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 089a2f2c322ea40f9afdfaba0550c6d3
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Exit.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Exit.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Exit.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: cb0f3020bafec423aa31d0e491c4b811
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor1.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Floor1.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor1.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 038998774947c4a8fa170d5b4492a7dd
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor2.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Floor2.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor2.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 41775b29042354678bcd58bb1a75871e
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor3.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Floor3.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor3.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 74398dca0c1f64f34aab8ba7bdb6c527
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor4.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Floor4.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor4.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ed4c829589732490894350b134530050
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor5.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Floor5.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor5.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 04993e7a7b0514f0c8857ff106529ce1
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor6.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Floor6.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor6.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4cdf8ac85eff446d0a8fefbdc8c6569f
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor7.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Floor7.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor7.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5535fd6cd705e4a79a1d5a4f114de5dc
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor8.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Floor8.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Floor8.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c18e9692903814865aa9a855aaa66df5
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Food.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Food.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Food.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ad25a4e752915438e9f55a35bedacf1f
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/GameManager.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/GameManager.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/GameManager.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1ca8c6e960c494bbd937610290f80d1b
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/OuterWall1.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/OuterWall1.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/OuterWall1.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7094f72151ec74f569c4e03f1ec0f8e7
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/OuterWall2.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/OuterWall2.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/OuterWall2.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b0ace21a29149403094422fb3bd96aa9
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/OuterWall3.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/OuterWall3.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/OuterWall3.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e85c94355cc4641da919bd5d0ac956d4
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Player.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Player.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Player.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 28b53fc28d3a140c392f0e2d919f9de1
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Soda.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Soda.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Soda.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 46e8bf4bf645a47e3ae1b60c7e18418c
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/SoundManager.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/SoundManager.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/SoundManager.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 76cd81135280f4ad6a4fa80f6422aea2
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall1.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Wall1.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall1.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2570048905bd94d6f8a99d13b80daf90
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall2.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Wall2.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall2.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b86334000bc0f47ba8dd33ea88cfcdb1
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall3.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Wall3.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall3.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 01ca47a83ebe24ca5a2f6b1d6dcd7481
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall4.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Wall4.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall4.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 022eda2f1f0cb45e28ff6840b68928bc
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall5.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Wall5.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall5.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e1816487b15cd4c5fbd9587521e068ca
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall6.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Wall6.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall6.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5ddc2d7828b2d462286f09274199ad9a
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall7.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Wall7.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall7.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 64139c47b57e34c5fa97fd79f8d25244
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall8.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Prefabs/Wall8.prefab
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Prefabs/Wall8.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 741804431f4d341cdae1f15b3896aeff
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scenes.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 18997434e70246c4dbf989a2c32d3d8e
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scenes/Main.unity:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/Scenes/Main.unity
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scenes/Main.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 329f4be6b831e43008ec1ddeaae85de9
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fa4343c93a93cd7469cd8ba8d4ec9c0d
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/Base.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 770bc4acdfaf8584890cec3ca25472fc
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/Base/Base.asmdef:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Base"
3 | }
4 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/Base/Base.asmdef.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 53f54e713e549524d8d934618da1ede5
3 | AssemblyDefinitionImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/Base/BoardManager.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System;
3 | using System.Collections.Generic; //Allows us to use Lists.
4 | using Random = UnityEngine.Random; //Tells Random to use the Unity Engine random number generator.
5 |
6 | namespace Completed
7 |
8 | {
9 |
10 | public class BoardManager : MonoBehaviour
11 | {
12 | // Using Serializable allows us to embed a class with sub properties in the inspector.
13 | [Serializable]
14 | public class Count
15 | {
16 | public int minimum; //Minimum value for our Count class.
17 | public int maximum; //Maximum value for our Count class.
18 |
19 |
20 | //Assignment constructor.
21 | public Count (int min, int max)
22 | {
23 | minimum = min;
24 | maximum = max;
25 | }
26 | }
27 |
28 |
29 | public int columns = 8; //Number of columns in our game board.
30 | public int rows = 8; //Number of rows in our game board.
31 | public Count wallCount = new Count (5, 9); //Lower and upper limit for our random number of walls per level.
32 | public Count foodCount = new Count (1, 5); //Lower and upper limit for our random number of food items per level.
33 | public GameObject exit; //Prefab to spawn for exit.
34 | public GameObject[] floorTiles; //Array of floor prefabs.
35 | public GameObject[] wallTiles; //Array of wall prefabs.
36 | public GameObject[] foodTiles; //Array of food prefabs.
37 | public GameObject[] enemyTiles; //Array of enemy prefabs.
38 | public GameObject[] outerWallTiles; //Array of outer tile prefabs.
39 |
40 | private Transform boardHolder; //A variable to store a reference to the transform of our Board object.
41 | private List gridPositions = new List (); //A list of possible locations to place tiles.
42 |
43 |
44 | //Clears our list gridPositions and prepares it to generate a new board.
45 | void InitialiseList ()
46 | {
47 | //Clear our list gridPositions.
48 | gridPositions.Clear ();
49 |
50 | //Loop through x axis (columns).
51 | for(int x = 1; x < columns-1; x++)
52 | {
53 | //Within each column, loop through y axis (rows).
54 | for(int y = 1; y < rows-1; y++)
55 | {
56 | //At each index add a new Vector3 to our list with the x and y coordinates of that position.
57 | gridPositions.Add (new Vector3(x, y, 0f));
58 | }
59 | }
60 | }
61 |
62 |
63 | //Sets up the outer walls and floor (background) of the game board.
64 | void BoardSetup ()
65 | {
66 | //Instantiate Board and set boardHolder to its transform.
67 | boardHolder = new GameObject ("Board").transform;
68 |
69 | //Loop along x axis, starting from -1 (to fill corner) with floor or outerwall edge tiles.
70 | for(int x = -1; x < columns + 1; x++)
71 | {
72 | //Loop along y axis, starting from -1 to place floor or outerwall tiles.
73 | for(int y = -1; y < rows + 1; y++)
74 | {
75 | //Choose a random tile from our array of floor tile prefabs and prepare to instantiate it.
76 | GameObject toInstantiate = floorTiles[Random.Range (0,floorTiles.Length)];
77 |
78 | //Check if we current position is at board edge, if so choose a random outer wall prefab from our array of outer wall tiles.
79 | if(x == -1 || x == columns || y == -1 || y == rows)
80 | toInstantiate = outerWallTiles [Random.Range (0, outerWallTiles.Length)];
81 |
82 | //Instantiate the GameObject instance using the prefab chosen for toInstantiate at the Vector3 corresponding to current grid position in loop, cast it to GameObject.
83 | GameObject instance =
84 | Instantiate (toInstantiate, new Vector3 (x, y, 0f), Quaternion.identity) as GameObject;
85 |
86 | //Set the parent of our newly instantiated object instance to boardHolder, this is just organizational to avoid cluttering hierarchy.
87 | instance.transform.SetParent (boardHolder);
88 | }
89 | }
90 | }
91 |
92 |
93 | //RandomPosition returns a random position from our list gridPositions.
94 | Vector3 RandomPosition ()
95 | {
96 | //Declare an integer randomIndex, set it's value to a random number between 0 and the count of items in our List gridPositions.
97 | int randomIndex = Random.Range (0, gridPositions.Count);
98 |
99 | //Declare a variable of type Vector3 called randomPosition, set it's value to the entry at randomIndex from our List gridPositions.
100 | Vector3 randomPosition = gridPositions[randomIndex];
101 |
102 | //Remove the entry at randomIndex from the list so that it can't be re-used.
103 | gridPositions.RemoveAt (randomIndex);
104 |
105 | //Return the randomly selected Vector3 position.
106 | return randomPosition;
107 | }
108 |
109 |
110 | //LayoutObjectAtRandom accepts an array of game objects to choose from along with a minimum and maximum range for the number of objects to create.
111 | void LayoutObjectAtRandom (GameObject[] tileArray, int minimum, int maximum)
112 | {
113 | //Choose a random number of objects to instantiate within the minimum and maximum limits
114 | int objectCount = Random.Range (minimum, maximum+1);
115 |
116 | //Instantiate objects until the randomly chosen limit objectCount is reached
117 | for(int i = 0; i < objectCount; i++)
118 | {
119 | //Choose a position for randomPosition by getting a random position from our list of available Vector3s stored in gridPosition
120 | Vector3 randomPosition = RandomPosition();
121 |
122 | //Choose a random tile from tileArray and assign it to tileChoice
123 | GameObject tileChoice = tileArray[Random.Range (0, tileArray.Length)];
124 |
125 | //Instantiate tileChoice at the position returned by RandomPosition with no change in rotation
126 | Instantiate(tileChoice, randomPosition, Quaternion.identity);
127 | }
128 | }
129 |
130 |
131 | //SetupScene initializes our level and calls the previous functions to lay out the game board
132 | public void SetupScene (int level)
133 | {
134 | //Creates the outer walls and floor.
135 | BoardSetup ();
136 |
137 | //Reset our list of gridpositions.
138 | InitialiseList ();
139 |
140 | //Instantiate a random number of wall tiles based on minimum and maximum, at randomized positions.
141 | LayoutObjectAtRandom (wallTiles, wallCount.minimum, wallCount.maximum);
142 |
143 | //Instantiate a random number of food tiles based on minimum and maximum, at randomized positions.
144 | LayoutObjectAtRandom (foodTiles, foodCount.minimum, foodCount.maximum);
145 |
146 | //Determine number of enemies based on current level number, based on a logarithmic progression
147 | int enemyCount = (int)Mathf.Log(level, 2f);
148 |
149 | //Instantiate a random number of enemies based on minimum and maximum, at randomized positions.
150 | LayoutObjectAtRandom (enemyTiles, enemyCount, enemyCount);
151 |
152 | //Instantiate the exit tile in the upper right hand corner of our game board
153 | Instantiate (exit, new Vector3 (columns - 1, rows - 1, 0f), Quaternion.identity);
154 | }
155 | }
156 | }
157 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/Base/BoardManager.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fff182172d726402b9e9eacdb89c9724
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/Enemy.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 |
4 | namespace Completed
5 | {
6 | //Enemy inherits from MovingObject, our base class for objects that can move, Player also inherits from this.
7 | public class Enemy : MovingObject
8 | {
9 | public int playerDamage; //The amount of food points to subtract from the player when attacking.
10 | public AudioClip attackSound1; //First of two audio clips to play when attacking the player.
11 | public AudioClip attackSound2; //Second of two audio clips to play when attacking the player.
12 |
13 |
14 | private Animator animator; //Variable of type Animator to store a reference to the enemy's Animator component.
15 | private Transform target; //Transform to attempt to move toward each turn.
16 | private bool skipMove; //Boolean to determine whether or not enemy should skip a turn or move this turn.
17 |
18 |
19 | //Start overrides the virtual Start function of the base class.
20 | protected override void Start ()
21 | {
22 | //Register this enemy with our instance of GameManager by adding it to a list of Enemy objects.
23 | //This allows the GameManager to issue movement commands.
24 | GameManager.instance.AddEnemyToList (this);
25 |
26 | //Get and store a reference to the attached Animator component.
27 | animator = GetComponent ();
28 |
29 | //Find the Player GameObject using it's tag and store a reference to its transform component.
30 | target = GameObject.FindGameObjectWithTag ("Player").transform;
31 |
32 | //Call the start function of our base class MovingObject.
33 | base.Start ();
34 | }
35 |
36 |
37 | //Override the AttemptMove function of MovingObject to include functionality needed for Enemy to skip turns.
38 | //See comments in MovingObject for more on how base AttemptMove function works.
39 | protected override void AttemptMove (int xDir, int yDir)
40 | {
41 | //Check if skipMove is true, if so set it to false and skip this turn.
42 | if(skipMove)
43 | {
44 | skipMove = false;
45 | return;
46 |
47 | }
48 |
49 | //Call the AttemptMove function from MovingObject.
50 | base.AttemptMove (xDir, yDir);
51 |
52 | //Now that Enemy has moved, set skipMove to true to skip next move.
53 | skipMove = true;
54 | }
55 |
56 |
57 | //MoveEnemy is called by the GameManger each turn to tell each Enemy to try to move towards the player.
58 | public void MoveEnemy ()
59 | {
60 | //Declare variables for X and Y axis move directions, these range from -1 to 1.
61 | //These values allow us to choose between the cardinal directions: up, down, left and right.
62 | int xDir = 0;
63 | int yDir = 0;
64 |
65 | //If the difference in positions is approximately zero (Epsilon) do the following:
66 | if(Mathf.Abs (target.position.x - transform.position.x) < float.Epsilon)
67 |
68 | //If the y coordinate of the target's (player) position is greater than the y coordinate of this enemy's position set y direction 1 (to move up). If not, set it to -1 (to move down).
69 | yDir = target.position.y > transform.position.y ? 1 : -1;
70 |
71 | //If the difference in positions is not approximately zero (Epsilon) do the following:
72 | else
73 | //Check if target x position is greater than enemy's x position, if so set x direction to 1 (move right), if not set to -1 (move left).
74 | xDir = target.position.x > transform.position.x ? 1 : -1;
75 |
76 | //Call the AttemptMove function and pass in the generic parameter Player, because Enemy is moving and expecting to potentially encounter a Player
77 | AttemptMove (xDir, yDir);
78 | }
79 |
80 |
81 | //OnCantMove is called if Enemy attempts to move into a space occupied by a Player, it overrides the OnCantMove function of MovingObject
82 | //and takes a generic parameter T which we use to pass in the component we expect to encounter, in this case Player
83 | protected override void OnCantMove (T component)
84 | {
85 | //Declare hitPlayer and set it to equal the encountered component.
86 | Player hitPlayer = component as Player;
87 |
88 | //Call the LoseFood function of hitPlayer passing it playerDamage, the amount of foodpoints to be subtracted.
89 | hitPlayer.LoseFood (playerDamage);
90 |
91 | //Set the attack trigger of animator to trigger Enemy attack animation.
92 | animator.SetTrigger ("enemyAttack");
93 |
94 | //Call the RandomizeSfx function of SoundManager passing in the two audio clips to choose randomly between.
95 | SoundManager.instance.RandomizeSfx (attackSound1, attackSound2);
96 | }
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/Enemy.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d22f79ef0655a41bb9e62823f6e7a3f1
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/GameManager.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.SceneManagement;
3 | using System.Collections;
4 |
5 | namespace Completed
6 | {
7 | using System.Collections.Generic; //Allows us to use Lists.
8 | using UnityEngine.UI; //Allows us to use UI.
9 |
10 | public class GameManager : MonoBehaviour
11 | {
12 | public float levelStartDelay = 2f; //Time to wait before starting level, in seconds.
13 | public float turnDelay = 0.1f; //Delay between each Player turn.
14 | public int playerFoodPoints = 100; //Starting value for Player food points.
15 | public static GameManager instance = null; //Static instance of GameManager which allows it to be accessed by any other script.
16 | [HideInInspector] public bool playersTurn = true; //Boolean to check if it's players turn, hidden in inspector but public.
17 |
18 |
19 | private Text levelText; //Text to display current level number.
20 | private GameObject levelImage; //Image to block out level as levels are being set up, background for levelText.
21 | private BoardManager boardScript; //Store a reference to our BoardManager which will set up the level.
22 | private int level = 1; //Current level number, expressed in game as "Day 1".
23 | private List enemies; //List of all Enemy units, used to issue them move commands.
24 | private bool enemiesMoving; //Boolean to check if enemies are moving.
25 | private bool doingSetup = true; //Boolean to check if we're setting up board, prevent Player from moving during setup.
26 |
27 |
28 |
29 | //Awake is always called before any Start functions
30 | void Awake()
31 | {
32 | //Check if instance already exists
33 | if (instance == null)
34 |
35 | //if not, set instance to this
36 | instance = this;
37 |
38 | //If instance already exists and it's not this:
39 | else if (instance != this)
40 |
41 | //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
42 | Destroy(gameObject);
43 |
44 | //Sets this to not be destroyed when reloading scene
45 | DontDestroyOnLoad(gameObject);
46 |
47 | //Assign enemies to a new List of Enemy objects.
48 | enemies = new List();
49 |
50 | //Get a component reference to the attached BoardManager script
51 | boardScript = GetComponent();
52 |
53 | //Call the InitGame function to initialize the first level
54 | InitGame();
55 | }
56 |
57 | //this is called only once, and the paramter tell it to be called only after the scene was loaded
58 | //(otherwise, our Scene Load callback would be called the very first load, and we don't want that)
59 | [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
60 | static public void CallbackInitialization()
61 | {
62 | //register the callback to be called everytime the scene is loaded
63 | SceneManager.sceneLoaded += OnSceneLoaded;
64 | }
65 |
66 | //This is called each time a scene is loaded.
67 | static private void OnSceneLoaded(Scene arg0, LoadSceneMode arg1)
68 | {
69 | instance.level++;
70 | instance.InitGame();
71 | }
72 |
73 |
74 | //Initializes the game for each level.
75 | void InitGame()
76 | {
77 | //While doingSetup is true the player can't move, prevent player from moving while title card is up.
78 | doingSetup = true;
79 |
80 | //Get a reference to our image LevelImage by finding it by name.
81 | levelImage = GameObject.Find("LevelImage");
82 |
83 | //Get a reference to our text LevelText's text component by finding it by name and calling GetComponent.
84 | levelText = GameObject.Find("LevelText").GetComponent();
85 |
86 | //Set the text of levelText to the string "Day" and append the current level number.
87 | levelText.text = "Day " + level;
88 |
89 | //Set levelImage to active blocking player's view of the game board during setup.
90 | levelImage.SetActive(true);
91 |
92 | //Call the HideLevelImage function with a delay in seconds of levelStartDelay.
93 | Invoke("HideLevelImage", levelStartDelay);
94 |
95 | //Clear any Enemy objects in our List to prepare for next level.
96 | enemies.Clear();
97 |
98 | //Call the SetupScene function of the BoardManager script, pass it current level number.
99 | boardScript.SetupScene(level);
100 |
101 | }
102 |
103 |
104 | //Hides black image used between levels
105 | void HideLevelImage()
106 | {
107 | //Disable the levelImage gameObject.
108 | levelImage.SetActive(false);
109 |
110 | //Set doingSetup to false allowing player to move again.
111 | doingSetup = false;
112 | }
113 |
114 | //Update is called every frame.
115 | void Update()
116 | {
117 | //Check that playersTurn or enemiesMoving or doingSetup are not currently true.
118 | if(playersTurn || enemiesMoving || doingSetup)
119 |
120 | //If any of these are true, return and do not start MoveEnemies.
121 | return;
122 |
123 | //Start moving enemies.
124 | StartCoroutine (MoveEnemies ());
125 | }
126 |
127 | //Call this to add the passed in Enemy to the List of Enemy objects.
128 | public void AddEnemyToList(Enemy script)
129 | {
130 | //Add Enemy to List enemies.
131 | enemies.Add(script);
132 | }
133 |
134 |
135 | //GameOver is called when the player reaches 0 food points
136 | public void GameOver()
137 | {
138 | //Set levelText to display number of levels passed and game over message
139 | levelText.text = "After " + level + " days, you starved.";
140 |
141 | //Enable black background image gameObject.
142 | levelImage.SetActive(true);
143 |
144 | //Disable this GameManager.
145 | enabled = false;
146 | }
147 |
148 | //Coroutine to move enemies in sequence.
149 | IEnumerator MoveEnemies()
150 | {
151 | //While enemiesMoving is true player is unable to move.
152 | enemiesMoving = true;
153 |
154 | //Wait for turnDelay seconds, defaults to .1 (100 ms).
155 | yield return new WaitForSeconds(turnDelay);
156 |
157 | //If there are no enemies spawned (IE in first level):
158 | if (enemies.Count == 0)
159 | {
160 | //Wait for turnDelay seconds between moves, replaces delay caused by enemies moving when there are none.
161 | yield return new WaitForSeconds(turnDelay);
162 | }
163 |
164 | //Loop through List of Enemy objects.
165 | for (int i = 0; i < enemies.Count; i++)
166 | {
167 | //Call the MoveEnemy function of Enemy at index i in the enemies List.
168 | enemies[i].MoveEnemy ();
169 |
170 | //Wait for Enemy's moveTime before moving next Enemy,
171 | yield return new WaitForSeconds(enemies[i].moveTime);
172 | }
173 | //Once Enemies are done moving, set playersTurn to true so player can move.
174 | playersTurn = true;
175 |
176 | //Enemies are done moving, set enemiesMoving to false.
177 | enemiesMoving = false;
178 | }
179 | }
180 | }
181 |
182 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/GameManager.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a7d59e4dfb9c9404b9471de0c983feac
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/Loader.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 |
4 | namespace Completed
5 | {
6 | public class Loader : MonoBehaviour
7 | {
8 | public GameObject gameManager; //GameManager prefab to instantiate.
9 | public GameObject soundManager; //SoundManager prefab to instantiate.
10 |
11 |
12 | void Awake ()
13 | {
14 | //Check if a GameManager has already been assigned to static variable GameManager.instance or if it's still null
15 | if (GameManager.instance == null)
16 |
17 | //Instantiate gameManager prefab
18 | Instantiate(gameManager);
19 |
20 | //Check if a SoundManager has already been assigned to static variable GameManager.instance or if it's still null
21 | if (SoundManager.instance == null)
22 |
23 | //Instantiate SoundManager prefab
24 | Instantiate(soundManager);
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/Loader.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c23d8039e659d46a7b71f4f3c0b02486
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/MovingObject.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 |
4 | namespace Completed
5 | {
6 | //The abstract keyword enables you to create classes and class members that are incomplete and must be implemented in a derived class.
7 | public abstract class MovingObject : MonoBehaviour
8 | {
9 | public float moveTime = 0.1f; //Time it will take object to move, in seconds.
10 | public LayerMask blockingLayer; //Layer on which collision will be checked.
11 |
12 |
13 | private BoxCollider2D boxCollider; //The BoxCollider2D component attached to this object.
14 | private Rigidbody2D rb2D; //The Rigidbody2D component attached to this object.
15 | private float inverseMoveTime; //Used to make movement more efficient.
16 |
17 |
18 | //Protected, virtual functions can be overridden by inheriting classes.
19 | protected virtual void Start ()
20 | {
21 | //Get a component reference to this object's BoxCollider2D
22 | boxCollider = GetComponent ();
23 |
24 | //Get a component reference to this object's Rigidbody2D
25 | rb2D = GetComponent ();
26 |
27 | //By storing the reciprocal of the move time we can use it by multiplying instead of dividing, this is more efficient.
28 | inverseMoveTime = 1f / moveTime;
29 | }
30 |
31 |
32 | //Move returns true if it is able to move and false if not.
33 | //Move takes parameters for x direction, y direction and a RaycastHit2D to check collision.
34 | protected bool Move (int xDir, int yDir, out RaycastHit2D hit)
35 | {
36 | //Store start position to move from, based on objects current transform position.
37 | Vector2 start = transform.position;
38 |
39 | // Calculate end position based on the direction parameters passed in when calling Move.
40 | Vector2 end = start + new Vector2 (xDir, yDir);
41 |
42 | //Disable the boxCollider so that linecast doesn't hit this object's own collider.
43 | boxCollider.enabled = false;
44 |
45 | //Cast a line from start point to end point checking collision on blockingLayer.
46 | hit = Physics2D.Linecast (start, end, blockingLayer);
47 |
48 | //Re-enable boxCollider after linecast
49 | boxCollider.enabled = true;
50 |
51 | //Check if anything was hit
52 | if(hit.transform == null)
53 | {
54 | //If nothing was hit, start SmoothMovement co-routine passing in the Vector2 end as destination
55 | StartCoroutine (SmoothMovement (end));
56 |
57 | //Return true to say that Move was successful
58 | return true;
59 | }
60 |
61 | //If something was hit, return false, Move was unsuccesful.
62 | return false;
63 | }
64 |
65 |
66 | //Co-routine for moving units from one space to next, takes a parameter end to specify where to move to.
67 | protected IEnumerator SmoothMovement (Vector3 end)
68 | {
69 | //Calculate the remaining distance to move based on the square magnitude of the difference between current position and end parameter.
70 | //Square magnitude is used instead of magnitude because it's computationally cheaper.
71 | float sqrRemainingDistance = (transform.position - end).sqrMagnitude;
72 |
73 | //While that distance is greater than a very small amount (Epsilon, almost zero):
74 | while(sqrRemainingDistance > float.Epsilon)
75 | {
76 | //Find a new position proportionally closer to the end, based on the moveTime
77 | Vector3 newPostion = Vector3.MoveTowards(rb2D.position, end, inverseMoveTime * Time.deltaTime);
78 |
79 | //Call MovePosition on attached Rigidbody2D and move it to the calculated position.
80 | rb2D.MovePosition (newPostion);
81 |
82 | //Recalculate the remaining distance after moving.
83 | sqrRemainingDistance = (transform.position - end).sqrMagnitude;
84 |
85 | //Return and loop until sqrRemainingDistance is close enough to zero to end the function
86 | yield return null;
87 | }
88 | }
89 |
90 |
91 | //The virtual keyword means AttemptMove can be overridden by inheriting classes using the override keyword.
92 | //AttemptMove takes a generic parameter T to specify the type of component we expect our unit to interact with if blocked (Player for Enemies, Wall for Player).
93 | protected virtual void AttemptMove (int xDir, int yDir)
94 | where T : Component
95 | {
96 | //Hit will store whatever our linecast hits when Move is called.
97 | RaycastHit2D hit;
98 |
99 | //Set canMove to true if Move was successful, false if failed.
100 | bool canMove = Move (xDir, yDir, out hit);
101 |
102 | //Check if nothing was hit by linecast
103 | if(hit.transform == null)
104 | //If nothing was hit, return and don't execute further code.
105 | return;
106 |
107 | //Get a component reference to the component of type T attached to the object that was hit
108 | T hitComponent = hit.transform.GetComponent ();
109 |
110 | //If canMove is false and hitComponent is not equal to null, meaning MovingObject is blocked and has hit something it can interact with.
111 | if(!canMove && hitComponent != null)
112 |
113 | //Call the OnCantMove function and pass it hitComponent as a parameter.
114 | OnCantMove (hitComponent);
115 | }
116 |
117 |
118 | //The abstract modifier indicates that the thing being modified has a missing or incomplete implementation.
119 | //OnCantMove will be overriden by functions in the inheriting classes.
120 | protected abstract void OnCantMove (T component)
121 | where T : Component;
122 | }
123 | }
124 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/MovingObject.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 29a09f5f5da1e4687902e8b80de57300
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/Player.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 | using UnityEngine.UI; //Allows us to use UI.
4 | using UnityEngine.SceneManagement;
5 |
6 | namespace Completed
7 | {
8 | //Player inherits from MovingObject, our base class for objects that can move, Enemy also inherits from this.
9 | public class Player : MovingObject
10 | {
11 | public float restartLevelDelay = 1f; //Delay time in seconds to restart level.
12 | public int pointsPerFood = 10; //Number of points to add to player food points when picking up a food object.
13 | public int pointsPerSoda = 20; //Number of points to add to player food points when picking up a soda object.
14 | public int wallDamage = 1; //How much damage a player does to a wall when chopping it.
15 | public Text foodText; //UI Text to display current player food total.
16 | public AudioClip moveSound1; //1 of 2 Audio clips to play when player moves.
17 | public AudioClip moveSound2; //2 of 2 Audio clips to play when player moves.
18 | public AudioClip eatSound1; //1 of 2 Audio clips to play when player collects a food object.
19 | public AudioClip eatSound2; //2 of 2 Audio clips to play when player collects a food object.
20 | public AudioClip drinkSound1; //1 of 2 Audio clips to play when player collects a soda object.
21 | public AudioClip drinkSound2; //2 of 2 Audio clips to play when player collects a soda object.
22 | public AudioClip gameOverSound; //Audio clip to play when player dies.
23 |
24 | private Animator animator; //Used to store a reference to the Player's animator component.
25 | private int food; //Used to store player food points total during level.
26 | #if UNITY_IOS || UNITY_ANDROID || UNITY_WP8 || UNITY_IPHONE
27 | private Vector2 touchOrigin = -Vector2.one; //Used to store location of screen touch origin for mobile controls.
28 | #endif
29 |
30 |
31 | //Start overrides the Start function of MovingObject
32 | protected override void Start ()
33 | {
34 | //Get a component reference to the Player's animator component
35 | animator = GetComponent();
36 |
37 | //Get the current food point total stored in GameManager.instance between levels.
38 | food = GameManager.instance.playerFoodPoints;
39 |
40 | //Set the foodText to reflect the current player food total.
41 | foodText.text = "Food: " + food;
42 |
43 | //Call the Start function of the MovingObject base class.
44 | base.Start ();
45 | }
46 |
47 |
48 | //This function is called when the behaviour becomes disabled or inactive.
49 | private void OnDisable ()
50 | {
51 | //When Player object is disabled, store the current local food total in the GameManager so it can be re-loaded in next level.
52 | GameManager.instance.playerFoodPoints = food;
53 | }
54 |
55 |
56 | private void Update ()
57 | {
58 | //If it's not the player's turn, exit the function.
59 | if(!GameManager.instance.playersTurn) return;
60 |
61 | int horizontal = 0; //Used to store the horizontal move direction.
62 | int vertical = 0; //Used to store the vertical move direction.
63 |
64 | //Check if we are running either in the Unity editor or in a standalone build.
65 | #if UNITY_STANDALONE || UNITY_WEBPLAYER
66 |
67 | //Get input from the input manager, round it to an integer and store in horizontal to set x axis move direction
68 | horizontal = (int) (Input.GetAxisRaw ("Horizontal"));
69 |
70 | //Get input from the input manager, round it to an integer and store in vertical to set y axis move direction
71 | vertical = (int) (Input.GetAxisRaw ("Vertical"));
72 |
73 | //Check if moving horizontally, if so set vertical to zero.
74 | if(horizontal != 0)
75 | {
76 | vertical = 0;
77 | }
78 | //Check if we are running on iOS, Android, Windows Phone 8 or Unity iPhone
79 | #elif UNITY_IOS || UNITY_ANDROID || UNITY_WP8 || UNITY_IPHONE
80 |
81 | //Check if Input has registered more than zero touches
82 | if (Input.touchCount > 0)
83 | {
84 | //Store the first touch detected.
85 | Touch myTouch = Input.touches[0];
86 |
87 | //Check if the phase of that touch equals Began
88 | if (myTouch.phase == TouchPhase.Began)
89 | {
90 | //If so, set touchOrigin to the position of that touch
91 | touchOrigin = myTouch.position;
92 | }
93 |
94 | //If the touch phase is not Began, and instead is equal to Ended and the x of touchOrigin is greater or equal to zero:
95 | else if (myTouch.phase == TouchPhase.Ended && touchOrigin.x >= 0)
96 | {
97 | //Set touchEnd to equal the position of this touch
98 | Vector2 touchEnd = myTouch.position;
99 |
100 | //Calculate the difference between the beginning and end of the touch on the x axis.
101 | float x = touchEnd.x - touchOrigin.x;
102 |
103 | //Calculate the difference between the beginning and end of the touch on the y axis.
104 | float y = touchEnd.y - touchOrigin.y;
105 |
106 | //Set touchOrigin.x to -1 so that our else if statement will evaluate false and not repeat immediately.
107 | touchOrigin.x = -1;
108 |
109 | //Check if the difference along the x axis is greater than the difference along the y axis.
110 | if (Mathf.Abs(x) > Mathf.Abs(y))
111 | //If x is greater than zero, set horizontal to 1, otherwise set it to -1
112 | horizontal = x > 0 ? 1 : -1;
113 | else
114 | //If y is greater than zero, set horizontal to 1, otherwise set it to -1
115 | vertical = y > 0 ? 1 : -1;
116 | }
117 | }
118 |
119 | #endif //End of mobile platform dependendent compilation section started above with #elif
120 | //Check if we have a non-zero value for horizontal or vertical
121 | if(horizontal != 0 || vertical != 0)
122 | {
123 | //Call AttemptMove passing in the generic parameter Wall, since that is what Player may interact with if they encounter one (by attacking it)
124 | //Pass in horizontal and vertical as parameters to specify the direction to move Player in.
125 | AttemptMove (horizontal, vertical);
126 | }
127 | }
128 |
129 | //AttemptMove overrides the AttemptMove function in the base class MovingObject
130 | //AttemptMove takes a generic parameter T which for Player will be of the type Wall, it also takes integers for x and y direction to move in.
131 | protected override void AttemptMove (int xDir, int yDir)
132 | {
133 | //Every time player moves, subtract from food points total.
134 | food--;
135 |
136 | //Update food text display to reflect current score.
137 | foodText.text = "Food: " + food;
138 |
139 | //Call the AttemptMove method of the base class, passing in the component T (in this case Wall) and x and y direction to move.
140 | base.AttemptMove (xDir, yDir);
141 |
142 | //Hit allows us to reference the result of the Linecast done in Move.
143 | RaycastHit2D hit;
144 |
145 | //If Move returns true, meaning Player was able to move into an empty space.
146 | if (Move (xDir, yDir, out hit))
147 | {
148 | //Call RandomizeSfx of SoundManager to play the move sound, passing in two audio clips to choose from.
149 | SoundManager.instance.RandomizeSfx (moveSound1, moveSound2);
150 | }
151 |
152 | //Since the player has moved and lost food points, check if the game has ended.
153 | CheckIfGameOver ();
154 |
155 | //Set the playersTurn boolean of GameManager to false now that players turn is over.
156 | GameManager.instance.playersTurn = false;
157 | }
158 |
159 |
160 | //OnCantMove overrides the abstract function OnCantMove in MovingObject.
161 | //It takes a generic parameter T which in the case of Player is a Wall which the player can attack and destroy.
162 | protected override void OnCantMove (T component)
163 | {
164 | //Set hitWall to equal the component passed in as a parameter.
165 | Wall hitWall = component as Wall;
166 |
167 | //Call the DamageWall function of the Wall we are hitting.
168 | hitWall.DamageWall (wallDamage);
169 |
170 | //Set the attack trigger of the player's animation controller in order to play the player's attack animation.
171 | animator.SetTrigger ("playerChop");
172 | }
173 |
174 |
175 | //OnTriggerEnter2D is sent when another object enters a trigger collider attached to this object (2D physics only).
176 | private void OnTriggerEnter2D (Collider2D other)
177 | {
178 | //Check if the tag of the trigger collided with is Exit.
179 | if(other.tag == "Exit")
180 | {
181 | //Invoke the Restart function to start the next level with a delay of restartLevelDelay (default 1 second).
182 | Invoke ("Restart", restartLevelDelay);
183 |
184 | //Disable the player object since level is over.
185 | enabled = false;
186 | }
187 |
188 | //Check if the tag of the trigger collided with is Food.
189 | else if(other.tag == "Food")
190 | {
191 | //Add pointsPerFood to the players current food total.
192 | food += pointsPerFood;
193 |
194 | //Update foodText to represent current total and notify player that they gained points
195 | foodText.text = "+" + pointsPerFood + " Food: " + food;
196 |
197 | //Call the RandomizeSfx function of SoundManager and pass in two eating sounds to choose between to play the eating sound effect.
198 | SoundManager.instance.RandomizeSfx (eatSound1, eatSound2);
199 |
200 | //Disable the food object the player collided with.
201 | other.gameObject.SetActive (false);
202 | }
203 |
204 | //Check if the tag of the trigger collided with is Soda.
205 | else if(other.tag == "Soda")
206 | {
207 | //Add pointsPerSoda to players food points total
208 | food += pointsPerSoda;
209 |
210 | //Update foodText to represent current total and notify player that they gained points
211 | foodText.text = "+" + pointsPerSoda + " Food: " + food;
212 |
213 | //Call the RandomizeSfx function of SoundManager and pass in two drinking sounds to choose between to play the drinking sound effect.
214 | SoundManager.instance.RandomizeSfx (drinkSound1, drinkSound2);
215 |
216 | //Disable the soda object the player collided with.
217 | other.gameObject.SetActive (false);
218 | }
219 | }
220 |
221 |
222 | //Restart reloads the scene when called.
223 | private void Restart ()
224 | {
225 | //Load the last scene loaded, in this case Main, the only scene in the game. And we load it in "Single" mode so it replace the existing one
226 | //and not load all the scene object in the current scene.
227 | SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex, LoadSceneMode.Single);
228 | }
229 |
230 |
231 | //LoseFood is called when an enemy attacks the player.
232 | //It takes a parameter loss which specifies how many points to lose.
233 | public void LoseFood (int loss)
234 | {
235 | //Set the trigger for the player animator to transition to the playerHit animation.
236 | animator.SetTrigger ("playerHit");
237 |
238 | //Subtract lost food points from the players total.
239 | food -= loss;
240 |
241 | //Update the food display with the new total.
242 | foodText.text = "-"+ loss + " Food: " + food;
243 |
244 | //Check to see if game has ended.
245 | CheckIfGameOver ();
246 | }
247 |
248 |
249 | //CheckIfGameOver checks if the player is out of food points and if so, ends the game.
250 | private void CheckIfGameOver ()
251 | {
252 | //Check if food point total is less than or equal to zero.
253 | if (food <= 0)
254 | {
255 | //Call the PlaySingle function of SoundManager and pass it the gameOverSound as the audio clip to play.
256 | SoundManager.instance.PlaySingle (gameOverSound);
257 |
258 | //Stop the background music.
259 | SoundManager.instance.musicSource.Stop();
260 |
261 | //Call the GameOver function of GameManager.
262 | GameManager.instance.GameOver ();
263 | }
264 | }
265 | }
266 | }
267 |
268 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/Player.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 16e3f930239ae4562865b7c0918b8677
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/SoundManager.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 |
4 | namespace Completed
5 | {
6 | public class SoundManager : MonoBehaviour
7 | {
8 | public AudioSource efxSource; //Drag a reference to the audio source which will play the sound effects.
9 | public AudioSource musicSource; //Drag a reference to the audio source which will play the music.
10 | public static SoundManager instance = null; //Allows other scripts to call functions from SoundManager.
11 | public float lowPitchRange = .95f; //The lowest a sound effect will be randomly pitched.
12 | public float highPitchRange = 1.05f; //The highest a sound effect will be randomly pitched.
13 |
14 |
15 | void Awake ()
16 | {
17 | //Check if there is already an instance of SoundManager
18 | if (instance == null)
19 | //if not, set it to this.
20 | instance = this;
21 | //If instance already exists:
22 | else if (instance != this)
23 | //Destroy this, this enforces our singleton pattern so there can only be one instance of SoundManager.
24 | Destroy (gameObject);
25 |
26 | //Set SoundManager to DontDestroyOnLoad so that it won't be destroyed when reloading our scene.
27 | DontDestroyOnLoad (gameObject);
28 | }
29 |
30 |
31 | //Used to play single sound clips.
32 | public void PlaySingle(AudioClip clip)
33 | {
34 | //Set the clip of our efxSource audio source to the clip passed in as a parameter.
35 | efxSource.clip = clip;
36 |
37 | //Play the clip.
38 | efxSource.Play ();
39 | }
40 |
41 |
42 | //RandomizeSfx chooses randomly between various audio clips and slightly changes their pitch.
43 | public void RandomizeSfx (params AudioClip[] clips)
44 | {
45 | //Generate a random number between 0 and the length of our array of clips passed in.
46 | int randomIndex = Random.Range(0, clips.Length);
47 |
48 | //Choose a random pitch to play back our clip at between our high and low pitch ranges.
49 | float randomPitch = Random.Range(lowPitchRange, highPitchRange);
50 |
51 | //Set the pitch of the audio source to the randomly chosen pitch.
52 | efxSource.pitch = randomPitch;
53 |
54 | //Set the clip to the clip at our randomly chosen index.
55 | efxSource.clip = clips[randomIndex];
56 |
57 | //Play the clip.
58 | efxSource.Play();
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/SoundManager.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e9664006bbf82436782d24280d78f122
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/Wall.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 |
4 | namespace Completed
5 | {
6 | public class Wall : MonoBehaviour
7 | {
8 | public AudioClip chopSound1; //1 of 2 audio clips that play when the wall is attacked by the player.
9 | public AudioClip chopSound2; //2 of 2 audio clips that play when the wall is attacked by the player.
10 | public Sprite dmgSprite; //Alternate sprite to display after Wall has been attacked by player.
11 | public int hp = 3; //hit points for the wall.
12 |
13 |
14 | private SpriteRenderer spriteRenderer; //Store a component reference to the attached SpriteRenderer.
15 |
16 |
17 | void Awake ()
18 | {
19 | //Get a component reference to the SpriteRenderer.
20 | spriteRenderer = GetComponent ();
21 | }
22 |
23 |
24 | //DamageWall is called when the player attacks a wall.
25 | public void DamageWall (int loss)
26 | {
27 | //Call the RandomizeSfx function of SoundManager to play one of two chop sounds.
28 | SoundManager.instance.RandomizeSfx (chopSound1, chopSound2);
29 |
30 | //Set spriteRenderer to the damaged wall sprite.
31 | spriteRenderer.sprite = dmgSprite;
32 |
33 | //Subtract loss from hit point total.
34 | hp -= loss;
35 |
36 | //If hit points are less than or equal to zero:
37 | if(hp <= 0)
38 | //Disable the gameObject.
39 | gameObject.SetActive (false);
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/Scripts/Wall.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4b55ebdc127da43ee9afaef098e22f35
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/_Complete-Game/_Complete-Game.unity:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Assets/_Complete-Game/_Complete-Game.unity
--------------------------------------------------------------------------------
/Assets/_Complete-Game/_Complete-Game.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 72d362146ea8845739db4749fdcbe96d
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Doc/Game.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Doc/Game.png
--------------------------------------------------------------------------------
/Doc/ILSpyAfterObfuscate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Doc/ILSpyAfterObfuscate.png
--------------------------------------------------------------------------------
/Doc/ILSpyAfterObfuscate2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Doc/ILSpyAfterObfuscate2.png
--------------------------------------------------------------------------------
/Doc/ILSpyAfterObfuscate3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Doc/ILSpyAfterObfuscate3.png
--------------------------------------------------------------------------------
/Doc/ILSpyBeforeObfuscate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Doc/ILSpyBeforeObfuscate.png
--------------------------------------------------------------------------------
/Doc/ObfuscatorConfig.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/Doc/ObfuscatorConfig.png
--------------------------------------------------------------------------------
/ProjectSettings/AudioManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/AudioManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/ClusterInputManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/ClusterInputManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/DynamicsManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/DynamicsManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/EditorBuildSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/EditorBuildSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/EditorSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/EditorSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/GraphicsSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/GraphicsSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/InputManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/InputManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/NavMeshAreas.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/NavMeshAreas.asset
--------------------------------------------------------------------------------
/ProjectSettings/NetworkManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/NetworkManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/Physics2DSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/Physics2DSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/ProjectSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/ProjectSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/ProjectVersion.txt:
--------------------------------------------------------------------------------
1 | m_EditorVersion: 2017.4.34f1
2 |
--------------------------------------------------------------------------------
/ProjectSettings/QualitySettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/QualitySettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/TagManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/TagManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/TimeManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/TimeManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/UnityAdsSettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 00000000000000008100000000000000
3 |
--------------------------------------------------------------------------------
/ProjectSettings/UnityConnectSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrFlower/Unity-Obfuscator-demo/23d98a3643875179c1778359b331cee63748cd65/ProjectSettings/UnityConnectSettings.asset
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Unity-Obfuscator-demo
2 |
3 | ## 简介
4 | 本项目为使用[Unity-Obfuscator][1]插件进行混淆的演示项目,游戏项目为Unity AssetStore上的官方资源[2D Rouguelike][2]。
5 | 此项目使用的Unity版本为2017.4.34f1。
6 |
7 | ## 配置详情
8 |
9 | ### 基本设置
10 | ![ObfuscatorConfig][3]
11 | ### 黑白名单配置
12 | > WhiteList-NameObfuscate-NamespaceNameOnly.txt
13 | >> Completed
14 |
15 | > WhiteList-NameObfuscate-ClassNameOnly.txt
16 | >> Completed|BoardManager
17 | >> Completed|Enemy
18 | >> Completed|GameManager
19 | >> Completed|Loader
20 | >> Completed|MovingObject
21 | >> Completed|Player
22 | >> Completed|SoundManager
23 | >> Completed|Wall
24 |
25 | > WhiteList-NameObfuscate-Method.txt
26 | >> Completed|GameManager|HideLevelImage
27 | >> Completed|GameManager|CallbackInitialization
28 | >> Completed|Player|Restart
29 |
30 | >WhiteList-CodeInject-Class
31 | >> Completed|Wall
32 |
33 |
34 |
35 | ## 配置说明
36 | 因项目较小,可以逐一排除不能混淆的部分,设置上选择白名单模式,实际项目若部分区域的代码难以全部排除出不能混淆的代码,建议用黑白名单混用模式。
37 | 项目所有脚本都继承自MonoBehavior,并直接挂在Prefab上,故所有脚本类名都不能做混淆,且所有类的处于Completed命名空间内,Completed命名空间本身名字也不能做混淆处理。
38 |
39 | ```c#
40 | Invoke("HideLevelImage", levelStartDelay);//GameManager line:93
41 | ```
42 | Invoke调用不能混淆,故GameManager类中HideLevelImage方法需要放到白名单
43 |
44 | ```c#
45 | Invoke ("Restart", restartLevelDelay);//Player line:182
46 | ```
47 | Invoke调用不能混淆,故Player类中Restart方法需要放到白名单
48 |
49 | ```c#
50 | [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
51 | static public void CallbackInitialization()//GameManager line:60
52 | {
53 | //register the callback to be called everytime the scene is loaded
54 | SceneManager.sceneLoaded += OnSceneLoaded;
55 | }
56 | ```
57 | 特性基于反射调用,故GameManager类中的CallbackInitialization方法需要放到白名单
58 |
59 |
黑白名单规则请参考[Unity-Obfuscator][4]的README中的**黑白名单配置-配置规则**
60 |
61 | ## 混淆结果
62 |
63 | 混淆前代码:
64 | ![混淆前代码][5]
65 |
66 | 混淆后代码:
67 | ![混淆后代码][6]
68 |
69 | 可见配置了白名单的Completed命名空间名以及各个类名都没变,但除白名单内的3个方法以及Unity生命周期方法外,其他所有类成员名字都发生了变化,名字混淆成功
70 |
71 | ![混淆后代码2][7]
72 |
73 | 可见GameManager中插入了大量内部调用Console.Write()的方法,这些是从垃圾代码库中注入的垃圾方法,垃圾代码注入成功。
74 | ![混淆后代码3][8]
75 |
76 | 上面在黑白名单配置中,WhiteList\-CodeInject\-Class文件配置了Completed|Wall,即Completed命名空间下的Wall类将不会注入对垃圾代码的调用,上图可见无垃圾代码调用,代码注入的黑白名单生效。
77 |
78 | ---
79 | ![游戏运行图][9]
80 |
81 | **游戏正常运行,混淆成功。**
82 |
83 |
84 | [1]: https://github.com/DrFlower/Unity-Obfuscator "Unity-Obfuscator"
85 | [2]: https://assetstore.unity.com/packages/essentials/tutorial-projects/2d-roguelike-29825 "2D Rouguelike"
86 | [3]: https://github.com/DrFlower/Unity-Obfuscator-demo/blob/master/Doc/ObfuscatorConfig.png "ObfuscatorConfig"
87 | [4]: https://github.com/DrFlower/Unity-Obfuscator "Unity-Obfuscator"
88 | [5]: https://github.com/DrFlower/Unity-Obfuscator-demo/blob/master/Doc/ILSpyBeforeObfuscate.png "ILSpyBeforeObfuscate"
89 | [6]: https://github.com/DrFlower/Unity-Obfuscator-demo/blob/master/Doc/ILSpyAfterObfuscate.png "ILSpyAfterObfuscate"
90 | [7]: https://github.com/DrFlower/Unity-Obfuscator-demo/blob/master/Doc/ILSpyAfterObfuscate2.png "ILSpyAfterObfuscate2"
91 | [8]: https://github.com/DrFlower/Unity-Obfuscator-demo/blob/master/Doc/ILSpyAfterObfuscate3.png "ILSpyAfterObfuscate3"
92 | [9]: https://github.com/DrFlower/Unity-Obfuscator-demo/blob/master/Doc/Game.png "Game"
93 |
--------------------------------------------------------------------------------
/UnityObfuscator-InjectInfo.txt:
--------------------------------------------------------------------------------
1 | (System.Void)Enemy.MoveEnemy() ===> krTwK
2 | (System.Void)GameManager.CallbackInitialization() ===> svKYD
3 | (System.Void)GameManager.OnSceneLoaded(UnityEngine.SceneManagement.Scene,UnityEngine.SceneManagement.LoadSceneMode) ===> FNgOhND
4 | (System.Void)GameManager.InitGame() ===> vIkgFS_nV
5 | (System.Void)GameManager.HideLevelImage() ===> dQFjVK
6 | (System.Void)GameManager.AddEnemyToList(Completed.Enemy) ===> YDSv
7 | (System.Void)GameManager.GameOver() ===> ZdDCr
8 | (System.Void)Player.Restart() ===> enAKjr
9 | (System.Void)Player.LoseFood(System.Int32) ===> cuAeo
10 | (System.Void)Player.CheckIfGameOver() ===> FDTmGyrRF
11 | (System.Void)SoundManager.PlaySingle(UnityEngine.AudioClip) ===> WNZf
12 | (System.Void)SoundManager.RandomizeSfx(UnityEngine.AudioClip[]) ===> eRxPc
13 | (System.Void)BoardManager.InitialiseList() ===> JepbYmgGb
14 | (System.Void)BoardManager.BoardSetup() ===> aFgMZow
15 | (UnityEngine.Vector3)BoardManager.RandomPosition() ===> JepbYmgGb
16 | (System.Void)BoardManager.LayoutObjectAtRandom(UnityEngine.GameObject[],System.Int32,System.Int32) ===> _nhST_
17 | (System.Void)BoardManager.SetupScene(System.Int32) ===> JepbYmgGb
18 |
--------------------------------------------------------------------------------
/UnityObfuscator-Name_Obfuscate_Map.txt:
--------------------------------------------------------------------------------
1 | -------------Namespace-------------
2 | -------------Class-------------
3 | -------------Filed-------------
4 | playerDamage ===> tcdR
5 | attackSound1 ===> NkMTeO
6 | attackSound2 ===> dTcL
7 | animator ===> XIbwRb
8 | target ===> ATjLv
9 | skipMove ===> SJnTHH
10 | levelStartDelay ===> lGDJZZAOb
11 | turnDelay ===> KPjiP
12 | playerFoodPoints ===> kSAd
13 | instance ===> uF_ReQnI
14 | playersTurn ===> Vb_b
15 | levelText ===> dZBFpHQN
16 | levelImage ===> Sm__bmiL
17 | boardScript ===> vWiF
18 | level ===> TU_ZhLE
19 | enemies ===> auqCfjQnV
20 | enemiesMoving ===> ricH
21 | doingSetup ===> nuObWU
22 | <>f__mg$cache0 ===> xVbDj
23 | gameManager ===> BGonvz_
24 | soundManager ===> cPcsgjwW
25 | moveTime ===> hOLpazb
26 | blockingLayer ===> vUhCZTa
27 | boxCollider ===> aTaFKTrNS
28 | rb2D ===> FNWqtfI
29 | inverseMoveTime ===> ZqCHAPm
30 | restartLevelDelay ===> SBvAE
31 | pointsPerFood ===> afcpJ
32 | pointsPerSoda ===> tgGGOheDg
33 | wallDamage ===> ZJhd
34 | foodText ===> sMAQt
35 | moveSound1 ===> wltZYba
36 | moveSound2 ===> hxdsJ
37 | eatSound1 ===> KlPaA
38 | eatSound2 ===> BtyZYnkmb
39 | drinkSound1 ===> beAz
40 | drinkSound2 ===> NWscV
41 | gameOverSound ===> CGfxo
42 | animator ===> dodBmNqz
43 | food ===> KUJkeI
44 | efxSource ===> FgyGC
45 | musicSource ===> DRXsY
46 | instance ===> qOasD
47 | lowPitchRange ===> tEQkIjJ
48 | highPitchRange ===> FHBkJWs
49 | chopSound1 ===> ATEK_ecT
50 | chopSound2 ===> EIOrn
51 | dmgSprite ===> NIHk
52 | hp ===> zuNcz
53 | spriteRenderer ===> YXsyMq
54 | columns ===> suewO
55 | rows ===> _TfFMY
56 | wallCount ===> DliYk_ia
57 | foodCount ===> sHnGzJY
58 | exit ===> nCbIwMj
59 | floorTiles ===> TCuZheq
60 | wallTiles ===> CJCqDufiV
61 | foodTiles ===> rw_aoy_C
62 | enemyTiles ===> NQElp
63 | outerWallTiles ===> nHJEFui
64 | boardHolder ===> xncJXkOC
65 | gridPositions ===> xJWFoD
66 | -------------Property-------------
67 | -------------Method-------------
68 | MoveEnemy ===> _Ts_ZLy
69 | OnSceneLoaded ===> iwZz
70 | InitGame ===> OVRWtNUpn
71 | AddEnemyToList ===> _ordXR
72 | GameOver ===> OeBhUB
73 | Move ===> uToTLb
74 | LoseFood ===> mhAM
75 | CheckIfGameOver ===> PuBKLvw
76 | PlaySingle ===> svCU
77 | RandomizeSfx ===> MeySD
78 | DamageWall ===> F_Nmtu
79 | InitialiseList ===> frxzKAsWe
80 | BoardSetup ===> ALiY
81 | RandomPosition ===> mSYq
82 | LayoutObjectAtRandom ===> IjwG
83 | SetupScene ===> vreA
84 |
--------------------------------------------------------------------------------