├── .gitignore ├── Assets ├── BattleDrakeStudios.meta └── BattleDrakeStudios │ ├── ModularCharacterEditor.meta │ ├── ModularCharacterEditor │ ├── Editor.meta │ ├── Editor │ │ ├── ModularArmorCreator.cs │ │ ├── ModularArmorCreator.cs.meta │ │ ├── ModularCharacterEditor.cs │ │ ├── ModularCharacterEditor.cs.meta │ │ ├── ModularSetupWizard.cs │ │ └── ModularSetupWizard.cs.meta │ ├── ModularCharacterEditorReadme.txt │ ├── ModularCharacterEditorReadme.txt.meta │ ├── ScriptableObjects.meta │ ├── ScriptableObjects │ │ ├── Items.meta │ │ ├── Items │ │ │ ├── DemoChest.asset │ │ │ ├── DemoChest.asset.meta │ │ │ ├── DemoHelmet.asset │ │ │ └── DemoHelmet.asset.meta │ │ ├── ModularArmor.meta │ │ └── ModularArmor │ │ │ ├── BlueCuirass.asset │ │ │ ├── BlueCuirass.asset.meta │ │ │ ├── HornedHelmet.asset │ │ │ └── HornedHelmet.asset.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── Components.meta │ │ ├── Components │ │ ├── ModularCharacterManager.cs │ │ └── ModularCharacterManager.cs.meta │ │ ├── Demo.meta │ │ ├── Demo │ │ ├── EquipmentManager.cs │ │ └── EquipmentManager.cs.meta │ │ ├── Enums.meta │ │ ├── Enums │ │ ├── Gender.cs │ │ ├── Gender.cs.meta │ │ ├── ModularArmorType.cs │ │ ├── ModularArmorType.cs.meta │ │ ├── ModularBodyPart.cs │ │ └── ModularBodyPart.cs.meta │ │ ├── Item.meta │ │ ├── Item │ │ ├── Item.cs │ │ ├── Item.cs.meta │ │ ├── ModularArmor.cs │ │ └── ModularArmor.cs.meta │ │ ├── Linkers.meta │ │ ├── Linkers │ │ ├── BodyPartLinker.cs │ │ ├── BodyPartLinker.cs.meta │ │ ├── ColorPropertyLinker.cs │ │ └── ColorPropertyLinker.cs.meta │ │ ├── Utilities.meta │ │ └── Utilities │ │ ├── ModularCharacterStatics.cs │ │ ├── ModularCharacterStatics.cs.meta │ │ ├── ModularExtensionMethods.cs │ │ └── ModularExtensionMethods.cs.meta │ ├── SimpleIconCreator.meta │ ├── SimpleIconCreator │ ├── Editor.meta │ ├── Editor │ │ ├── IconCreatorWindow.cs │ │ └── IconCreatorWindow.cs.meta │ ├── Icons.meta │ ├── SimpleIconCreatorReadme.txt │ └── SimpleIconCreatorReadme.txt.meta │ ├── Universal.meta │ └── Universal │ ├── CustomPreviewEditor.cs │ └── CustomPreviewEditor.cs.meta ├── LICENSE ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset └── XRSettings.asset └── README.md /.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 | # Never ignore Asset meta data 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 | # TextMesh Pro files 20 | [Aa]ssets/TextMesh*Pro/ 21 | 22 | # Autogenerated Jetbrains Rider plugin 23 | [Aa]ssets/Plugins/Editor/JetBrains* 24 | 25 | # Visual Studio cache directory 26 | .vs/ 27 | 28 | # Gradle cache directory 29 | .gradle/ 30 | 31 | # Autogenerated VS/MD/Consulo solution and project files 32 | ExportedObj/ 33 | .consulo/ 34 | *.csproj 35 | *.unityproj 36 | *.sln 37 | *.suo 38 | *.tmp 39 | *.user 40 | *.userprefs 41 | *.pidb 42 | *.booproj 43 | *.svd 44 | *.pdb 45 | *.mdb 46 | *.opendb 47 | *.VC.db 48 | 49 | # Unity3D generated meta files 50 | *.pidb.meta 51 | *.pdb.meta 52 | *.mdb.meta 53 | 54 | # Unity3D generated file on crash reports 55 | sysinfo.txt 56 | 57 | # Builds 58 | *.apk 59 | *.unitypackage 60 | 61 | # Crashlytics generated file 62 | crashlytics-build.properties 63 | 64 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f61a56e61777b440a4d0c3093a21eca 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f3435708e431494c8b05c85ab8965d0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 048d25bdf051cef49aa5c7bb5d3ba5b9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Editor/ModularArmorCreator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | using BattleDrakeStudios.ModularCharacters; 6 | using BattleDrakeStudios.Utilities; 7 | using System; 8 | using static BattleDrakeStudios.ModularCharacters.ModularCharacterStatics; 9 | using BattleDrakeStudios.SimpleIconCreator; 10 | using System.IO; 11 | 12 | namespace BattleDrakeStudios.ModularCharacters { 13 | public class ModularArmorCreator : EditorWindow { 14 | private Vector2 windowPadding; 15 | private Vector2 armorScrollView; 16 | private Rect previewRect; 17 | private Rect bodyOptionsRect; 18 | private Rect armorOptionsRect; 19 | private Rect colorOptionsRect; 20 | private Rect armorNameRect; 21 | private Rect saveButtonRect; 22 | 23 | private GameObject previewPrefab; 24 | private CustomPreviewEditor previewEditor; 25 | private ModularCharacterManager characterManager; 26 | private Material previewMaterial; 27 | 28 | private IconCreatorWindow iconWindow; 29 | 30 | private ModularArmor existingArmor; 31 | 32 | private string armorName = "New Armor Item"; 33 | private string assetPath = "Assets/BattleDrakeStudios/ModularCharacterEditor/ScriptableObjects/ModularArmor"; 34 | 35 | private int armorTypeIndex; 36 | private ModularArmorType[] armorTypes; 37 | 38 | private List armorParts; 39 | private int[] activePartID; 40 | 41 | public ColorPropertyLinker[] armorColors = { new ColorPropertyLinker(COLOR_PRIMARY), new ColorPropertyLinker(COLOR_SECONDARY), new ColorPropertyLinker(COLOR_LEATHER_PRIMARY), 42 | new ColorPropertyLinker(COLOR_LEATHER_SECONDARY), new ColorPropertyLinker(COLOR_METAL_PRIMARY), new ColorPropertyLinker(COLOR_METAL_SECONDARY), new ColorPropertyLinker(COLOR_METAL_DARK)}; 43 | 44 | private Gender currentGender; 45 | 46 | [MenuItem("BattleDrakeStudios/ModularCharacter/ArmorCreator")] 47 | public static void ShowWindow() { 48 | EditorWindow newWindow = GetWindow("Modular Armor Creator"); 49 | newWindow.minSize = new Vector2(600, 425); 50 | newWindow.maxSize = new Vector2(600, 425); 51 | newWindow.Show(); 52 | } 53 | 54 | private void OnEnable() { 55 | EditorApplication.playModeStateChanged += ReloadPreviewObject; 56 | Undo.undoRedoPerformed += UndoPerformed; 57 | Initialize(); 58 | } 59 | private void OnDisable() { 60 | EditorApplication.playModeStateChanged -= ReloadPreviewObject; 61 | Undo.undoRedoPerformed -= UndoPerformed; 62 | } 63 | 64 | private void ReloadPreviewObject(PlayModeStateChange stateChange) { 65 | if (stateChange == PlayModeStateChange.EnteredEditMode) { 66 | if (previewEditor.TargetObject != null) { 67 | LoadPreviewObject(previewEditor.TargetObject); 68 | Repaint(); 69 | } 70 | } 71 | } 72 | 73 | private void UndoPerformed() { 74 | InitializeColors(); 75 | Repaint(); 76 | } 77 | 78 | private void Initialize() { 79 | SetupRectAreas(); 80 | 81 | previewPrefab = Resources.Load("Pf_ArmorCreatorBase"); 82 | 83 | currentGender = Gender.Male; 84 | 85 | armorTypes = (ModularArmorType[])System.Enum.GetValues(typeof(ModularArmorType)); 86 | 87 | armorTypeIndex = 0; 88 | SetupParts(); 89 | } 90 | 91 | private void SetupRectAreas() { 92 | windowPadding = new Vector2(4, 4); 93 | previewRect = new Rect(0, 0, 256, 256); 94 | bodyOptionsRect = new Rect(0, 256, 256, 125); 95 | armorOptionsRect = new Rect(256, 0, 340, 200); 96 | colorOptionsRect = new Rect(256, 200, 340, 150); 97 | armorNameRect = new Rect(256, 350, 340, 25); 98 | saveButtonRect = new Rect(0, 375, 597, 50); 99 | } 100 | 101 | private void SetupParts() { 102 | armorParts = GetArmorParts(armorTypes[armorTypeIndex]); 103 | 104 | activePartID = new int[armorParts.Count]; 105 | for (int i = 0; i < activePartID.Length; i++) { 106 | if (armorParts[i].bodyType.IsBaseBodyPart()) { 107 | activePartID[i] = 0; 108 | armorParts[i].partID = 0; 109 | } else { 110 | activePartID[i] = -1; 111 | armorParts[i].partID = -1; 112 | } 113 | } 114 | } 115 | 116 | private void SetupPartsFromExisting() { 117 | if (existingArmor != null) { 118 | armorTypeIndex = (int)existingArmor.armorType; 119 | armorParts = GetArmorParts(armorTypes[armorTypeIndex]); 120 | activePartID = new int[armorParts.Count]; 121 | for (int i = 0; i < activePartID.Length; i++) { 122 | activePartID[i] = existingArmor.armorParts[i].partID; 123 | armorParts[i].partID = activePartID[i]; 124 | if (armorParts[i].partID > -1) 125 | characterManager.ActivatePart(armorParts[i].bodyType, armorParts[i].partID); 126 | } 127 | } 128 | } 129 | 130 | private void LoadPreviewObject(GameObject previewObject) { 131 | previewEditor.OnPreviewObjectInstantiated -= LoadPreviewObject; 132 | 133 | if (previewEditor.TargetObject != null) { 134 | characterManager = previewEditor.TargetObject.GetComponent(); 135 | if (characterManager != null) { 136 | currentGender = characterManager.CharacterGender; 137 | previewMaterial = new Material(characterManager.CharacterMaterial); 138 | if (existingArmor != null) { 139 | armorName = existingArmor.name; 140 | SetMaterialColorsToExisting(); 141 | SetupPartsFromExisting(); 142 | } 143 | characterManager.SetAllPartsMaterial(previewMaterial); 144 | InitializeColors(); 145 | } 146 | } 147 | } 148 | 149 | private void InitializeColors() { 150 | foreach (var armorColor in armorColors) { 151 | armorColor.color = previewMaterial.GetColor(armorColor.property); 152 | } 153 | } 154 | 155 | private void SetMaterialColorsToExisting() { 156 | foreach (var armorColor in existingArmor.armorColors) { 157 | previewMaterial.SetColor(armorColor.property, armorColor.color); 158 | } 159 | } 160 | 161 | private void OnGUI() { 162 | GUILayout.BeginArea(new Rect(previewRect.x + windowPadding.x, previewRect.y + windowPadding.y, 163 | previewRect.width - windowPadding.x, previewRect.height - windowPadding.y)); 164 | 165 | if (previewPrefab != null) { 166 | if (previewEditor == null) { 167 | previewEditor = Editor.CreateEditor(previewPrefab, typeof(CustomPreviewEditor)) as CustomPreviewEditor; 168 | previewEditor.OnPreviewObjectInstantiated += LoadPreviewObject; 169 | previewEditor.TargetAsset = previewPrefab; 170 | } else { 171 | if (characterManager == null) { 172 | LoadPreviewObject(previewEditor.TargetObject); 173 | } 174 | } 175 | if (previewEditor.HasPreviewGUI()) { 176 | previewEditor.OnInteractivePreviewGUI(new Rect(0, 0, previewRect.width - windowPadding.x, previewRect.height - windowPadding.y), null); 177 | } 178 | } 179 | GUILayout.EndArea(); 180 | 181 | GUILayout.BeginArea(new Rect(bodyOptionsRect.x + windowPadding.x, bodyOptionsRect.y + windowPadding.y, 182 | bodyOptionsRect.width - windowPadding.x, bodyOptionsRect.height - windowPadding.y)); 183 | GUILayout.BeginVertical(); 184 | 185 | GUILayout.BeginHorizontal(); 186 | if (GUILayout.Button("Male")) { 187 | characterManager.SwapGender(Gender.Male); 188 | currentGender = Gender.Male; 189 | } 190 | if (GUILayout.Button("Female")) { 191 | characterManager.SwapGender(Gender.Female); 192 | currentGender = Gender.Female; 193 | } 194 | GUILayout.EndHorizontal(); 195 | 196 | GUILayout.BeginHorizontal(); 197 | if (GUILayout.Button("ShowBody")) { 198 | characterManager.ToggleBaseBodyDisplay(true); 199 | } 200 | if (GUILayout.Button("HideBody")) { 201 | characterManager.ToggleBaseBodyDisplay(false); 202 | } 203 | GUILayout.EndHorizontal(); 204 | 205 | if (GUILayout.Button("Reset")) { 206 | ResetAll(); 207 | } 208 | 209 | GUILayout.Label("Existing Modular Armor Asset"); 210 | 211 | EditorGUI.BeginChangeCheck(); 212 | existingArmor = EditorGUILayout.ObjectField(existingArmor, typeof(ModularArmor), false) as ModularArmor; 213 | if (EditorGUI.EndChangeCheck()) { 214 | if (existingArmor != null) { 215 | armorName = existingArmor.name; 216 | ResetParts(); 217 | SetupPartsFromExisting(); 218 | SetMaterialColorsToExisting(); 219 | characterManager.SetAllPartsMaterial(previewMaterial); 220 | InitializeColors(); 221 | } else { 222 | ResetAll(); 223 | } 224 | } 225 | GUILayout.EndVertical(); 226 | GUILayout.EndArea(); 227 | 228 | GUILayout.BeginArea(new Rect(armorOptionsRect.x + windowPadding.x, armorOptionsRect.y + windowPadding.y, 229 | armorOptionsRect.width - windowPadding.x, armorOptionsRect.height - windowPadding.y)); 230 | 231 | EditorGUI.BeginChangeCheck(); 232 | armorTypeIndex = EditorGUILayout.Popup(armorTypeIndex, Array.ConvertAll(armorTypes, x => x.ToString()), GUILayout.Width(340)); 233 | if (EditorGUI.EndChangeCheck()) { 234 | ResetParts(); 235 | armorParts = GetArmorParts(armorTypes[armorTypeIndex]); 236 | SetupParts(); 237 | } 238 | 239 | GUILayout.BeginVertical(); 240 | 241 | armorScrollView = GUILayout.BeginScrollView(armorScrollView); 242 | 243 | if (armorParts.Count > 0) { 244 | for (int i = 0; i < armorParts.Count; i++) { 245 | GUILayout.BeginHorizontal(); 246 | GUILayout.Label(armorParts[i].bodyType.ToString()); 247 | EditorGUI.BeginChangeCheck(); 248 | int maxPartID = -1; 249 | if (characterManager != null) { 250 | maxPartID = characterManager.GetCharacterBody()[armorParts[i].bodyType].Length - 1; 251 | } 252 | activePartID[i] = EditorGUILayout.IntSlider(activePartID[i], -1, maxPartID); 253 | if (EditorGUI.EndChangeCheck()) { 254 | if (activePartID[i] > -1) { 255 | characterManager.ActivatePart(armorParts[i].bodyType, activePartID[i]); 256 | } else { 257 | characterManager.DeactivatePart(armorParts[i].bodyType); 258 | } 259 | armorParts[i].partID = activePartID[i]; 260 | } 261 | GUILayout.EndHorizontal(); 262 | } 263 | } 264 | GUILayout.EndScrollView(); 265 | 266 | GUILayout.EndArea(); 267 | 268 | GUILayout.BeginArea(new Rect(colorOptionsRect.x + windowPadding.x, colorOptionsRect.y + windowPadding.y, 269 | colorOptionsRect.width - windowPadding.x, colorOptionsRect.height - windowPadding.y)); 270 | foreach (var armorColor in armorColors) { 271 | SetupColorFields(ref armorColor.color, armorColor.property, armorColor.property); 272 | } 273 | GUILayout.EndArea(); 274 | 275 | GUILayout.EndVertical(); 276 | 277 | GUILayout.BeginArea(new Rect(armorNameRect.x + windowPadding.x, armorNameRect.y + windowPadding.y, 278 | armorNameRect.width - windowPadding.x, armorNameRect.height - windowPadding.y)); 279 | 280 | GUILayout.BeginHorizontal(); 281 | GUILayout.Label("Armor Name: ", GUILayout.Width(75)); 282 | armorName = GUILayout.TextField(armorName, GUILayout.Width(260)); 283 | GUILayout.EndHorizontal(); 284 | 285 | GUILayout.EndArea(); 286 | 287 | GUILayout.BeginArea(new Rect(saveButtonRect.x + windowPadding.x, saveButtonRect.y + windowPadding.y, 288 | saveButtonRect.width - windowPadding.x, saveButtonRect.height - windowPadding.y)); 289 | 290 | GUILayout.BeginHorizontal(); 291 | if (GUILayout.Button("Save as New")) { 292 | SaveDataToAsset(true); 293 | } 294 | if (GUILayout.Button("Overwrite Existing")) { 295 | SaveDataToAsset(false); 296 | } 297 | GUILayout.EndHorizontal(); 298 | 299 | if (GUILayout.Button("Create Icon")) { 300 | iconWindow = EditorWindow.GetWindow(); 301 | iconWindow.Show(); 302 | if (iconWindow.PreviewEditor != null) { 303 | DestroyImmediate(iconWindow.PreviewEditor); 304 | } 305 | iconWindow.TargetObject = previewPrefab; 306 | 307 | iconWindow.OnPreviewCreated += SetupIconPreview; 308 | } 309 | 310 | GUILayout.EndArea(); 311 | } 312 | 313 | private void SetupIconPreview(CustomPreviewEditor preview) { 314 | iconWindow.OnPreviewCreated -= SetupIconPreview; 315 | 316 | ModularCharacterManager iconCharacter = preview.TargetObject.GetComponent(); 317 | iconCharacter.SwapGender(currentGender); 318 | iconCharacter.ToggleBaseBodyDisplay(false); 319 | foreach (var part in armorParts) { 320 | if (part.partID > -1) { 321 | iconCharacter.ActivatePart(part.bodyType, part.partID); 322 | for (int i = 0; i < armorColors.Length; i++) { 323 | iconCharacter.SetPartColor(part.bodyType, part.partID, armorColors[i].property, armorColors[i].color); 324 | } 325 | } else 326 | iconCharacter.DeactivatePart(part.bodyType); 327 | } 328 | } 329 | 330 | private void SaveDataToAsset(bool isNew) { 331 | ModularArmor newArmor = ScriptableObject.CreateInstance(); 332 | 333 | newArmor.armorType = armorTypes[armorTypeIndex]; 334 | 335 | foreach (var armorColor in newArmor.armorColors) { 336 | armorColor.color = previewMaterial.GetColor(armorColor.property); 337 | } 338 | 339 | newArmor.armorParts = armorParts.ToArray(); 340 | for (int i = 0; i < newArmor.armorParts.Length; i++) { 341 | newArmor.armorParts[i].partID = activePartID[i]; 342 | } 343 | 344 | if (isNew) { 345 | string newAssetPath = AssetDatabase.GenerateUniqueAssetPath(assetPath + "/" + armorName + ".asset"); 346 | AssetDatabase.CreateAsset(newArmor, newAssetPath); 347 | } else { 348 | if (existingArmor == null) { 349 | Debug.LogWarning("Nothing to overwrite"); 350 | return; 351 | } 352 | if (armorName != existingArmor.name) { 353 | string existingPath = AssetDatabase.GetAssetPath(existingArmor); 354 | AssetDatabase.RenameAsset(existingPath, armorName); 355 | } 356 | EditorUtility.CopySerializedIfDifferent(newArmor, existingArmor); 357 | } 358 | AssetDatabase.SaveAssets(); 359 | AssetDatabase.Refresh(); 360 | } 361 | 362 | private void SetupColorFields(ref Color partColor, string label, string shaderProperty) { 363 | EditorGUI.BeginChangeCheck(); 364 | partColor = EditorGUILayout.ColorField(label, partColor, GUILayout.Width(340)); 365 | if (EditorGUI.EndChangeCheck()) { 366 | if (previewMaterial != null) { 367 | Undo.RecordObject(previewMaterial, "Undo Color change"); 368 | previewMaterial.SetColor(shaderProperty, partColor); 369 | } 370 | 371 | } 372 | } 373 | 374 | private void ResetAll() { 375 | DestroyImmediate(previewEditor); 376 | existingArmor = null; 377 | Initialize(); 378 | } 379 | 380 | private void ResetParts() { 381 | foreach (var part in armorParts) { 382 | if (part.bodyType.IsBaseBodyPart()) { 383 | if (characterManager != null) 384 | characterManager.ActivatePart(part.bodyType, 0); 385 | } else { 386 | if (characterManager != null) 387 | characterManager.DeactivatePart(part.bodyType); 388 | } 389 | } 390 | } 391 | 392 | private List GetArmorParts(ModularArmorType armorType) { 393 | List armorParts = new List(); 394 | switch (armorType) { 395 | case ModularArmorType.Helmet: 396 | armorParts.Add(new BodyPartLinker(ModularBodyPart.HeadAttachment)); 397 | armorParts.Add(new BodyPartLinker(ModularBodyPart.Helmet)); 398 | armorParts.Add(new BodyPartLinker(ModularBodyPart.HeadCovering)); 399 | armorParts.Add(new BodyPartLinker(ModularBodyPart.Hat)); 400 | armorParts.Add(new BodyPartLinker(ModularBodyPart.Mask)); 401 | break; 402 | case ModularArmorType.Shoulders: 403 | armorParts.Add(new BodyPartLinker(ModularBodyPart.ShoulderAttachmentLeft)); 404 | armorParts.Add(new BodyPartLinker(ModularBodyPart.ShoulderAttachmentRight)); 405 | break; 406 | case ModularArmorType.Cloak: 407 | armorParts.Add(new BodyPartLinker(ModularBodyPart.BackAttachment)); 408 | break; 409 | case ModularArmorType.Chest: 410 | armorParts.Add(new BodyPartLinker(ModularBodyPart.Torso)); 411 | armorParts.Add(new BodyPartLinker(ModularBodyPart.ArmUpperLeft)); 412 | armorParts.Add(new BodyPartLinker(ModularBodyPart.ArmUpperRight)); 413 | break; 414 | case ModularArmorType.Gloves: 415 | armorParts.Add(new BodyPartLinker(ModularBodyPart.ElbowAttachmentLeft)); 416 | armorParts.Add(new BodyPartLinker(ModularBodyPart.ElbowAttachmentRight)); 417 | armorParts.Add(new BodyPartLinker(ModularBodyPart.ArmLowerLeft)); 418 | armorParts.Add(new BodyPartLinker(ModularBodyPart.ArmLowerRight)); 419 | armorParts.Add(new BodyPartLinker(ModularBodyPart.HandLeft)); 420 | armorParts.Add(new BodyPartLinker(ModularBodyPart.HandRight)); 421 | break; 422 | case ModularArmorType.Legs: 423 | armorParts.Add(new BodyPartLinker(ModularBodyPart.Hips)); 424 | armorParts.Add(new BodyPartLinker(ModularBodyPart.HipsAttachment)); 425 | break; 426 | case ModularArmorType.Boots: 427 | armorParts.Add(new BodyPartLinker(ModularBodyPart.KneeAttachmentLeft)); 428 | armorParts.Add(new BodyPartLinker(ModularBodyPart.KneeAttachmentRight)); 429 | armorParts.Add(new BodyPartLinker(ModularBodyPart.LegLeft)); 430 | armorParts.Add(new BodyPartLinker(ModularBodyPart.LegRight)); 431 | break; 432 | } 433 | return armorParts; 434 | } 435 | } 436 | } 437 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Editor/ModularArmorCreator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a30cc7ab5380d074bb75f8d1741a7405 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Editor/ModularCharacterEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace BattleDrakeStudios.ModularCharacters { 7 | public class ModularCharacterEditor : EditorWindow { 8 | private ModularCharacterManager characterManager; 9 | private Dictionary characterBody; 10 | private Material characterMaterial; 11 | 12 | private Color primaryColor; 13 | private Color secondaryColor; 14 | private Color leatherPrimaryColor; 15 | private Color leatherSecondaryColor; 16 | private Color metalPrimaryColor; 17 | private Color metalSecondaryColor; 18 | private Color metalDarkColor; 19 | private Color hairColor; 20 | private Color skinColor; 21 | private Color stubbleColor; 22 | private Color scarColor; 23 | private Color bodyArtColor; 24 | private Color eyeColor; 25 | 26 | private string primaryProperty = "_Color_Primary"; 27 | private string secondaryProperty = "_Color_Secondary"; 28 | private string leatherPrimaryProperty = "_Color_Leather_Primary"; 29 | private string leatherSecondaryProperty = "_Color_Leather_Secondary"; 30 | private string metalPrimaryProperty = "_Color_Metal_Primary"; 31 | private string metalSecondaryProperty = "_Color_Metal_Secondary"; 32 | private string metalDarkProperty = "_Color_Metal_Dark"; 33 | private string hairProperty = "_Color_Hair"; 34 | private string skinProperty = "_Color_Skin"; 35 | private string stubbleProperty = "_Color_Stubble"; 36 | private string scarProperty = "_Color_Scar"; 37 | private string bodyArtProperty = "_Color_BodyArt"; 38 | private string eyesProperty = "_Color_Eyes"; 39 | 40 | private int helmetCurrentIndex; 41 | private int helmetMaxIndex; 42 | 43 | private int headAttachmentCurrentIndex; 44 | private int headAttachmentMaxIndex; 45 | 46 | private int headCurrentIndex; 47 | private int headMaxIndex; 48 | 49 | private int hatCurrentIndex; 50 | private int hatMaxIndex; 51 | 52 | private int maskCurrentIndex; 53 | private int maskMaxIndex; 54 | 55 | private int headCoveringCurrentIndex; 56 | private int headCoveringMaxIndex; 57 | 58 | private int hairCurrentIndex; 59 | private int hairMaxIndex; 60 | 61 | private int eyebrowCurrentIndex; 62 | private int eyebrowMaxIndex; 63 | 64 | private int earCurrentIndex; 65 | private int earMaxIndex; 66 | 67 | private int facialHairCurrentIndex; 68 | private int facialHairMaxIndex; 69 | 70 | private int backAttachmentCurrentIndex; 71 | private int backAttachmentMaxIndex; 72 | 73 | private int torsoCurrentIndex; 74 | private int torsoMaxIndex; 75 | 76 | private int shoulderAttachmentRightCurrentIndex; 77 | private int shoulderAttachmentRightMaxIndex; 78 | 79 | private int shoulderAttachmentLeftCurrentIndex; 80 | private int shoulderAttachmentLeftMaxIndex; 81 | 82 | private int armUpperRightCurrentIndex; 83 | private int armUpperRightMaxIndex; 84 | 85 | private int armUpperLeftCurrentIndex; 86 | private int armUpperLeftMaxIndex; 87 | 88 | private int elbowAttachmentRightCurrentIndex; 89 | private int elbowAttachmentRightMaxIndex; 90 | 91 | private int elbowAttachmentLeftCurrentIndex; 92 | private int elbowAttachmentLeftMaxIndex; 93 | 94 | private int armLowerRightCurrentIndex; 95 | private int armLowerRightMaxIndex; 96 | 97 | private int armLowerLeftCurrentIndex; 98 | private int armLowerLeftMaxIndex; 99 | 100 | private int handRightCurrentIndex; 101 | private int handRightMaxIndex; 102 | 103 | private int handLeftCurrentIndex; 104 | private int handLeftMaxIndex; 105 | 106 | private int hipsAttachmentCurrentIndex; 107 | private int hipsAttachmentMaxIndex; 108 | 109 | private int hipsCurrentIndex; 110 | private int hipsMaxIndex; 111 | 112 | private int kneeAttachmentRightCurrentIndex; 113 | private int kneeAttachmentRightMaxIndex; 114 | 115 | private int kneeAttachmentLeftCurrentIndex; 116 | private int kneeAttachmentLeftMaxIndex; 117 | 118 | private int legRightCurrentIndex; 119 | private int legRightMaxIndex; 120 | 121 | private int legLeftCurrentIndex; 122 | private int legLeftMaxIndex; 123 | 124 | private Vector2 scrollPos; 125 | private bool selectionInitialized; 126 | 127 | [MenuItem("BattleDrakeStudios/ModularCharacter/CharacterEditor")] 128 | public static void ShowWindow() { 129 | ModularCharacterEditor editorWindow = EditorWindow.GetWindow(); 130 | editorWindow.titleContent = new GUIContent("Modular Character Editor"); 131 | editorWindow.Show(); 132 | } 133 | 134 | private void OnEnable() { 135 | Undo.undoRedoPerformed += UndoPerformed; 136 | } 137 | private void OnDisable() { 138 | Undo.undoRedoPerformed -= UndoPerformed; 139 | } 140 | 141 | private void UndoPerformed() { 142 | if (Selection.activeGameObject) { 143 | characterManager = Selection.activeGameObject.GetComponent(); 144 | if (characterManager != null) { 145 | if (characterManager.IsInitialized) { 146 | InitializeColors(); 147 | } 148 | } 149 | } 150 | } 151 | 152 | private void OnSelectionChange() { 153 | selectionInitialized = false; 154 | 155 | if (Selection.activeGameObject != null) { 156 | characterManager = Selection.activeGameObject.GetComponent(); 157 | if (characterManager != null) { 158 | if (characterManager.IsInitialized) { 159 | InitializeBodyParts(); 160 | InitializeColors(); 161 | } 162 | 163 | } 164 | } 165 | Repaint(); 166 | } 167 | 168 | private void OnInspectorUpdate() { 169 | if (Selection.activeGameObject != null) { 170 | if (characterManager == null) { 171 | characterManager = Selection.activeGameObject.GetComponent(); 172 | 173 | } 174 | if (characterManager != null) 175 | if (characterManager.gameObject == Selection.activeGameObject) { 176 | if (characterManager.IsInitialized) { 177 | if (!selectionInitialized) { 178 | InitializeBodyParts(); 179 | InitializeColors(); 180 | } 181 | } 182 | } else { 183 | selectionInitialized = false; 184 | characterManager = Selection.activeGameObject.GetComponent(); 185 | } 186 | 187 | Repaint(); 188 | } 189 | } 190 | 191 | private void InitializeBodyParts() { 192 | characterBody = characterManager.GetCharacterBody(); 193 | 194 | SetupBodyPart(ModularBodyPart.Helmet, ref helmetCurrentIndex, ref helmetMaxIndex); 195 | SetupBodyPart(ModularBodyPart.HeadAttachment, ref headAttachmentCurrentIndex, ref headAttachmentMaxIndex); 196 | SetupBodyPart(ModularBodyPart.Head, ref headCurrentIndex, ref headMaxIndex); 197 | SetupBodyPart(ModularBodyPart.Hat, ref hatCurrentIndex, ref hatMaxIndex); 198 | SetupBodyPart(ModularBodyPart.Mask, ref maskCurrentIndex, ref maskMaxIndex); 199 | SetupBodyPart(ModularBodyPart.HeadCovering, ref headCoveringCurrentIndex, ref headCoveringMaxIndex); 200 | SetupBodyPart(ModularBodyPart.Hair, ref hairCurrentIndex, ref hairMaxIndex); 201 | SetupBodyPart(ModularBodyPart.Eyebrow, ref eyebrowCurrentIndex, ref eyebrowMaxIndex); 202 | SetupBodyPart(ModularBodyPart.Ear, ref earCurrentIndex, ref earMaxIndex); 203 | SetupBodyPart(ModularBodyPart.FacialHair, ref facialHairCurrentIndex, ref facialHairMaxIndex); 204 | SetupBodyPart(ModularBodyPart.BackAttachment, ref backAttachmentCurrentIndex, ref backAttachmentMaxIndex); 205 | SetupBodyPart(ModularBodyPart.Torso, ref torsoCurrentIndex, ref torsoMaxIndex); 206 | SetupBodyPart(ModularBodyPart.ShoulderAttachmentRight, ref shoulderAttachmentRightCurrentIndex, ref shoulderAttachmentRightMaxIndex); 207 | SetupBodyPart(ModularBodyPart.ShoulderAttachmentLeft, ref shoulderAttachmentLeftCurrentIndex, ref shoulderAttachmentLeftMaxIndex); 208 | SetupBodyPart(ModularBodyPart.ArmUpperRight, ref armUpperRightCurrentIndex, ref armUpperRightMaxIndex); 209 | SetupBodyPart(ModularBodyPart.ArmUpperLeft, ref armUpperLeftCurrentIndex, ref armUpperLeftMaxIndex); 210 | SetupBodyPart(ModularBodyPart.ElbowAttachmentRight, ref elbowAttachmentRightCurrentIndex, ref elbowAttachmentRightMaxIndex); 211 | SetupBodyPart(ModularBodyPart.ElbowAttachmentLeft, ref elbowAttachmentLeftCurrentIndex, ref elbowAttachmentLeftMaxIndex); 212 | SetupBodyPart(ModularBodyPart.ArmLowerRight, ref armLowerRightCurrentIndex, ref armLowerRightMaxIndex); 213 | SetupBodyPart(ModularBodyPart.ArmLowerLeft, ref armLowerLeftCurrentIndex, ref armLowerLeftMaxIndex); 214 | SetupBodyPart(ModularBodyPart.HandRight, ref handRightCurrentIndex, ref handRightMaxIndex); 215 | SetupBodyPart(ModularBodyPart.HandLeft, ref handLeftCurrentIndex, ref handLeftMaxIndex); 216 | SetupBodyPart(ModularBodyPart.HipsAttachment, ref hipsAttachmentCurrentIndex, ref hipsAttachmentMaxIndex); 217 | SetupBodyPart(ModularBodyPart.Hips, ref hipsCurrentIndex, ref hipsMaxIndex); 218 | SetupBodyPart(ModularBodyPart.KneeAttachmentRight, ref kneeAttachmentRightCurrentIndex, ref kneeAttachmentRightMaxIndex); 219 | SetupBodyPart(ModularBodyPart.KneeAttachmentLeft, ref kneeAttachmentLeftCurrentIndex, ref kneeAttachmentLeftMaxIndex); 220 | SetupBodyPart(ModularBodyPart.LegRight, ref legRightCurrentIndex, ref legRightMaxIndex); 221 | SetupBodyPart(ModularBodyPart.LegLeft, ref legLeftCurrentIndex, ref legLeftMaxIndex); 222 | 223 | selectionInitialized = true; 224 | } 225 | 226 | private void InitializeColors() { 227 | characterMaterial = characterManager.CharacterMaterial; 228 | 229 | primaryColor = characterMaterial.GetColor(primaryProperty); 230 | secondaryColor = characterMaterial.GetColor(secondaryProperty); 231 | leatherPrimaryColor = characterMaterial.GetColor(leatherPrimaryProperty); 232 | leatherSecondaryColor = characterMaterial.GetColor(leatherSecondaryProperty); 233 | metalPrimaryColor = characterMaterial.GetColor(metalPrimaryProperty); 234 | metalSecondaryColor = characterMaterial.GetColor(metalSecondaryProperty); 235 | metalDarkColor = characterMaterial.GetColor(metalDarkProperty); 236 | hairColor = characterMaterial.GetColor(hairProperty); 237 | skinColor = characterMaterial.GetColor(skinProperty); 238 | stubbleColor = characterMaterial.GetColor(stubbleProperty); 239 | scarColor = characterMaterial.GetColor(scarProperty); 240 | bodyArtColor = characterMaterial.GetColor(bodyArtProperty); 241 | eyeColor = characterMaterial.GetColor(eyesProperty); 242 | } 243 | 244 | private void SetupBodyPart(ModularBodyPart bodyPart, ref int index, ref int maxIndex) { 245 | if (characterBody.TryGetValue(bodyPart, out GameObject[] partsArray)) { 246 | maxIndex = partsArray.Length - 1; 247 | bool hasActivePart = false; 248 | for (int i = 0; i < partsArray.Length; i++) { 249 | if (partsArray[i].activeSelf) { 250 | index = i; 251 | hasActivePart = true; 252 | } 253 | } 254 | if (!hasActivePart) 255 | index = -1; 256 | } else { 257 | index = -1; 258 | } 259 | } 260 | 261 | private void OnGUI() { 262 | if (Selection.activeGameObject != null) { 263 | if (characterManager != null) { 264 | if (!characterManager.IsInitialized) { 265 | GUILayout.Label("You must initialize character before using the editor"); 266 | if (GUILayout.Button("Open Setup Wizard")) { 267 | ModularSetupWizard.ShowWizard(); 268 | } 269 | return; 270 | } 271 | 272 | GUILayout.BeginHorizontal(); 273 | 274 | GUILayout.BeginVertical(); 275 | scrollPos = GUILayout.BeginScrollView(scrollPos); 276 | 277 | SetupPartSlider(ModularBodyPart.Helmet, ref helmetCurrentIndex, helmetMaxIndex); 278 | SetupPartSlider(ModularBodyPart.HeadAttachment, ref headAttachmentCurrentIndex, headAttachmentMaxIndex); 279 | SetupPartSlider(ModularBodyPart.Head, ref headCurrentIndex, headMaxIndex); 280 | SetupPartSlider(ModularBodyPart.Hat, ref hatCurrentIndex, hatMaxIndex); 281 | SetupPartSlider(ModularBodyPart.Mask, ref maskCurrentIndex, maskMaxIndex); 282 | SetupPartSlider(ModularBodyPart.HeadCovering, ref headCoveringCurrentIndex, headCoveringMaxIndex); 283 | SetupPartSlider(ModularBodyPart.Hair, ref hairCurrentIndex, hairMaxIndex); 284 | SetupPartSlider(ModularBodyPart.Eyebrow, ref eyebrowCurrentIndex, eyebrowMaxIndex); 285 | SetupPartSlider(ModularBodyPart.Ear, ref earCurrentIndex, earMaxIndex); 286 | SetupPartSlider(ModularBodyPart.FacialHair, ref facialHairCurrentIndex, facialHairMaxIndex); 287 | SetupPartSlider(ModularBodyPart.BackAttachment, ref backAttachmentCurrentIndex, backAttachmentMaxIndex); 288 | SetupPartSlider(ModularBodyPart.Torso, ref torsoCurrentIndex, torsoMaxIndex); 289 | SetupPartSlider(ModularBodyPart.ShoulderAttachmentRight, ref shoulderAttachmentRightCurrentIndex, shoulderAttachmentRightMaxIndex); 290 | SetupPartSlider(ModularBodyPart.ShoulderAttachmentLeft, ref shoulderAttachmentLeftCurrentIndex, shoulderAttachmentLeftMaxIndex); 291 | SetupPartSlider(ModularBodyPart.ArmUpperRight, ref armUpperRightCurrentIndex, armUpperRightMaxIndex); 292 | SetupPartSlider(ModularBodyPart.ArmUpperLeft, ref armUpperLeftCurrentIndex, armUpperLeftMaxIndex); 293 | SetupPartSlider(ModularBodyPart.ElbowAttachmentRight, ref elbowAttachmentRightCurrentIndex, elbowAttachmentRightMaxIndex); 294 | SetupPartSlider(ModularBodyPart.ElbowAttachmentLeft, ref elbowAttachmentLeftCurrentIndex, elbowAttachmentLeftMaxIndex); 295 | SetupPartSlider(ModularBodyPart.ArmLowerRight, ref armLowerRightCurrentIndex, armLowerRightMaxIndex); 296 | SetupPartSlider(ModularBodyPart.ArmLowerLeft, ref armLowerLeftCurrentIndex, armLowerLeftMaxIndex); 297 | SetupPartSlider(ModularBodyPart.HandRight, ref handRightCurrentIndex, handRightMaxIndex); 298 | SetupPartSlider(ModularBodyPart.HandLeft, ref handLeftCurrentIndex, handLeftMaxIndex); 299 | SetupPartSlider(ModularBodyPart.HipsAttachment, ref hipsAttachmentCurrentIndex, hipsAttachmentMaxIndex); 300 | SetupPartSlider(ModularBodyPart.Hips, ref hipsCurrentIndex, hipsMaxIndex); 301 | SetupPartSlider(ModularBodyPart.KneeAttachmentRight, ref kneeAttachmentRightCurrentIndex, kneeAttachmentRightMaxIndex); 302 | SetupPartSlider(ModularBodyPart.KneeAttachmentLeft, ref kneeAttachmentLeftCurrentIndex, kneeAttachmentLeftMaxIndex); 303 | SetupPartSlider(ModularBodyPart.LegRight, ref legRightCurrentIndex, legRightMaxIndex); 304 | SetupPartSlider(ModularBodyPart.LegLeft, ref legLeftCurrentIndex, legLeftMaxIndex); 305 | 306 | GUILayout.EndScrollView(); 307 | 308 | GUILayout.EndVertical(); 309 | 310 | GUILayout.BeginVertical(); 311 | 312 | GUILayout.BeginHorizontal(); 313 | if (GUILayout.Button("Male")) { 314 | characterManager.SwapGender(Gender.Male); 315 | InitializeBodyParts(); 316 | } 317 | if (GUILayout.Button("Female")) { 318 | characterManager.SwapGender(Gender.Female); 319 | InitializeBodyParts(); 320 | } 321 | GUILayout.EndHorizontal(); 322 | 323 | SetupColorFields(ref primaryColor, "Primary Color", primaryProperty); 324 | SetupColorFields(ref secondaryColor, "Secondary Color", secondaryProperty); 325 | SetupColorFields(ref leatherPrimaryColor, "Leather Primary Color", leatherPrimaryProperty); 326 | SetupColorFields(ref leatherSecondaryColor, "Leather Secondary Color", leatherSecondaryProperty); 327 | SetupColorFields(ref metalPrimaryColor, "Metal Primary Color", metalPrimaryProperty); 328 | SetupColorFields(ref metalSecondaryColor, "Metal Secondary Color", metalSecondaryProperty); 329 | SetupColorFields(ref metalDarkColor, "Metal Dark Color", metalDarkProperty); 330 | SetupColorFields(ref hairColor, "Hair Color", hairProperty); 331 | SetupColorFields(ref skinColor, "Skin Color", skinProperty); 332 | SetupColorFields(ref stubbleColor, "Stubble Color", stubbleProperty); 333 | SetupColorFields(ref scarColor, "Scar Color", scarProperty); 334 | SetupColorFields(ref bodyArtColor, "BodyArt Color", bodyArtProperty); 335 | SetupColorFields(ref eyeColor, "Eye Color", eyesProperty); 336 | 337 | GUILayout.EndVertical(); 338 | 339 | GUILayout.EndHorizontal(); 340 | } else { 341 | GUILayout.BeginVertical(); 342 | 343 | GUILayout.Label("Target does not have a ModularManager component attached."); 344 | if (GUILayout.Button("Open Setup Wizard")) { 345 | ModularSetupWizard.ShowWizard(); 346 | } 347 | 348 | GUILayout.EndVertical(); 349 | } 350 | } 351 | } 352 | 353 | private void SetupColorFields(ref Color partColor, string label, string shaderProperty) { 354 | EditorGUI.BeginChangeCheck(); 355 | partColor = EditorGUILayout.ColorField(label, partColor); 356 | if (EditorGUI.EndChangeCheck()) { 357 | Undo.RecordObject(characterMaterial, "Undo Color change"); 358 | characterMaterial.SetColor(shaderProperty, partColor); 359 | } 360 | } 361 | 362 | private void SetupPartSlider(ModularBodyPart bodyPart, ref int partIndex, int maxIndex) { 363 | EditorGUI.BeginChangeCheck(); 364 | partIndex = EditorGUILayout.IntSlider(bodyPart.ToString(), partIndex, -1, maxIndex); 365 | if (EditorGUI.EndChangeCheck()) { 366 | if (partIndex == -1) 367 | characterManager.DeactivatePart(bodyPart); 368 | else 369 | characterManager.ActivatePart(bodyPart, partIndex); 370 | } 371 | 372 | } 373 | } 374 | } 375 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Editor/ModularCharacterEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 845e6fc73a2d5544c94ef832ef366504 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Editor/ModularSetupWizard.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | namespace BattleDrakeStudios.ModularCharacters { 5 | public class ModularSetupWizard : EditorWindow { 6 | private enum SetupState { 7 | SelectGameObject, 8 | SelectExisting, 9 | SelectGenderOption, 10 | SelectMaterialOption, 11 | SetupDuplicateMaterial, 12 | SetupExistingMaterial, 13 | Ready 14 | } 15 | 16 | private ModularCharacterManager characterManager; 17 | 18 | private SetupState currentState = SetupState.SelectGameObject; 19 | 20 | private bool isExistingCharacter; 21 | private Gender characterGender; 22 | private Material characterMat; 23 | private string materialName; 24 | private bool isNewMaterial; 25 | 26 | [MenuItem("BattleDrakeStudios/ModularCharacter/SetupWizard")] 27 | public static void ShowWizard() { 28 | ModularSetupWizard wizardWindow = GetWindow(); 29 | wizardWindow.titleContent = new GUIContent("Setup Wizard"); 30 | wizardWindow.maxSize = new Vector2(400.0f, 200.0f); 31 | wizardWindow.minSize = wizardWindow.maxSize; 32 | wizardWindow.autoRepaintOnSceneChange = true; 33 | wizardWindow.Show(); 34 | } 35 | 36 | private void OnSelectionChange() { 37 | if (Selection.activeGameObject != null) { 38 | characterManager = Selection.activeGameObject.GetComponent(); 39 | if (characterManager != null) { 40 | isExistingCharacter = false; 41 | isNewMaterial = false; 42 | currentState = SetupState.SelectExisting; 43 | } else 44 | currentState = SetupState.SelectGameObject; 45 | } 46 | Repaint(); 47 | } 48 | 49 | private void OnInspectorUpdate() { 50 | if (Selection.activeGameObject != null) { 51 | if (characterManager == null) { 52 | characterManager = Selection.activeGameObject.GetComponent(); 53 | if (characterManager != null) 54 | currentState = SetupState.SelectExisting; 55 | else 56 | currentState = SetupState.SelectGameObject; 57 | Repaint(); 58 | } 59 | 60 | if (currentState == SetupState.SelectGameObject) { 61 | characterManager = Selection.activeGameObject.GetComponent(); 62 | if (characterManager != null) 63 | currentState = SetupState.SelectExisting; 64 | Repaint(); 65 | } 66 | } 67 | } 68 | 69 | private void OnGUI() { 70 | if (Selection.activeGameObject == null) 71 | return; 72 | 73 | if (characterManager != null) 74 | if (characterManager.IsInitialized) { 75 | GUILayout.Label("Character is initialized!"); 76 | return; 77 | } 78 | 79 | 80 | switch (currentState) { 81 | case SetupState.SelectGameObject: 82 | if (characterManager == null) { 83 | GUILayout.BeginVertical(); 84 | 85 | GUILayout.Label("Please select a gameobject with the ModularManager script attached."); 86 | GUILayout.Label("Add one to selected gameobject?"); 87 | if (GUILayout.Button("Add ModularManager Component")) { 88 | Selection.activeGameObject.AddComponent(); 89 | currentState = SetupState.SelectExisting; 90 | } 91 | 92 | GUILayout.EndVertical(); 93 | } 94 | break; 95 | 96 | case SetupState.SelectExisting: 97 | GUILayout.BeginVertical(); 98 | 99 | GUILayout.Label("Is this a new or existing character?"); 100 | 101 | GUILayout.BeginHorizontal(); 102 | SetIsExisting(); 103 | GUILayout.EndHorizontal(); 104 | 105 | GUILayout.EndVertical(); 106 | break; 107 | 108 | case SetupState.SelectGenderOption: 109 | GUILayout.BeginVertical(); 110 | 111 | GUILayout.Label("Is it a male or female? (You can change this in the editor later)"); 112 | 113 | GUILayout.BeginHorizontal(); 114 | SetCharacterGender(); 115 | GUILayout.EndHorizontal(); 116 | 117 | GUILayout.EndVertical(); 118 | break; 119 | 120 | case SetupState.SelectMaterialOption: 121 | GUILayout.BeginVertical(); 122 | 123 | GUILayout.Label("Use existing material or create duplicate?"); 124 | 125 | GUILayout.BeginHorizontal(); 126 | if (GUILayout.Button("Create Duplicate")) 127 | currentState = SetupState.SetupDuplicateMaterial; 128 | else if (GUILayout.Button("Use Existing")) { 129 | currentState = SetupState.SetupExistingMaterial; 130 | } 131 | GUILayout.EndHorizontal(); 132 | 133 | GUILayout.EndVertical(); 134 | break; 135 | 136 | case SetupState.SetupDuplicateMaterial: 137 | GUILayout.BeginVertical(); 138 | 139 | GUILayout.Label("Please insert the material to dupliate"); 140 | characterMat = EditorGUILayout.ObjectField(characterMat, typeof(Material), false) as Material; 141 | 142 | GUILayout.Label("Please enter a name for the duplicate material."); 143 | GUILayout.Label("(saves to: BattleDrakeStudios/ModularCharacterEditor/Materials"); 144 | materialName = GUILayout.TextField(materialName); 145 | if (!string.IsNullOrEmpty(materialName) && characterMat != null) { 146 | if (GUILayout.Button("Continue")) { 147 | characterMat = new Material(characterMat); 148 | characterMat.name = materialName; 149 | isNewMaterial = true; 150 | currentState = SetupState.Ready; 151 | } 152 | } 153 | 154 | 155 | GUILayout.EndVertical(); 156 | break; 157 | 158 | case SetupState.SetupExistingMaterial: 159 | GUILayout.BeginVertical(); 160 | 161 | GUILayout.Label("Please insert the desired material"); 162 | characterMat = EditorGUILayout.ObjectField(characterMat, typeof(Material), false) as Material; 163 | 164 | if (characterMat != null) { 165 | if (GUILayout.Button("Continue")) { 166 | currentState = SetupState.Ready; 167 | } 168 | } 169 | 170 | if (GUILayout.Button("Return")) 171 | currentState = SetupState.SelectMaterialOption; 172 | break; 173 | 174 | case SetupState.Ready: 175 | GUILayout.BeginVertical(); 176 | 177 | GUILayout.BeginHorizontal(); 178 | GUILayout.Label("Character: "); 179 | if (isExistingCharacter) 180 | GUILayout.Label("Existing"); 181 | else 182 | GUILayout.Label("New"); 183 | GUILayout.EndHorizontal(); 184 | 185 | GUILayout.BeginHorizontal(); 186 | GUILayout.Label("Gender: "); 187 | if (characterGender == Gender.Male) 188 | GUILayout.Label("Male"); 189 | else 190 | GUILayout.Label("Female"); 191 | GUILayout.EndHorizontal(); 192 | 193 | GUILayout.BeginHorizontal(); 194 | GUILayout.Label("Material: "); 195 | GUILayout.Label(characterMat.name); 196 | GUILayout.EndHorizontal(); 197 | 198 | if (GUILayout.Button("Commit")) { 199 | CommitChanges(false); 200 | } 201 | if (GUILayout.Button("Commit and Show Editor")) { 202 | CommitChanges(true); 203 | } 204 | if (GUILayout.Button("Reset")) { 205 | currentState = SetupState.SelectExisting; 206 | isExistingCharacter = false; 207 | isNewMaterial = false; 208 | } 209 | 210 | GUILayout.EndVertical(); 211 | break; 212 | } 213 | } 214 | 215 | private void SetIsExisting() { 216 | if (GUILayout.Button("New")) { 217 | isExistingCharacter = false; 218 | currentState = SetupState.SelectGenderOption; 219 | } else if (GUILayout.Button("Existing")) { 220 | isExistingCharacter = true; 221 | currentState = SetupState.SelectGenderOption; 222 | } 223 | } 224 | 225 | private void SetCharacterGender() { 226 | if (GUILayout.Button("Male")) { 227 | characterGender = Gender.Male; 228 | currentState = SetupState.SelectMaterialOption; 229 | } else if (GUILayout.Button("Female")) { 230 | characterGender = Gender.Female; 231 | currentState = SetupState.SelectMaterialOption; 232 | } 233 | } 234 | 235 | private void CommitChanges(bool openEditor) { 236 | if (isNewMaterial) { 237 | if(!AssetDatabase.IsValidFolder("Assets/BattleDrakeStudios/ModularCharacterEditor/Materials")) { 238 | AssetDatabase.CreateFolder("Assets/BattleDrakeStudios/ModularCharacterEditor", "Materials"); 239 | } 240 | AssetDatabase.CreateAsset(characterMat, "Assets/BattleDrakeStudios/ModularCharacterEditor/Materials/" + materialName + ".mat"); 241 | } 242 | 243 | 244 | if (isExistingCharacter) { 245 | characterManager.SetupExistingCharacter(characterGender, characterMat); 246 | } else { 247 | characterManager.SetupNewCharacter(characterGender, characterMat); 248 | } 249 | 250 | if (openEditor) { 251 | ModularCharacterEditor.ShowWindow(); 252 | } 253 | 254 | isExistingCharacter = false; 255 | isNewMaterial = false; 256 | } 257 | } 258 | } 259 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Editor/ModularSetupWizard.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2181fece4170b5b4095e00406c43480d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/ModularCharacterEditorReadme.txt: -------------------------------------------------------------------------------- 1 | Visit https://youtu.be/ljYOAoZYQOw and https://youtu.be/Pg6UZSdqKrYfor for video showcasing of the tool and it's use. 2 | 3 | Steps to get up and running: 4 | 5 | 1. After installing package, drag and drop a Synty Modular Fantasy Hero model into the scene. 6 | The model can be the base model with no material assignments, the prefab with material assignments, any of the presets, or a custom character you've designed; 7 | as long as you kept the original hierarchy intact. 8 | 9 | 2. Add the ModularCharacterManager Component to the gameobject. This asset works by searching all the transforms of the object to find the necessary parts, 10 | so the component can be placed on the model gameobject, or a parent if that's your setup. 11 | Alternatively, you can just highlight the gameobject, and go into the new menu option ModularCharacter and select SetupWizard. 12 | This will give you the option to add the component through the custom editor. 13 | 14 | 3. After the component is added, select whether this is a new character or existing. New means you are setting up the character and resetting all it's parts to a base form. 15 | Existing means you are setting up a character, but keeping all the currently active parts on and registered. Do this if you want to keep a model looking exactly as it is. 16 | 17 | 4. Choose whether the model is male or female. If it's a new character, your choice can be changed in the editor. 18 | If it's an existing, make sure to match the gender with the currently active parts in order to make sure the parts are correctly registered to the right lists. 19 | 20 | 5. Create duplicate or use existing material. Creating a duplicate will have you select a material that will be duplicated and saved to BattleDrakeStudios/ModularCharacterEditor/Materials. 21 | Existing will have you choose a material that will be shared with any other objects that use that material. 22 | The material to be selected will need to be one of Synty's or one that uses their shader in order to for the tool to recognize the Shader Properties. 23 | 24 | 7. You will then be presented with the options to Commit which will initialize the character. 25 | Commit and Show Editor will initialize and automatically load the custom editor tool for modification. 26 | Reset will start over from the beginning. 27 | 28 | 8. Once initialized, your character is ready to go. Any changes can be made with the Modular Editor. 29 | Values for the parts range from -1 to all the parts currently registered under their respective hierarchies; 30 | -1 disables all active parts under that category and is a value used for the editor tool only. Disabling a part through the component requires only calling the DeactivatePart method with the bodypart. 31 | You can swap the gender between male and female at any stage and all parts will remain the same except eyebrows(male forms have more, so the value is reset to avoid an index out of bounds issue). 32 | Colors can be changed and are linked with Unity's Undo system making it easy to reverse any unwanted changes to the color system. 33 | 34 | 9. While the component is active and initialized, you have access to all the parts and the arrays that store them. 35 | The parts are arranged into two dictionaries for easy access and manipulation in game. 36 | To activate a part, you can call the method ActivePart in the ModularCharacterManager component class, passing in an enum ModularBodyPart for the part to activate, and the int partID which is the index of it within it's array. 37 | (the number in the Modular Editor is the correct partID you can use unless you wish to deactivate. Don't use -1, that's for the tool only). 38 | The activepart method will automatically deactivate any currently active parts for that particular bodypart, meaning no direct deactivating is required when activating another part. 39 | If you wish to deactivate a part manually, however, you can do so using the DeactivatePart method, putting in only the ModularBodyPart you wish to deactivate. 40 | 41 | ARMOR CREATOR TOOL: 42 | 43 | A new tool added to the original pack. This tool allows you to create custom armor pieces to attach to your character like in many popular MMO's. Steps to get it working. 44 | 45 | 1. Setup a new character from the Synty prefab. Choose the gender you wish as the base(can toggle between in the tool). Use an existing material, select fantasy hero. 46 | (The other materials are not functioning properly. An issue with Synty's pack, not mine). Commit changes. 47 | 2. Rename gameobject to "Pf_ArmorCreatorBase" without the quotations. 48 | 3. Create a Resources folder in your Assets project folder. 49 | 4. Drag and drop the gameobject into the resources folder. 50 | 5. Go into BattleDrakeStudios menu, select ModularCharacters > ArmorCreator. 51 | 6. Tool is now loaded! Preview window can be manipulated with different mouse buttons. Left Mouse button to rotate back and forth, and spin. Right mouse button to roll. 52 | Holding scroll/middle mouse button will reposition. Scrollwheel will zoom in and out. Holding shift will increase the speed of these functions. 53 | 7. Dropdown to select armor parts. If you wish to setup your own custom popup, access the enum class ModularArmorType and set up the different armor selections. Aftewards, 54 | go into the ModularArmorCreator class and scroll to the very bottom. There is a method to setup which parts are associated with each option. Name the cases to match your enum, 55 | then add the parts you want associated with the enum value to its case block. 56 | Afterwards, the tool should automatically populate the options for you. No further configuration needed. Create the item using your settings, and the created modularpart will reflect those changes. 57 | 8. After creating the item, you can create an icon using the built in Icon Creator. The tool was also released as a standalone, but i've included in this pack for you, and all setup with the tool. 58 | You can use it to create icons of the modular pieces, or any prefabs you drag and drop into the object field. The tool will work independently of the charactereditor. 59 | 9. After created the armorpart, it'll be created as a ModularArmor scriptableobject. Use your existing item structure, or create an item scriptable object from the asset menu I created for you. 60 | 10. Drag the modulararmor scriptable into the objectfield in the item. 61 | 11. Take an existing initialized character in the scene, and attached the demo EquipmentManager script to it. Make sure to remove the randomizer script if it's still on. 62 | 12. Increase the array size to add the items you want, and drag and drop them into the fields. 63 | 13. Hit play, and watch your item get automatically equipped! Use the equipmentmanager as a reference to how equipment is activated. 64 | 65 | Tips: You'll notice the base always spawns towards the top of the preview view. This is because the preview places the object based on it's privot point, which is at the feet for the modular characters. 66 | To fix this, you can create an empty game object and name it Pf_ArmorCreatorBase. Afterwards, attach the modularfantasy prefab and set it's y position to -1. Run the setup wizard on the parent gameobject. 67 | Drag and drop the prefab into the resources folder. Now your preview object will spawn in the center of the window! 68 | 69 | The youtube video goes over all this and can be used as a reference on how to use the tool. Any additional questions or concerns can be directed to me at battledrakestudios@gmail.com 70 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/ModularCharacterEditorReadme.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7515267071fa8e94abbd1cf1121fe445 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/ScriptableObjects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 456bcfcb6e9dc4a4fb0c1561fe5c7852 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/ScriptableObjects/Items.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e26cedbfecccc044cb7826ba24194b7b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/ScriptableObjects/Items/DemoChest.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 52b8a0014ecdaff40a66b09ce2f9c397, type: 3} 13 | m_Name: DemoChest 14 | m_EditorClassIdentifier: 15 | itemName: DemoChest 16 | modularArmor: {fileID: 11400000, guid: f41d42fe56039d54d9e9177ff394e3cd, type: 2} 17 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/ScriptableObjects/Items/DemoChest.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9c038bdd9d768f419c7fd64c7adf9ec 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/ScriptableObjects/Items/DemoHelmet.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 52b8a0014ecdaff40a66b09ce2f9c397, type: 3} 13 | m_Name: DemoHelmet 14 | m_EditorClassIdentifier: 15 | itemName: DemoHelmet 16 | modularArmor: {fileID: 11400000, guid: f40c6ee020ec93b459373e9e9f9faec6, type: 2} 17 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/ScriptableObjects/Items/DemoHelmet.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc237bfcd9bf12e4ab0fe1d6132372a5 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/ScriptableObjects/ModularArmor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 683b91dbab5ce3a489470a815f591085 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/ScriptableObjects/ModularArmor/BlueCuirass.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 2823cab264e989448ae0ac1a156539d7, type: 3} 13 | m_Name: BlueCuirass 14 | m_EditorClassIdentifier: 15 | armorType: 3 16 | armorColors: 17 | - property: _Color_Primary 18 | color: {r: 0.48235297, g: 0.4156863, b: 0.3529412, a: 0} 19 | - property: _Color_Secondary 20 | color: {r: 0.7019608, g: 0.62352943, b: 0.4666667, a: 0} 21 | - property: _Color_Leather_Primary 22 | color: {r: 0, g: 0.15301485, b: 0.8207547, a: 0} 23 | - property: _Color_Leather_Secondary 24 | color: {r: 0.372549, g: 0.3294118, b: 0.2784314, a: 0} 25 | - property: _Color_Metal_Primary 26 | color: {r: 0.67058825, g: 0.67058825, b: 0.67058825, a: 0} 27 | - property: _Color_Metal_Secondary 28 | color: {r: 0, g: 0.04907897, b: 0.5566038, a: 0} 29 | - property: _Color_Metal_Dark 30 | color: {r: 1, g: 1, b: 1, a: 0} 31 | armorParts: 32 | - bodyType: 11 33 | partID: 16 34 | - bodyType: 15 35 | partID: 9 36 | - bodyType: 14 37 | partID: 9 38 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/ScriptableObjects/ModularArmor/BlueCuirass.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f41d42fe56039d54d9e9177ff394e3cd 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/ScriptableObjects/ModularArmor/HornedHelmet.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 2823cab264e989448ae0ac1a156539d7, type: 3} 13 | m_Name: HornedHelmet 14 | m_EditorClassIdentifier: 15 | armorType: 0 16 | armorColors: 17 | - property: _Color_Primary 18 | color: {r: 0.48235297, g: 0.4156863, b: 0.3529412, a: 0} 19 | - property: _Color_Secondary 20 | color: {r: 0.7019608, g: 0.62352943, b: 0.4666667, a: 0} 21 | - property: _Color_Leather_Primary 22 | color: {r: 0.30882353, g: 0.21390574, b: 0.1589533, a: 0} 23 | - property: _Color_Leather_Secondary 24 | color: {r: 0.372549, g: 0.3294118, b: 0.2784314, a: 0} 25 | - property: _Color_Metal_Primary 26 | color: {r: 0.6698113, g: 0, b: 0, a: 0} 27 | - property: _Color_Metal_Secondary 28 | color: {r: 1, g: 1, b: 1, a: 0} 29 | - property: _Color_Metal_Dark 30 | color: {r: 1, g: 1, b: 1, a: 0} 31 | armorParts: 32 | - bodyType: 1 33 | partID: 6 34 | - bodyType: 0 35 | partID: 5 36 | - bodyType: 5 37 | partID: -1 38 | - bodyType: 3 39 | partID: -1 40 | - bodyType: 4 41 | partID: -1 42 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/ScriptableObjects/ModularArmor/HornedHelmet.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f40c6ee020ec93b459373e9e9f9faec6 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec524427af5b08545b1f9bd7628a5f37 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Components.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d85045c5fb82ca94784ea840cfdfad41 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Components/ModularCharacterManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using UnityEngine; 6 | 7 | namespace BattleDrakeStudios.ModularCharacters { 8 | 9 | [ExecuteInEditMode] 10 | public class ModularCharacterManager : MonoBehaviour { 11 | 12 | [Header("Male Base")] 13 | [SerializeField] private List maleBaseBody = new List(); 14 | 15 | [Header("Female Base")] 16 | [SerializeField] private List femaleBaseBody = new List(); 17 | 18 | [Header("Character Material")] 19 | [SerializeField] private Material characterMaterial; 20 | 21 | [Header("MaleParts Arrays")] 22 | [SerializeField] private GameObject[] maleHelmetParts; 23 | [SerializeField] private GameObject[] maleHeadParts; 24 | [SerializeField] private GameObject[] maleEyebrowParts; 25 | [SerializeField] private GameObject[] maleFacialHairParts; 26 | [SerializeField] private GameObject[] maleTorsoParts; 27 | [SerializeField] private GameObject[] maleArmUpperRightParts; 28 | [SerializeField] private GameObject[] maleArmUpperLeftParts; 29 | [SerializeField] private GameObject[] maleArmLowerRightParts; 30 | [SerializeField] private GameObject[] maleArmLowerLeftParts; 31 | [SerializeField] private GameObject[] maleHandRightParts; 32 | [SerializeField] private GameObject[] maleHandLeftParts; 33 | [SerializeField] private GameObject[] maleHipsParts; 34 | [SerializeField] private GameObject[] maleLegRightParts; 35 | [SerializeField] private GameObject[] maleLegLeftParts; 36 | 37 | [Header("FemaleParts Arrays")] 38 | [SerializeField] private GameObject[] femaleHelmetParts; 39 | [SerializeField] private GameObject[] femaleHeadParts; 40 | [SerializeField] private GameObject[] femaleEyebrowParts; 41 | [SerializeField] private GameObject[] femaleFacialHairParts; 42 | [SerializeField] private GameObject[] femaleTorsoParts; 43 | [SerializeField] private GameObject[] femaleArmUpperRightParts; 44 | [SerializeField] private GameObject[] femaleArmUpperLeftParts; 45 | [SerializeField] private GameObject[] femaleArmLowerRightParts; 46 | [SerializeField] private GameObject[] femaleArmLowerLeftParts; 47 | [SerializeField] private GameObject[] femaleHandRightParts; 48 | [SerializeField] private GameObject[] femaleHandLeftParts; 49 | [SerializeField] private GameObject[] femaleHipsParts; 50 | [SerializeField] private GameObject[] femaleLegRightParts; 51 | [SerializeField] private GameObject[] femaleLegLeftParts; 52 | 53 | [Header("UniversalParts Arrays")] 54 | [SerializeField] private GameObject[] hatParts; 55 | [SerializeField] private GameObject[] maskParts; 56 | [SerializeField] private GameObject[] headCoveringParts; 57 | [SerializeField] private GameObject[] hairParts; 58 | [SerializeField] private GameObject[] earParts; 59 | [SerializeField] private GameObject[] headAttachmentParts; 60 | [SerializeField] private GameObject[] backAttachmentParts; 61 | [SerializeField] private GameObject[] shoulderAttachmentRightParts; 62 | [SerializeField] private GameObject[] shoulderAttachmentLeftParts; 63 | [SerializeField] private GameObject[] elbowAttachmentRightParts; 64 | [SerializeField] private GameObject[] elbowAttachmentLeftParts; 65 | [SerializeField] private GameObject[] hipsAttachmentParts; 66 | [SerializeField] private GameObject[] kneeAttachmentRightParts; 67 | [SerializeField] private GameObject[] kneeAttachmentLeftParts; 68 | 69 | [HideInInspector] 70 | [SerializeField] private List allParts = new List(); 71 | 72 | [HideInInspector] 73 | [SerializeField] private bool isInitialized; 74 | [HideInInspector] 75 | [SerializeField] private Gender characterGender; 76 | 77 | public bool IsInitialized => isInitialized; 78 | public Gender CharacterGender => characterGender; 79 | public Material CharacterMaterial => characterMaterial; 80 | 81 | private Dictionary characterBody = new Dictionary(); 82 | private Dictionary activeParts = new Dictionary(); 83 | 84 | private void OnEnable() { 85 | if (isInitialized) { 86 | InitializeDictionaries(); 87 | } 88 | } 89 | 90 | public void ActivatePart(ModularBodyPart bodyPart, int partID) { 91 | GameObject partToActivate = GetPartFromID(bodyPart, partID); 92 | if (partToActivate != null) { 93 | if (activeParts.TryGetValue(bodyPart, out int activePartID)) { 94 | GetPartFromID(bodyPart, activePartID).SetActive(false); 95 | } 96 | activeParts[bodyPart] = partID; 97 | partToActivate.SetActive(true); 98 | } 99 | } 100 | 101 | public void DeactivatePart(ModularBodyPart bodyPart) { 102 | if (activeParts.ContainsKey(bodyPart)) { 103 | GetPartFromID(bodyPart, activeParts[bodyPart]).SetActive(false); 104 | activeParts.Remove(bodyPart); 105 | } 106 | } 107 | 108 | public void SetPartColor(ModularBodyPart bodyPart, int partID, string colorProperty, Color newColor) { 109 | GameObject part = GetPartFromID(bodyPart, partID); 110 | if (part != null) { 111 | /* Learned this method of color setting only affects instanced. */ 112 | part.GetComponent().material.SetColor(colorProperty, newColor); 113 | } 114 | 115 | } 116 | 117 | public void SetAllPartsMaterial(Material material) { 118 | foreach (var part in allParts) { 119 | part.GetComponent().material = material; 120 | } 121 | } 122 | 123 | public void SwapGender(Gender bodyGender) { 124 | this.characterGender = bodyGender; 125 | foreach (var part in activeParts.ToList()) { 126 | GetPartFromID(part.Key, part.Value).SetActive(false); 127 | if (part.Key == ModularBodyPart.Eyebrow) 128 | activeParts.Remove(part.Key); 129 | } 130 | SetupCharacterBodyDictionary(); 131 | foreach (var part in activeParts) { 132 | GetPartFromID(part.Key, part.Value).SetActive(true); 133 | } 134 | } 135 | 136 | public void ToggleBaseBodyDisplay(bool isVisible) { 137 | switch (characterGender) { 138 | case Gender.Male: 139 | foreach (var part in maleBaseBody) { 140 | if (activeParts.ContainsKey(part.bodyType)) 141 | if (activeParts[part.bodyType] == 0) 142 | GetPartFromID(part.bodyType, part.partID).SetActive(isVisible); 143 | } 144 | break; 145 | case Gender.Female: 146 | foreach (var part in femaleBaseBody) { 147 | if (activeParts.ContainsKey(part.bodyType)) 148 | if (activeParts[part.bodyType] == 0) 149 | GetPartFromID(part.bodyType, part.partID).SetActive(isVisible); 150 | } 151 | break; 152 | } 153 | } 154 | 155 | public GameObject GetPartFromID(ModularBodyPart partType, int partID) { 156 | if (characterBody.TryGetValue(partType, out GameObject[] parts)) { 157 | return parts[partID]; 158 | } 159 | Debug.LogError(partType.ToString() + " returned null in ModularManager.GetBodyPart()"); 160 | return null; 161 | } 162 | 163 | public Dictionary GetCharacterBody() { 164 | return characterBody; 165 | } 166 | 167 | [ContextMenu("ClearAll")] 168 | private void ClearAll() { 169 | SetupNewCharacter(characterGender, characterMaterial); 170 | } 171 | 172 | public void SetupNewCharacter(Gender characterGender, Material characterMaterial) { 173 | this.characterMaterial = characterMaterial; 174 | 175 | SetupBodyArrays(false); 176 | 177 | this.characterGender = characterGender; 178 | 179 | InitializeDictionaries(); 180 | 181 | List activeBody = this.characterGender == Gender.Male ? maleBaseBody : femaleBaseBody; 182 | foreach (var part in activeBody) { 183 | GetPartFromID(part.bodyType, part.partID).SetActive(true); 184 | activeParts[part.bodyType] = 0; 185 | } 186 | } 187 | 188 | public void SetupExistingCharacter(Gender characterGender, Material characterMaterial) { 189 | this.characterMaterial = characterMaterial; 190 | this.characterGender = characterGender; 191 | SetupBodyArrays(true); 192 | InitializeDictionaries(); 193 | } 194 | 195 | private void InitializeDictionaries() { 196 | SetupCharacterBodyDictionary(); 197 | SetupActivePartsDictionary(); 198 | } 199 | 200 | #region ArraySetups 201 | private void SetupBodyArrays(bool isExisting) { 202 | SetupPartArray(ref maleHelmetParts, ModularCharacterStatics.MaleHelmetPath, isExisting); 203 | SetupPartArray(ref maleHeadParts, ModularCharacterStatics.MaleHeadPath, isExisting); 204 | SetupPartArray(ref maleEyebrowParts, ModularCharacterStatics.MaleEyebrowPath, isExisting); 205 | SetupPartArray(ref maleFacialHairParts, ModularCharacterStatics.MaleFacialHairPath, isExisting); 206 | SetupPartArray(ref maleTorsoParts, ModularCharacterStatics.MaleTorsoPath, isExisting); 207 | SetupPartArray(ref maleArmUpperRightParts, ModularCharacterStatics.MaleArmUpperRightPath, isExisting); 208 | SetupPartArray(ref maleArmUpperLeftParts, ModularCharacterStatics.MaleArmUpperLeftPath, isExisting); 209 | SetupPartArray(ref maleArmLowerRightParts, ModularCharacterStatics.MaleArmLowerRightPath, isExisting); 210 | SetupPartArray(ref maleArmLowerLeftParts, ModularCharacterStatics.MaleArmLowerLeftPath, isExisting); 211 | SetupPartArray(ref maleHandRightParts, ModularCharacterStatics.MaleHandRightPath, isExisting); 212 | SetupPartArray(ref maleHandLeftParts, ModularCharacterStatics.MaleHandLeftPath, isExisting); 213 | SetupPartArray(ref maleHipsParts, ModularCharacterStatics.MaleHipsPath, isExisting); 214 | SetupPartArray(ref maleLegRightParts, ModularCharacterStatics.MaleLegRightPath, isExisting); 215 | SetupPartArray(ref maleLegLeftParts, ModularCharacterStatics.MaleLegLeftPath, isExisting); 216 | 217 | SetupPartArray(ref femaleHelmetParts, ModularCharacterStatics.FemaleHelmetPath, isExisting); 218 | SetupPartArray(ref femaleHeadParts, ModularCharacterStatics.FemaleHeadPath, isExisting); 219 | SetupPartArray(ref femaleEyebrowParts, ModularCharacterStatics.FemaleEyebrowPath, isExisting); 220 | SetupPartArray(ref femaleFacialHairParts, ModularCharacterStatics.FemaleFacialHairPath, isExisting); 221 | SetupPartArray(ref femaleTorsoParts, ModularCharacterStatics.FemaleTorsoPath, isExisting); 222 | SetupPartArray(ref femaleArmUpperRightParts, ModularCharacterStatics.FemaleArmUpperRightPath, isExisting); 223 | SetupPartArray(ref femaleArmUpperLeftParts, ModularCharacterStatics.FemaleArmUpperLeftPath, isExisting); 224 | SetupPartArray(ref femaleArmLowerRightParts, ModularCharacterStatics.FemaleArmLowerRightPath, isExisting); 225 | SetupPartArray(ref femaleArmLowerLeftParts, ModularCharacterStatics.FemaleArmLowerLeftPath, isExisting); 226 | SetupPartArray(ref femaleHandRightParts, ModularCharacterStatics.FemaleHandRightPath, isExisting); 227 | SetupPartArray(ref femaleHandLeftParts, ModularCharacterStatics.FemaleHandLeftPath, isExisting); 228 | SetupPartArray(ref femaleHipsParts, ModularCharacterStatics.FemaleHipsPath, isExisting); 229 | SetupPartArray(ref femaleLegRightParts, ModularCharacterStatics.FemaleLegRightPath, isExisting); 230 | SetupPartArray(ref femaleLegLeftParts, ModularCharacterStatics.FemaleLegLeftPath, isExisting); 231 | 232 | SetupPartArray(ref hatParts, ModularCharacterStatics.HatPath, isExisting); 233 | SetupPartArray(ref maskParts, ModularCharacterStatics.MaskPath, isExisting); 234 | SetupPartArray(ref headCoveringParts, ModularCharacterStatics.HeadCoveringPath, isExisting); 235 | SetupPartArray(ref hairParts, ModularCharacterStatics.HairPath, isExisting); 236 | SetupPartArray(ref earParts, ModularCharacterStatics.EarPath, isExisting); 237 | SetupPartArray(ref headAttachmentParts, ModularCharacterStatics.HeadAttachmentPath, isExisting); 238 | SetupPartArray(ref backAttachmentParts, ModularCharacterStatics.BackAttachmentPath, isExisting); 239 | SetupPartArray(ref shoulderAttachmentRightParts, ModularCharacterStatics.ShoulderAttachmentRightPath, isExisting); 240 | SetupPartArray(ref shoulderAttachmentLeftParts, ModularCharacterStatics.ShoulderAttachmentLeftPath, isExisting); 241 | SetupPartArray(ref elbowAttachmentRightParts, ModularCharacterStatics.ElbowAttachmentRightPath, isExisting); 242 | SetupPartArray(ref elbowAttachmentLeftParts, ModularCharacterStatics.ElbowAttachmentLeftPath, isExisting); 243 | SetupPartArray(ref hipsAttachmentParts, ModularCharacterStatics.HipsAttachmentPath, isExisting); 244 | SetupPartArray(ref kneeAttachmentRightParts, ModularCharacterStatics.KneeAttachmentRightPath, isExisting); 245 | SetupPartArray(ref kneeAttachmentLeftParts, ModularCharacterStatics.KneeAttachmentLeftPath, isExisting); 246 | 247 | isInitialized = true; 248 | } 249 | 250 | private void SetupPartArray(ref GameObject[] partsArray, string path, bool isExisting) { 251 | Transform[] gameObjectTransforms = GetComponentsInChildren(); 252 | 253 | Transform parentRoot = null; 254 | 255 | foreach (Transform transform in gameObjectTransforms) { 256 | if (transform.gameObject.name.Equals(path)) { 257 | parentRoot = transform; 258 | break; 259 | } 260 | } 261 | 262 | partsArray = new GameObject[parentRoot.childCount]; 263 | for (int i = 0; i < partsArray.Length; i++) { 264 | partsArray[i] = parentRoot.GetChild(i).gameObject; 265 | if (characterMaterial != null) 266 | partsArray[i].GetComponent().sharedMaterial = characterMaterial; 267 | 268 | if (partsArray[i].activeSelf) 269 | partsArray[i].SetActive(isExisting); 270 | 271 | allParts.Add(partsArray[i]); 272 | } 273 | } 274 | #endregion 275 | 276 | #region DictionarySetups 277 | private void SetupCharacterBodyDictionary() { 278 | characterBody.Clear(); 279 | 280 | characterBody[ModularBodyPart.Hat] = hatParts; 281 | characterBody[ModularBodyPart.Mask] = maskParts; 282 | characterBody[ModularBodyPart.HeadCovering] = headCoveringParts; 283 | characterBody[ModularBodyPart.Hair] = hairParts; 284 | characterBody[ModularBodyPart.Ear] = earParts; 285 | characterBody[ModularBodyPart.HeadAttachment] = headAttachmentParts; 286 | characterBody[ModularBodyPart.BackAttachment] = backAttachmentParts; 287 | characterBody[ModularBodyPart.ShoulderAttachmentRight] = shoulderAttachmentRightParts; 288 | characterBody[ModularBodyPart.ShoulderAttachmentLeft] = shoulderAttachmentLeftParts; 289 | characterBody[ModularBodyPart.ElbowAttachmentRight] = elbowAttachmentRightParts; 290 | characterBody[ModularBodyPart.ElbowAttachmentLeft] = elbowAttachmentLeftParts; 291 | characterBody[ModularBodyPart.HipsAttachment] = hipsAttachmentParts; 292 | characterBody[ModularBodyPart.KneeAttachmentRight] = kneeAttachmentRightParts; 293 | characterBody[ModularBodyPart.KneeAttachmentLeft] = kneeAttachmentLeftParts; 294 | 295 | if (characterGender == Gender.Male) { 296 | characterBody[ModularBodyPart.Helmet] = maleHelmetParts; 297 | characterBody[ModularBodyPart.Head] = maleHeadParts; 298 | characterBody[ModularBodyPart.Eyebrow] = maleEyebrowParts; 299 | characterBody[ModularBodyPart.FacialHair] = maleFacialHairParts; 300 | characterBody[ModularBodyPart.Torso] = maleTorsoParts; 301 | characterBody[ModularBodyPart.ArmUpperRight] = maleArmUpperRightParts; 302 | characterBody[ModularBodyPart.ArmUpperLeft] = maleArmUpperLeftParts; 303 | characterBody[ModularBodyPart.ArmLowerRight] = maleArmLowerRightParts; 304 | characterBody[ModularBodyPart.ArmLowerLeft] = maleArmLowerLeftParts; 305 | characterBody[ModularBodyPart.HandLeft] = maleHandRightParts; 306 | characterBody[ModularBodyPart.HandRight] = maleHandLeftParts; 307 | characterBody[ModularBodyPart.Hips] = maleHipsParts; 308 | characterBody[ModularBodyPart.LegRight] = maleLegRightParts; 309 | characterBody[ModularBodyPart.LegLeft] = maleLegLeftParts; 310 | } else if (characterGender == Gender.Female) { 311 | characterBody[ModularBodyPart.Helmet] = femaleHelmetParts; 312 | characterBody[ModularBodyPart.Head] = femaleHeadParts; 313 | characterBody[ModularBodyPart.Eyebrow] = femaleEyebrowParts; 314 | characterBody[ModularBodyPart.FacialHair] = femaleFacialHairParts; 315 | characterBody[ModularBodyPart.Torso] = femaleTorsoParts; 316 | characterBody[ModularBodyPart.ArmUpperRight] = femaleArmUpperRightParts; 317 | characterBody[ModularBodyPart.ArmUpperLeft] = femaleArmUpperLeftParts; 318 | characterBody[ModularBodyPart.ArmLowerRight] = femaleArmLowerRightParts; 319 | characterBody[ModularBodyPart.ArmLowerLeft] = femaleArmLowerLeftParts; 320 | characterBody[ModularBodyPart.HandLeft] = femaleHandRightParts; 321 | characterBody[ModularBodyPart.HandRight] = femaleHandLeftParts; 322 | characterBody[ModularBodyPart.Hips] = femaleHipsParts; 323 | characterBody[ModularBodyPart.LegRight] = femaleLegRightParts; 324 | characterBody[ModularBodyPart.LegLeft] = femaleLegLeftParts; 325 | } 326 | } 327 | 328 | private void SetupActivePartsDictionary() { 329 | maleBaseBody.Clear(); 330 | femaleBaseBody.Clear(); 331 | 332 | foreach (var bodyPart in characterBody) { 333 | int activeID = 0; 334 | foreach (var part in bodyPart.Value) { 335 | if (part.activeSelf) { 336 | activeParts[bodyPart.Key] = Array.IndexOf(bodyPart.Value, part); 337 | activeID = Array.IndexOf(bodyPart.Value, part); 338 | } 339 | } 340 | if (bodyPart.Key.IsBaseBodyPart()) { 341 | SetupBodyLists(bodyPart.Key, activeID); 342 | } 343 | } 344 | } 345 | #endregion 346 | 347 | #region ListSetup 348 | private void SetupBodyLists(ModularBodyPart bodyPart, int activeID) { 349 | if (bodyPart.IsHeadPart()) { 350 | maleBaseBody.Add(new BodyPartLinker(bodyPart, activeID)); 351 | femaleBaseBody.Add(new BodyPartLinker(bodyPart, activeID)); 352 | } else { 353 | maleBaseBody.Add(new BodyPartLinker(bodyPart, 0)); 354 | femaleBaseBody.Add(new BodyPartLinker(bodyPart, 0)); 355 | } 356 | } 357 | #endregion 358 | } 359 | } 360 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Components/ModularCharacterManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 534ff91b1a992ea4aa4e55387ff2b3a3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Demo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1160cc09f1f8e4445aeb758957ae697d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Demo/EquipmentManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using BattleDrakeStudios.ModularCharacters; 3 | using System.Linq; 4 | 5 | public class EquipmentManager : MonoBehaviour { 6 | 7 | [SerializeField] private Item[] equipmentSlots; 8 | 9 | private ModularCharacterManager characterManager; 10 | 11 | private void Awake() { 12 | characterManager = GetComponent(); 13 | } 14 | 15 | private void Start() { 16 | foreach (var item in equipmentSlots) { 17 | EquipItem(item); 18 | } 19 | } 20 | 21 | private void EquipItem(Item itemToEquip) { 22 | 23 | foreach (var part in itemToEquip.modularArmor.armorParts) { 24 | if (part.partID > -1) { 25 | characterManager.ActivatePart(part.bodyType, part.partID); 26 | ColorPropertyLinker[] armorColors = itemToEquip.modularArmor.armorColors; 27 | for (int i = 0; i < armorColors.Length; i++) { 28 | characterManager.SetPartColor(part.bodyType, part.partID, armorColors[i].property, armorColors[i].color); 29 | } 30 | } else { 31 | characterManager.DeactivatePart(part.bodyType); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Demo/EquipmentManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c88fd4323de21634aa8b96c14bc13dd2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Enums.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ecc57cc9fb624140b5c7d7acccaed63 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Enums/Gender.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace BattleDrakeStudios.ModularCharacters { 3 | public enum Gender { Male, Female, Neutral } 4 | } 5 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Enums/Gender.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 815e8e1ee4a8cfe40a8946e6b7cb4478 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Enums/ModularArmorType.cs: -------------------------------------------------------------------------------- 1 | namespace BattleDrakeStudios.ModularCharacters { 2 | public enum ModularArmorType { 3 | Helmet, 4 | Shoulders, 5 | Cloak, 6 | Chest, 7 | Gloves, 8 | Legs, 9 | Boots 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Enums/ModularArmorType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab717fccdac25154caa6ac5727905b5a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Enums/ModularBodyPart.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace BattleDrakeStudios.ModularCharacters { 3 | public enum ModularBodyPart { 4 | Helmet, 5 | HeadAttachment, 6 | Head, 7 | Hat, 8 | Mask, 9 | HeadCovering, 10 | Hair, 11 | Eyebrow, 12 | Ear, 13 | FacialHair, 14 | BackAttachment, 15 | Torso, 16 | ShoulderAttachmentRight, 17 | ShoulderAttachmentLeft, 18 | ArmUpperRight, 19 | ArmUpperLeft, 20 | ElbowAttachmentRight, 21 | ElbowAttachmentLeft, 22 | ArmLowerRight, 23 | ArmLowerLeft, 24 | HandRight, 25 | HandLeft, 26 | HipsAttachment, 27 | Hips, 28 | KneeAttachmentRight, 29 | KneeAttachmentLeft, 30 | LegRight, 31 | LegLeft 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Enums/ModularBodyPart.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5447fe544b8bbee448ddf1f83e1fa725 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Item.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b789f624897a0f449a966bd75ba2dc23 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Item/Item.cs: -------------------------------------------------------------------------------- 1 | using BattleDrakeStudios.ModularCharacters; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace BattleDrakeStudios.ModularCharacters { 7 | [CreateAssetMenu(fileName = "NewItem", menuName = "Items/Base")] 8 | public class Item : ScriptableObject { 9 | public string itemName; 10 | public ModularArmor modularArmor; 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Item/Item.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52b8a0014ecdaff40a66b09ce2f9c397 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Item/ModularArmor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using static BattleDrakeStudios.ModularCharacters.ModularCharacterStatics; 3 | 4 | namespace BattleDrakeStudios.ModularCharacters { 5 | 6 | public class ModularArmor : ScriptableObject { 7 | public ModularArmorType armorType; 8 | public ColorPropertyLinker[] armorColors = { new ColorPropertyLinker(COLOR_PRIMARY), new ColorPropertyLinker(COLOR_SECONDARY), new ColorPropertyLinker(COLOR_LEATHER_PRIMARY), 9 | new ColorPropertyLinker(COLOR_LEATHER_SECONDARY), new ColorPropertyLinker(COLOR_METAL_PRIMARY), new ColorPropertyLinker(COLOR_METAL_SECONDARY), new ColorPropertyLinker(COLOR_METAL_DARK)}; 10 | public BodyPartLinker[] armorParts; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Item/ModularArmor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2823cab264e989448ae0ac1a156539d7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Linkers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3070e25736c5904c8fd266129391df1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Linkers/BodyPartLinker.cs: -------------------------------------------------------------------------------- 1 | namespace BattleDrakeStudios.ModularCharacters { 2 | //Links a bodypart with a partid to fit into a list when serialization is needed. 3 | [System.Serializable] 4 | public class BodyPartLinker { 5 | public ModularBodyPart bodyType; 6 | public int partID; 7 | 8 | public BodyPartLinker(ModularBodyPart bodyType) { 9 | this.bodyType = bodyType; 10 | this.partID = 0; 11 | } 12 | 13 | public BodyPartLinker(ModularBodyPart bodyType, int partID) { 14 | this.bodyType = bodyType; 15 | this.partID = partID; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Linkers/BodyPartLinker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89bd5a2418f32494f9089f474c23527f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Linkers/ColorPropertyLinker.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace BattleDrakeStudios.ModularCharacters { 4 | [System.Serializable] 5 | public class ColorPropertyLinker { 6 | public string property; 7 | public Color color; 8 | 9 | public ColorPropertyLinker(string property) { 10 | this.property = property; 11 | this.color = new Color(); 12 | } 13 | 14 | public ColorPropertyLinker(string property, Color color) { 15 | this.property = property; 16 | this.color = color; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Linkers/ColorPropertyLinker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4720d5c97ffc764498a16452f39ac24 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Utilities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 687154b374613234f97ea43d34326f70 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Utilities/ModularCharacterStatics.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace BattleDrakeStudios.ModularCharacters { 3 | public static class ModularCharacterStatics { 4 | public const string MaleHelmetPath = "Male_Head_No_Elements"; 5 | public const string MaleHeadPath = "Male_Head_All_Elements"; 6 | public const string MaleEyebrowPath = "Male_01_Eyebrows"; 7 | public const string MaleFacialHairPath = "Male_02_FacialHair"; 8 | public const string MaleTorsoPath = "Male_03_Torso"; 9 | public const string MaleArmUpperRightPath = "Male_04_Arm_Upper_Right"; 10 | public const string MaleArmUpperLeftPath = "Male_05_Arm_Upper_Left"; 11 | public const string MaleArmLowerRightPath = "Male_06_Arm_Lower_Right"; 12 | public const string MaleArmLowerLeftPath = "Male_07_Arm_Lower_Left"; 13 | public const string MaleHandLeftPath = "Male_08_Hand_Right"; 14 | public const string MaleHandRightPath = "Male_09_Hand_Left"; 15 | public const string MaleHipsPath = "Male_10_Hips"; 16 | public const string MaleLegRightPath = "Male_11_Leg_Right"; 17 | public const string MaleLegLeftPath = "Male_12_Leg_Left"; 18 | 19 | public const string FemaleHelmetPath = "Female_Head_No_Elements"; 20 | public const string FemaleHeadPath = "Female_Head_All_Elements"; 21 | public const string FemaleEyebrowPath = "Female_01_Eyebrows"; 22 | public const string FemaleFacialHairPath = "Male_02_FacialHair"; 23 | public const string FemaleTorsoPath = "Female_03_Torso"; 24 | public const string FemaleArmUpperRightPath = "Female_04_Arm_Upper_Right"; 25 | public const string FemaleArmUpperLeftPath = "Female_05_Arm_Upper_Left"; 26 | public const string FemaleArmLowerRightPath = "Female_06_Arm_Lower_Right"; 27 | public const string FemaleArmLowerLeftPath = "Female_07_Arm_Lower_Left"; 28 | public const string FemaleHandLeftPath = "Female_08_Hand_Right"; 29 | public const string FemaleHandRightPath = "Female_09_Hand_Left"; 30 | public const string FemaleHipsPath = "Female_10_Hips"; 31 | public const string FemaleLegRightPath = "Female_11_Leg_Right"; 32 | public const string FemaleLegLeftPath = "Female_12_Leg_Left"; 33 | 34 | public const string HatPath = "HeadCoverings_Base_Hair"; 35 | public const string MaskPath = "HeadCoverings_No_FacialHair"; 36 | public const string HeadCoveringPath = "HeadCoverings_No_Hair"; 37 | public const string HairPath = "All_01_Hair"; 38 | public const string EarPath = "Elf_Ear"; 39 | public const string HeadAttachmentPath = "Helmet"; 40 | public const string BackAttachmentPath = "All_04_Back_Attachment"; 41 | public const string ShoulderAttachmentRightPath = "All_05_Shoulder_Attachment_Right"; 42 | public const string ShoulderAttachmentLeftPath = "All_06_Shoulder_Attachment_Left"; 43 | public const string ElbowAttachmentRightPath = "All_07_Elbow_Attachment_Right"; 44 | public const string ElbowAttachmentLeftPath = "All_08_Elbow_Attachment_Left"; 45 | public const string HipsAttachmentPath = "All_09_Hips_Attachment"; 46 | public const string KneeAttachmentRightPath = "All_10_Knee_Attachement_Right"; 47 | public const string KneeAttachmentLeftPath = "All_11_Knee_Attachement_Left"; 48 | 49 | public const string COLOR_PRIMARY = "_Color_Primary"; 50 | public const string COLOR_SECONDARY = "_Color_Secondary"; 51 | public const string COLOR_LEATHER_PRIMARY = "_Color_Leather_Primary"; 52 | public const string COLOR_LEATHER_SECONDARY = "_Color_Leather_Secondary"; 53 | public const string COLOR_METAL_PRIMARY = "_Color_Metal_Primary"; 54 | public const string COLOR_METAL_SECONDARY = "_Color_Metal_Secondary"; 55 | public const string COLOR_METAL_DARK = "_Color_Metal_Dark"; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Utilities/ModularCharacterStatics.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a782d08839dfe340a23b2bf6c3cfcb1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Utilities/ModularExtensionMethods.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace BattleDrakeStudios.ModularCharacters { 3 | public static class ModularExtensionMethods { 4 | public static bool IsHead(this ModularBodyPart part) { 5 | if (part == ModularBodyPart.Head) { 6 | return true; 7 | } 8 | return false; 9 | } 10 | 11 | public static bool IsHeadPart(this ModularBodyPart part) { 12 | if (part == ModularBodyPart.Hair || part == ModularBodyPart.Eyebrow || part == ModularBodyPart.Ear || part == ModularBodyPart.FacialHair) { 13 | return true; 14 | } 15 | return false; 16 | } 17 | 18 | public static bool IsBaseBodyPart(this ModularBodyPart part) { 19 | if (part == ModularBodyPart.Head || part == ModularBodyPart.Torso || part == ModularBodyPart.ArmUpperRight || part == ModularBodyPart.ArmUpperLeft || 20 | part == ModularBodyPart.ArmLowerRight || part == ModularBodyPart.ArmLowerLeft || part == ModularBodyPart.HandRight || part == ModularBodyPart.HandLeft || 21 | part == ModularBodyPart.Hips || part == ModularBodyPart.LegRight || part == ModularBodyPart.LegLeft) { 22 | return true; 23 | } 24 | return false; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/ModularCharacterEditor/Scripts/Utilities/ModularExtensionMethods.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b440b9137c7bfc449900d1d230db79d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/SimpleIconCreator.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61eb81ea61ff6cf4284056928edd5d9e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/SimpleIconCreator/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b14061eaa2fabe643a8aac4512ed5ffe 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/SimpleIconCreator/Editor/IconCreatorWindow.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.IO; 4 | using System; 5 | using BattleDrakeStudios.Utilities; 6 | using UnityEngine.Rendering; 7 | 8 | namespace BattleDrakeStudios.SimpleIconCreator { 9 | 10 | public enum ImageFilterMode { 11 | Nearest = 0, 12 | Bilinear = 1, 13 | Average = 2 14 | } 15 | 16 | public class IconCreatorWindow : EditorWindow { 17 | 18 | private CustomPreviewEditor _previewWindow; 19 | private GameObject _targetObject; 20 | 21 | private int _xPadding = 5; 22 | private int _yPadding = 5; 23 | private Rect _previewRect; 24 | 25 | private GUIStyle _customStyle; 26 | private GUIStyle _titleStyle; 27 | 28 | private Rect _previewArea; 29 | private Rect _iconOptionsArea; 30 | private Rect _previewOptionsArea; 31 | private Rect _saveOptionsArea; 32 | 33 | private bool _isTransparent; 34 | 35 | private Texture2D _bgTexture; 36 | private Texture2D _fgTexture; 37 | 38 | private Color _transparencyColor; 39 | private Color _iconBGColor = new Color(0.192f, 0.192f, 0.192f); 40 | private Color _previewLightOneColor = Color.white; 41 | private float _previewLightOneIntensity = 1.0f; 42 | private Color _previewLightTwoColor = Color.white; 43 | private float _previewLightTwoIntensity = 1.0f; 44 | 45 | private string _iconName = "New Icon"; 46 | private string _savePath = "BattleDrakeStudios/SimpleIconCreator/Icons"; 47 | 48 | private int _iconResIndex = 3; 49 | private int[] _iconResolutions = { 32, 64, 128, 256, 512, 1024, 2048, 4096 }; 50 | 51 | private ImageFilterMode _imageFilterMode = ImageFilterMode.Average; 52 | 53 | public GameObject TargetObject { get { return _targetObject; } set { _targetObject = value; } } 54 | public CustomPreviewEditor PreviewEditor => _previewWindow; 55 | 56 | public event Action OnPreviewCreated; 57 | 58 | [MenuItem("BattleDrakeStudios/SimpleIconCreator")] 59 | public static void ShowWindow() { 60 | IconCreatorWindow editorWindow = EditorWindow.GetWindow("Simple Icon Creator"); 61 | 62 | editorWindow.minSize = new Vector2(512, 512); 63 | editorWindow.Show(); 64 | } 65 | 66 | private void OnEnable() { 67 | _previewRect = new Rect(_xPadding, _yPadding, 256, 256); 68 | _iconOptionsArea = new Rect(_xPadding + _previewRect.width + _xPadding, _yPadding, 241, 256); 69 | _previewOptionsArea = new Rect(_xPadding, _yPadding + _previewRect.height + _yPadding, _previewRect.width, 241); 70 | _saveOptionsArea = new Rect(_xPadding + _previewRect.width + _xPadding, _yPadding + _previewRect.height + _yPadding, 241, 241); 71 | 72 | _transparencyColor = Color.magenta; 73 | 74 | } 75 | 76 | private void UpdateOptionsToPreviewSettings() { 77 | if (!_isTransparent) { 78 | _previewWindow.SetBackgroundColor(_iconBGColor); 79 | } else { 80 | _previewWindow.SetBackgroundColor(_transparencyColor, true); 81 | } 82 | _previewWindow.LightOneColor = _previewLightOneColor; 83 | _previewWindow.LightOneIntensity = _previewLightOneIntensity; 84 | 85 | _previewWindow.LightTwoColor = _previewLightTwoColor; 86 | _previewWindow.LightTwoIntensity = _previewLightTwoIntensity; 87 | 88 | if (_bgTexture != null) 89 | _previewWindow.BGTexture = _bgTexture; 90 | if (_fgTexture != null) 91 | _previewWindow.FGTExture = _fgTexture; 92 | } 93 | 94 | private void OnGUI() { 95 | _customStyle = new GUIStyle(GUI.skin.button); 96 | _customStyle.padding = new RectOffset(10, 10, 10, 10); 97 | 98 | _titleStyle = new GUIStyle(GUI.skin.button); 99 | _titleStyle.fontStyle = FontStyle.Bold; 100 | _titleStyle.alignment = TextAnchor.MiddleCenter; 101 | 102 | if (_targetObject != null) { 103 | if (_previewWindow == null) { 104 | _previewWindow = Editor.CreateEditor(_targetObject, typeof(CustomPreviewEditor)) as CustomPreviewEditor; 105 | _previewWindow.TargetAsset = _targetObject; 106 | OnPreviewCreated?.Invoke(_previewWindow); 107 | UpdateOptionsToPreviewSettings(); 108 | } 109 | if (_previewWindow.HasPreviewGUI()) { 110 | _previewWindow.OnInteractivePreviewGUI(_previewRect, null); 111 | UpdateOptionsToPreviewSettings(); 112 | } 113 | } else { 114 | GUILayout.BeginArea(_previewRect); 115 | GUI.Box(new Rect(0, 0, _previewRect.width, _previewRect.height), "Image Not Available", _customStyle); 116 | GUILayout.EndArea(); 117 | } 118 | 119 | /* 120 | * Icon Options Area 121 | */ 122 | GUILayout.BeginArea(_iconOptionsArea, _customStyle); 123 | 124 | GUILayout.BeginVertical(); 125 | 126 | GUILayout.Label("Icon Options", _titleStyle); 127 | 128 | if (_targetObject != null) { 129 | GUILayout.BeginHorizontal(); 130 | GUILayout.Label("Transparency"); 131 | EditorGUI.BeginChangeCheck(); 132 | _isTransparent = GUILayout.Toggle(_isTransparent, _isTransparent.ToString()/*, GUI.skin.button*/); 133 | if (EditorGUI.EndChangeCheck()) { 134 | if (_isTransparent) { 135 | _previewWindow.SetBackgroundColor(_transparencyColor, true); 136 | } else { 137 | _previewWindow.SetBackgroundColor(_iconBGColor); 138 | } 139 | } 140 | GUILayout.EndHorizontal(); 141 | 142 | if (!_isTransparent) { 143 | GUILayout.BeginHorizontal(); 144 | GUILayout.Label("Background Color"); 145 | EditorGUI.BeginChangeCheck(); 146 | _iconBGColor = EditorGUILayout.ColorField(_iconBGColor); 147 | if (EditorGUI.EndChangeCheck()) { 148 | _previewWindow.SetBackgroundColor(_iconBGColor); 149 | } 150 | GUILayout.EndHorizontal(); 151 | } 152 | 153 | GUILayout.BeginHorizontal(); 154 | GUILayout.Label("Background Texture"); 155 | EditorGUI.BeginChangeCheck(); 156 | _bgTexture = EditorGUILayout.ObjectField(_bgTexture, typeof(Texture2D), false) as Texture2D; 157 | if (EditorGUI.EndChangeCheck()) { 158 | if (_bgTexture != null) 159 | _previewWindow.BGTexture = _bgTexture; 160 | else { 161 | _previewWindow.BGTexture = null; 162 | } 163 | } 164 | GUILayout.EndHorizontal(); 165 | 166 | GUILayout.BeginHorizontal(); 167 | GUILayout.Label("Foreground Texture"); 168 | EditorGUI.BeginChangeCheck(); 169 | _fgTexture = EditorGUILayout.ObjectField(_fgTexture, typeof(Texture2D), false) as Texture2D; 170 | if (EditorGUI.EndChangeCheck()) { 171 | if (_fgTexture != null) 172 | _previewWindow.FGTExture = _fgTexture; 173 | else { 174 | _previewWindow.FGTExture = null; 175 | } 176 | } 177 | GUILayout.EndHorizontal(); 178 | 179 | if (GUILayout.Button("Reset Icon Options")) { 180 | ResetIconOptions(); 181 | } 182 | 183 | } 184 | 185 | GUILayout.EndVertical(); 186 | GUILayout.EndArea(); 187 | 188 | /* 189 | * Below Preview Options 190 | */ 191 | GUILayout.BeginArea(_previewOptionsArea, _customStyle); 192 | 193 | GUILayout.BeginVertical(); 194 | 195 | GUILayout.Label("Preview Window Options", _titleStyle); 196 | 197 | GUILayout.BeginHorizontal(); 198 | GUILayout.Label("Icon Object"); 199 | EditorGUI.BeginChangeCheck(); 200 | _targetObject = EditorGUILayout.ObjectField(_targetObject, typeof(GameObject), false) as GameObject; 201 | if (EditorGUI.EndChangeCheck()) { 202 | DestroyImmediate(_previewWindow); 203 | if (_targetObject != null) 204 | _iconName = _targetObject.name; 205 | } 206 | GUILayout.EndHorizontal(); 207 | 208 | if (_targetObject != null) { 209 | GUILayout.BeginHorizontal(); 210 | GUILayout.Label("Light One Color"); 211 | EditorGUI.BeginChangeCheck(); 212 | _previewLightOneColor = EditorGUILayout.ColorField(_previewLightOneColor); 213 | if (EditorGUI.EndChangeCheck()) { 214 | _previewWindow.LightOneColor = _previewLightOneColor; 215 | } 216 | GUILayout.EndHorizontal(); 217 | 218 | GUILayout.BeginHorizontal(); 219 | GUILayout.Label("Light One Intensity"); 220 | EditorGUI.BeginChangeCheck(); 221 | _previewLightOneIntensity = EditorGUILayout.Slider(_previewLightOneIntensity, 0, 2.0f); 222 | if (EditorGUI.EndChangeCheck()) { 223 | _previewWindow.LightOneIntensity = _previewLightOneIntensity; 224 | } 225 | GUILayout.EndHorizontal(); 226 | 227 | GUILayout.BeginHorizontal(); 228 | GUILayout.Label("Light Two Color"); 229 | EditorGUI.BeginChangeCheck(); 230 | _previewLightTwoColor = EditorGUILayout.ColorField(_previewLightTwoColor); 231 | if (EditorGUI.EndChangeCheck()) { 232 | _previewWindow.LightTwoColor = _previewLightTwoColor; 233 | } 234 | GUILayout.EndHorizontal(); 235 | 236 | GUILayout.BeginHorizontal(); 237 | GUILayout.Label("Light Two Intensity"); 238 | EditorGUI.BeginChangeCheck(); 239 | _previewLightTwoIntensity = EditorGUILayout.Slider(_previewLightTwoIntensity, 0, 2.0f); 240 | if (EditorGUI.EndChangeCheck()) { 241 | _previewWindow.LightTwoIntensity = _previewLightTwoIntensity; 242 | } 243 | GUILayout.EndHorizontal(); 244 | 245 | EditorGUILayout.BeginHorizontal(); 246 | if (GUILayout.Button("Reset Lights")) { 247 | ResetWindowOptions(); 248 | } 249 | 250 | if (GUILayout.Button("Reset Object")) { 251 | ResetTarget(); 252 | } 253 | EditorGUILayout.EndHorizontal(); 254 | } 255 | 256 | GUILayout.EndVertical(); 257 | GUILayout.EndArea(); 258 | 259 | /* 260 | * Save Icon Options 261 | */ 262 | 263 | GUILayout.BeginArea(_saveOptionsArea, _customStyle); 264 | 265 | GUILayout.BeginVertical(); 266 | 267 | GUILayout.Label("Save Options", _titleStyle); 268 | 269 | if (_targetObject != null) { 270 | GUILayout.BeginHorizontal(); 271 | GUILayout.Label("Icon Resolution"); 272 | 273 | EditorGUI.BeginChangeCheck(); 274 | _iconResIndex = EditorGUILayout.Popup(_iconResIndex, Array.ConvertAll(_iconResolutions, x => x.ToString())); 275 | if (EditorGUI.EndChangeCheck()) { 276 | GUI.changed = true; 277 | } 278 | GUILayout.Label("x"); 279 | GUILayout.Label(_iconResolutions[_iconResIndex].ToString()); 280 | GUILayout.EndHorizontal(); 281 | 282 | GUILayout.BeginHorizontal(); 283 | GUILayout.Label("Icon Name"); 284 | _iconName = GUILayout.TextField(_iconName); 285 | GUILayout.EndHorizontal(); 286 | 287 | GUILayout.BeginHorizontal(); 288 | GUILayout.Label("Icon Path:"); 289 | _savePath = GUILayout.TextArea(_savePath); 290 | GUILayout.EndHorizontal(); 291 | 292 | if (GUILayout.Button("Create Icon")) { 293 | if (_previewWindow.PreviewTexture != null) { 294 | CreatePngFromTexture(); 295 | } 296 | } 297 | } 298 | GUILayout.EndVertical(); 299 | GUILayout.EndArea(); 300 | } 301 | 302 | private void ResetIconOptions() { 303 | _iconBGColor = new Color(0.192f, 0.192f, 0.192f); 304 | _previewWindow.SetBackgroundColor(_iconBGColor); 305 | 306 | _isTransparent = false; 307 | 308 | _previewWindow.BGTexture = null; 309 | _bgTexture = null; 310 | 311 | _previewWindow.FGTExture = null; 312 | _fgTexture = null; 313 | } 314 | 315 | private void ResetWindowOptions() { 316 | _previewLightOneColor = Color.white; 317 | _previewWindow.LightOneColor = Color.white; 318 | _previewLightOneIntensity = 1.0f; 319 | _previewWindow.LightOneIntensity = 1.0f; 320 | 321 | _previewLightTwoColor = Color.white; 322 | _previewWindow.LightTwoColor = Color.white; 323 | _previewLightTwoIntensity = 1.0f; 324 | _previewWindow.LightTwoIntensity = 1.0f; 325 | } 326 | 327 | private void ResetTarget() { 328 | _previewWindow.ResetTargetObject(); 329 | } 330 | 331 | private void CreatePngFromTexture() { 332 | Texture2D textureToConvert = _previewWindow.PreviewTexture; 333 | 334 | if (_isTransparent) { 335 | textureToConvert = CreateTextureWithTransparency(textureToConvert); 336 | } 337 | 338 | textureToConvert = ResizeTexture(textureToConvert, _imageFilterMode, _iconResolutions[_iconResIndex], _iconResolutions[_iconResIndex]); 339 | 340 | byte[] byteTexture = textureToConvert.EncodeToPNG(); 341 | File.WriteAllBytes(Application.dataPath + "/" + _savePath + "/" + _iconName + ".png", byteTexture); 342 | 343 | AssetDatabase.Refresh(); 344 | } 345 | 346 | private Texture2D CreateTextureWithTransparency(Texture2D texture) { 347 | Texture2D newTexture = new Texture2D(texture.width, texture.height, TextureFormat.RGBA32, false); 348 | 349 | Color[] pixels = texture.GetPixels(0, 0, texture.width, texture.height); 350 | 351 | for (int i = 0; i < pixels.Length; i++) { 352 | if (pixels[i] == _transparencyColor) { 353 | pixels[i] = Color.clear; 354 | } 355 | } 356 | newTexture.SetPixels(0, 0, texture.width, texture.height, pixels); 357 | newTexture.Apply(); 358 | 359 | return newTexture; 360 | } 361 | 362 | public Texture2D ResizeTexture(Texture2D originalTexture, ImageFilterMode filterMode, int newWidth, int newHeight) { 363 | 364 | //*** Get All the source pixels 365 | Color[] sourceColor = originalTexture.GetPixels(0); 366 | Vector2 sourceSize = new Vector2(originalTexture.width, originalTexture.height); 367 | 368 | //*** Calculate New Size 369 | float textureWidth = newWidth; 370 | float textureHeight = newHeight; 371 | 372 | //*** Make New 373 | Texture2D newTexture = new Texture2D((int)textureWidth, (int)textureHeight, TextureFormat.RGBA32, false); 374 | 375 | //*** Make destination array 376 | Color[] aColor = new Color[(int)textureWidth * (int)textureHeight]; 377 | 378 | Vector2 pixelSize = new Vector2(sourceSize.x / textureWidth, sourceSize.y / textureHeight); 379 | 380 | //*** Loop through destination pixels and process 381 | Vector2 center = new Vector2(); 382 | for (int i = 0; i < aColor.Length; i++) { 383 | 384 | //*** Figure out x&y 385 | float x = (float)i % textureWidth; 386 | float y = Mathf.Floor((float)i / textureWidth); 387 | 388 | //*** Calculate Center 389 | center.x = (x / textureWidth) * sourceSize.x; 390 | center.y = (y / textureHeight) * sourceSize.y; 391 | 392 | //*** Do Based on mode 393 | //*** Nearest neighbour (testing) 394 | if (filterMode == ImageFilterMode.Nearest) { 395 | 396 | //*** Nearest neighbour (testing) 397 | center.x = Mathf.Round(center.x); 398 | center.y = Mathf.Round(center.y); 399 | 400 | //*** Calculate source index 401 | int sourceIndex = (int)((center.y * sourceSize.x) + center.x); 402 | 403 | //*** Copy Pixel 404 | aColor[i] = sourceColor[sourceIndex]; 405 | } 406 | 407 | //*** Bilinear 408 | else if (filterMode == ImageFilterMode.Bilinear) { 409 | 410 | //*** Get Ratios 411 | float ratioX = center.x - Mathf.Floor(center.x); 412 | float ratioY = center.y - Mathf.Floor(center.y); 413 | 414 | //*** Get Pixel index's 415 | int indexTL = (int)((Mathf.Floor(center.y) * sourceSize.x) + Mathf.Floor(center.x)); 416 | int indexTR = (int)((Mathf.Floor(center.y) * sourceSize.x) + Mathf.Ceil(center.x)); 417 | int indexBL = (int)((Mathf.Ceil(center.y) * sourceSize.x) + Mathf.Floor(center.x)); 418 | int indexBR = (int)((Mathf.Ceil(center.y) * sourceSize.x) + Mathf.Ceil(center.x)); 419 | 420 | //*** Calculate Color 421 | aColor[i] = Color.Lerp( 422 | Color.Lerp(sourceColor[indexTL], sourceColor[indexTR], ratioX), 423 | Color.Lerp(sourceColor[indexBL], sourceColor[indexBR], ratioX), 424 | ratioY 425 | ); 426 | } 427 | 428 | //*** Average 429 | else if (filterMode == ImageFilterMode.Average) { 430 | 431 | //*** Calculate grid around point 432 | int xFrom = (int)Mathf.Max(Mathf.Floor(center.x - (pixelSize.x * 0.5f)), 0); 433 | int xTo = (int)Mathf.Min(Mathf.Ceil(center.x + (pixelSize.x * 0.5f)), sourceSize.x); 434 | int yFrom = (int)Mathf.Max(Mathf.Floor(center.y - (pixelSize.y * 0.5f)), 0); 435 | int yTo = (int)Mathf.Min(Mathf.Ceil(center.y + (pixelSize.y * 0.5f)), sourceSize.y); 436 | 437 | //*** Loop and accumulate 438 | Color tempColor = new Color(); 439 | float xGridCount = 0; 440 | for (int iy = yFrom; iy < yTo; iy++) { 441 | for (int ix = xFrom; ix < xTo; ix++) { 442 | 443 | //*** Get Color 444 | tempColor += sourceColor[(int)(((float)iy * sourceSize.x) + ix)]; 445 | 446 | //*** Sum 447 | xGridCount++; 448 | } 449 | } 450 | 451 | //*** Average Color 452 | aColor[i] = tempColor / (float)xGridCount; 453 | } 454 | } 455 | 456 | //*** Set Pixels 457 | newTexture.SetPixels(aColor); 458 | newTexture.Apply(); 459 | 460 | //*** Return 461 | return newTexture; 462 | } 463 | } 464 | } 465 | 466 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/SimpleIconCreator/Editor/IconCreatorWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cec1a0d1b4daf354e8a56d0154ada441 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/SimpleIconCreator/Icons.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8cbc6e67e4f77eb4bb0d0f8179e073cd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/SimpleIconCreator/SimpleIconCreatorReadme.txt: -------------------------------------------------------------------------------- 1 | Visit https://youtu.be/_NKHUgD7KAk for a video showcasing of the tool. 2 | 3 | Features: 4 | Editor tool to create icons. Don't have to hit play! 5 | Previewscene to view object, rotate, or reposition. 6 | Select Icon Resolution. 7 | Colored or Transparent backgrounds supported. 8 | 9 | Steps to use: 10 | - After installing package, go to BattleDrakeStudios/SimpleIconCreator. 11 | - Drag and drop a prefab from your project files into the object field(Scene objects are not supported.) Can also click on the icon to show list of all objects and select from there. 12 | - Set icon resolution, transparency, background color, and icon name. 13 | New Feature: Can now set background texture by dragging and dropping the desired texture into the object field just below transparency button! 14 | Notice: Editor Window has to be at least twice the size of the preview window's size in order to avoid grey rendering. Resize if you notice your texture is being cutoff. 15 | - Press Create Icon when finished. Icon will save to BattleDrakeStudios/SimpleIconCreator/Icons. 16 | 17 | Controls: 18 | - Left mouse button dragged left to right rotates object on the y axis(yaw), relative to the object. 19 | - Left mouse button dragged up and down rotates object on the x axis(pitch), relative to the world. 20 | - Right mouse button dragged left to right rotates object on the z axis(roll), relative to the world. 21 | - Middle mouse button, pressed and dragged, moves the object. 22 | - Scrollwheel zooms in and out. 23 | - Holding shift will increase the speed at which several of these actions are performed. 24 | 25 | Notes: 26 | - Don't forget to select image and set TextureType to Sprite and UI after creating images. 27 | 28 | - You may notice a bit of choppiness/pixelation when creating a transparent image. 29 | Extra steps were taken to provide the best quality transparent images unity could provide, but the way textures are created prevents sharp pixels. 30 | When texture sampling, the pixel sized gaps between the object being rendered and the background, create a pixel bleeding effect due to the smoothing effect of unity's linear sampling. 31 | When left on, the object would have an outline of the background color and was a complete eyesore. To prevent this, transparent images are captured using the point filtermode. 32 | This results in images with no background color bleeding, but also means the edges aren't smoothed, leaving them looking blocky when zoomed in. 33 | Non transparent icons have the standard filtermode applied. 34 | 35 | Support: BattleDrakeStudios@Gmail.com -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/SimpleIconCreator/SimpleIconCreatorReadme.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af5406fc7accde24280983e7f5332d9d 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/Universal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b6ec539be8aeb64388a0967501473b8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/Universal/CustomPreviewEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System; 4 | 5 | #if UNITY_EDITOR 6 | 7 | namespace BattleDrakeStudios.Utilities { 8 | 9 | public class CustomPreviewEditor : Editor { 10 | private PreviewRenderUtility _previewUtil; 11 | 12 | private Vector2 _rotationDrag; 13 | private Vector2 _zRotation; 14 | private Vector2 _posDrag; 15 | private float _scrollDelta; 16 | 17 | private GameObject _targetAsset; 18 | private GameObject _targetObject; 19 | 20 | private Texture2D _previewTexture; 21 | private FilterMode _currentFilterMode = FilterMode.Bilinear; 22 | 23 | private float _lightOneIntensity; 24 | private float _lightTwoIntensity; 25 | private Vector3 _lightOneRotation; 26 | private Vector3 _lightTwoRotation; 27 | 28 | private Texture2D _bgTexture; 29 | private Texture2D _fgTexture; 30 | 31 | public GameObject TargetAsset { get => _targetAsset; set { _targetAsset = value; UpdatePreviewTarget(); } } 32 | public GameObject TargetObject => _targetObject; 33 | public Texture2D PreviewTexture => _previewTexture; 34 | 35 | public float LightOneIntensity { get => _lightOneIntensity; set { _previewUtil.lights[0].intensity = value; } } 36 | public float LightTwoIntensity { get => _lightTwoIntensity; set { _previewUtil.lights[1].intensity = value; } } 37 | public Color LightOneColor { get => _previewUtil.lights[0].color; set { _previewUtil.lights[0].color = value; } } 38 | public Color LightTwoColor { get => _previewUtil.lights[1].color; set { _previewUtil.lights[1].color = value; } } 39 | public Vector3 LightOneRotation => _lightOneRotation; 40 | public Vector3 LightTwoRotation => _lightTwoRotation; 41 | 42 | public Color BGColor => _previewUtil.camera.backgroundColor; 43 | public Texture2D BGTexture { get => _bgTexture; set { _bgTexture = value; } } 44 | public Texture2D FGTExture { get => _fgTexture; set { _fgTexture = value; } } 45 | 46 | public event Action OnPreviewObjectInstantiated; 47 | 48 | private void SetupPreviewRenderUtility() { 49 | if (_previewUtil == null) { 50 | _previewUtil = new PreviewRenderUtility(true, true); 51 | 52 | _previewUtil.camera.transform.position = new Vector3(0, 0, -3); 53 | _previewUtil.camera.transform.rotation = Quaternion.identity; 54 | _previewUtil.cameraFieldOfView = 30.0f; 55 | _previewUtil.camera.cameraType = CameraType.SceneView; 56 | } 57 | } 58 | 59 | private void UpdatePreviewTarget() { 60 | SetupPreviewRenderUtility(); 61 | 62 | _targetObject = _previewUtil.InstantiatePrefabInScene(_targetAsset); 63 | OnPreviewObjectInstantiated?.Invoke(_targetObject); 64 | _targetObject.transform.position = Vector3.zero; 65 | _targetObject.transform.Rotate(new Vector3(0, 180, 0)); 66 | } 67 | 68 | public override bool HasPreviewGUI() { 69 | return true; 70 | } 71 | 72 | public override void OnInteractivePreviewGUI(Rect r, GUIStyle background) { 73 | if (_targetObject == null) { 74 | UpdatePreviewTarget(); 75 | } 76 | 77 | if (Event.current.button == 0) { 78 | _rotationDrag = DragDelta(_rotationDrag, r); 79 | } else if (Event.current.button == 1) { 80 | _zRotation = DragDelta(_zRotation, r); 81 | } else if (Event.current.button == 2) { 82 | _posDrag = PositionDelta(_posDrag, r); 83 | } 84 | 85 | if (Event.current.type == EventType.ScrollWheel) { 86 | _scrollDelta = Event.current.delta.y; 87 | _scrollDelta /= Event.current.shift ? 1 : 9; 88 | GUI.changed = true; 89 | } 90 | 91 | if (Event.current.type == EventType.Repaint) { 92 | if (_previewUtil == null) { 93 | SetupPreviewRenderUtility(); 94 | return; 95 | } 96 | 97 | _previewUtil.BeginStaticPreview(r); 98 | 99 | if (_targetObject != null) { 100 | _targetObject.transform.position += new Vector3(-_posDrag.x, _posDrag.y, 0); 101 | 102 | //I wanted a very specific style of object rotation, 2 different Rotate calls achieved it. 103 | _targetObject.transform.Rotate(new Vector3(0, _rotationDrag.x * 180, 0), Space.Self); 104 | _targetObject.transform.Rotate(new Vector3(_rotationDrag.y * 180, 0, _zRotation.x * 180), Space.World); 105 | 106 | _posDrag = Vector2.zero; 107 | _rotationDrag = Vector2.zero; 108 | _zRotation = Vector2.zero; 109 | } 110 | 111 | _previewUtil.camera.transform.position = Vector2.zero; 112 | 113 | _previewUtil.camera.transform.position = _previewUtil.camera.transform.forward * -6f; 114 | 115 | _previewUtil.cameraFieldOfView = _previewUtil.cameraFieldOfView + _scrollDelta; 116 | _scrollDelta = 0; 117 | 118 | _previewUtil.camera.targetTexture.filterMode = _currentFilterMode; 119 | 120 | _previewUtil.camera.clearFlags = CameraClearFlags.Color; 121 | 122 | if (_bgTexture != null) { 123 | _bgTexture.filterMode = _currentFilterMode; 124 | _previewUtil.camera.clearFlags = CameraClearFlags.Depth; 125 | GUI.DrawTexture(new Rect(0, 0, r.width * 2, r.height * 2), _bgTexture, ScaleMode.StretchToFill, true); 126 | } 127 | 128 | _previewUtil.camera.Render(); 129 | 130 | if (_fgTexture != null) { 131 | _fgTexture.filterMode = _currentFilterMode; 132 | GUI.DrawTexture(new Rect(0, 0, r.width * 2, r.height * 2), _fgTexture, ScaleMode.StretchToFill, true); 133 | } 134 | 135 | _previewTexture = _previewUtil.EndStaticPreview(); 136 | 137 | GUI.DrawTexture(r, _previewTexture, ScaleMode.StretchToFill, true); 138 | } 139 | } 140 | 141 | public void ResetTargetObject() { 142 | _targetObject.transform.position = Vector3.zero; 143 | _targetObject.transform.rotation = Quaternion.identity; 144 | } 145 | 146 | public void SetBackgroundColor(Color bgColor, bool isTransparent = false) { 147 | if (_previewUtil != null) { 148 | if (isTransparent) { 149 | _currentFilterMode = FilterMode.Point; 150 | } else { 151 | _currentFilterMode = FilterMode.Bilinear; 152 | } 153 | _previewUtil.camera.backgroundColor = bgColor; 154 | } 155 | 156 | } 157 | 158 | private Vector2 DragDelta(Vector2 dragValue, Rect position) { 159 | int controlID = GUIUtility.GetControlID("Slider".GetHashCode(), FocusType.Passive); 160 | Event current = Event.current; 161 | switch (current.GetTypeForControl(controlID)) { 162 | case EventType.MouseDown: 163 | if (position.Contains(current.mousePosition)/* && position.width > 50f*/) { 164 | GUIUtility.hotControl = controlID; 165 | current.Use(); 166 | EditorGUIUtility.SetWantsMouseJumping(1); 167 | } 168 | break; 169 | case EventType.MouseUp: 170 | if (GUIUtility.hotControl == controlID) { 171 | GUIUtility.hotControl = 0; 172 | } 173 | EditorGUIUtility.SetWantsMouseJumping(0); 174 | break; 175 | case EventType.MouseDrag: 176 | if (GUIUtility.hotControl == controlID) { 177 | if (Mathf.Abs(current.delta.x) > Mathf.Abs(current.delta.y)) { 178 | dragValue.x -= current.delta.x * (float)((!current.shift) ? 1 : 3) / Mathf.Min(position.width, position.height); 179 | } else if (Mathf.Abs(current.delta.y) > Mathf.Abs(current.delta.x)) { 180 | dragValue.y -= current.delta.y * (float)((!current.shift) ? 1 : 3) / Mathf.Min(position.width, position.height); 181 | } 182 | dragValue.y = Mathf.Clamp(dragValue.y, -90f, 90f); 183 | current.Use(); 184 | GUI.changed = true; 185 | } 186 | break; 187 | } 188 | return dragValue; 189 | } 190 | 191 | private Vector2 PositionDelta(Vector2 dragValue, Rect position) { 192 | int controlID = GUIUtility.GetControlID("Slider".GetHashCode(), FocusType.Passive); 193 | Event current = Event.current; 194 | switch (current.GetTypeForControl(controlID)) { 195 | case EventType.MouseDown: 196 | if (position.Contains(current.mousePosition)) { 197 | GUIUtility.hotControl = controlID; 198 | current.Use(); 199 | EditorGUIUtility.SetWantsMouseJumping(1); 200 | } 201 | break; 202 | case EventType.MouseUp: 203 | if (GUIUtility.hotControl == controlID) { 204 | GUIUtility.hotControl = 0; 205 | } 206 | EditorGUIUtility.SetWantsMouseJumping(0); 207 | break; 208 | case EventType.MouseDrag: 209 | if (GUIUtility.hotControl == controlID) { 210 | dragValue -= new Vector2(current.delta.x, current.delta.y) * (float)((!current.shift) ? 1 : 3) / Mathf.Min(position.width, position.height); 211 | current.Use(); 212 | GUI.changed = true; 213 | } 214 | break; 215 | } 216 | return dragValue; 217 | } 218 | 219 | private void OnDisable() { 220 | if (_previewUtil != null) 221 | _previewUtil.Cleanup(); 222 | } 223 | } 224 | } 225 | #endif 226 | -------------------------------------------------------------------------------- /Assets/BattleDrakeStudios/Universal/CustomPreviewEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96ea508666935154cbda4267dee77809 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Battledrake 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": "1.2.16", 4 | "com.unity.ide.rider": "1.1.4", 5 | "com.unity.ide.vscode": "1.2.1", 6 | "com.unity.test-framework": "1.1.14", 7 | "com.unity.textmeshpro": "2.0.1", 8 | "com.unity.timeline": "1.2.15", 9 | "com.unity.ugui": "1.0.0", 10 | "com.unity.modules.ai": "1.0.0", 11 | "com.unity.modules.androidjni": "1.0.0", 12 | "com.unity.modules.animation": "1.0.0", 13 | "com.unity.modules.assetbundle": "1.0.0", 14 | "com.unity.modules.audio": "1.0.0", 15 | "com.unity.modules.cloth": "1.0.0", 16 | "com.unity.modules.director": "1.0.0", 17 | "com.unity.modules.imageconversion": "1.0.0", 18 | "com.unity.modules.imgui": "1.0.0", 19 | "com.unity.modules.jsonserialize": "1.0.0", 20 | "com.unity.modules.particlesystem": "1.0.0", 21 | "com.unity.modules.physics": "1.0.0", 22 | "com.unity.modules.physics2d": "1.0.0", 23 | "com.unity.modules.screencapture": "1.0.0", 24 | "com.unity.modules.terrain": "1.0.0", 25 | "com.unity.modules.terrainphysics": "1.0.0", 26 | "com.unity.modules.tilemap": "1.0.0", 27 | "com.unity.modules.ui": "1.0.0", 28 | "com.unity.modules.uielements": "1.0.0", 29 | "com.unity.modules.umbra": "1.0.0", 30 | "com.unity.modules.unityanalytics": "1.0.0", 31 | "com.unity.modules.unitywebrequest": "1.0.0", 32 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 33 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 34 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 35 | "com.unity.modules.unitywebrequestwww": "1.0.0", 36 | "com.unity.modules.vehicles": "1.0.0", 37 | "com.unity.modules.video": "1.0.0", 38 | "com.unity.modules.vr": "1.0.0", 39 | "com.unity.modules.wind": "1.0.0", 40 | "com.unity.modules.xr": "1.0.0" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": { 4 | "version": "1.2.16", 5 | "depth": 0, 6 | "source": "registry", 7 | "dependencies": {}, 8 | "url": "https://packages.unity.com" 9 | }, 10 | "com.unity.ext.nunit": { 11 | "version": "1.0.0", 12 | "depth": 1, 13 | "source": "registry", 14 | "dependencies": {}, 15 | "url": "https://packages.unity.com" 16 | }, 17 | "com.unity.ide.rider": { 18 | "version": "1.1.4", 19 | "depth": 0, 20 | "source": "registry", 21 | "dependencies": { 22 | "com.unity.test-framework": "1.1.1" 23 | }, 24 | "url": "https://packages.unity.com" 25 | }, 26 | "com.unity.ide.vscode": { 27 | "version": "1.2.1", 28 | "depth": 0, 29 | "source": "registry", 30 | "dependencies": {}, 31 | "url": "https://packages.unity.com" 32 | }, 33 | "com.unity.test-framework": { 34 | "version": "1.1.14", 35 | "depth": 0, 36 | "source": "registry", 37 | "dependencies": { 38 | "com.unity.ext.nunit": "1.0.0", 39 | "com.unity.modules.imgui": "1.0.0", 40 | "com.unity.modules.jsonserialize": "1.0.0" 41 | }, 42 | "url": "https://packages.unity.com" 43 | }, 44 | "com.unity.textmeshpro": { 45 | "version": "2.0.1", 46 | "depth": 0, 47 | "source": "registry", 48 | "dependencies": { 49 | "com.unity.ugui": "1.0.0" 50 | }, 51 | "url": "https://packages.unity.com" 52 | }, 53 | "com.unity.timeline": { 54 | "version": "1.2.15", 55 | "depth": 0, 56 | "source": "registry", 57 | "dependencies": {}, 58 | "url": "https://packages.unity.com" 59 | }, 60 | "com.unity.ugui": { 61 | "version": "1.0.0", 62 | "depth": 0, 63 | "source": "builtin", 64 | "dependencies": { 65 | "com.unity.modules.ui": "1.0.0" 66 | } 67 | }, 68 | "com.unity.modules.ai": { 69 | "version": "1.0.0", 70 | "depth": 0, 71 | "source": "builtin", 72 | "dependencies": {} 73 | }, 74 | "com.unity.modules.androidjni": { 75 | "version": "1.0.0", 76 | "depth": 0, 77 | "source": "builtin", 78 | "dependencies": {} 79 | }, 80 | "com.unity.modules.animation": { 81 | "version": "1.0.0", 82 | "depth": 0, 83 | "source": "builtin", 84 | "dependencies": {} 85 | }, 86 | "com.unity.modules.assetbundle": { 87 | "version": "1.0.0", 88 | "depth": 0, 89 | "source": "builtin", 90 | "dependencies": {} 91 | }, 92 | "com.unity.modules.audio": { 93 | "version": "1.0.0", 94 | "depth": 0, 95 | "source": "builtin", 96 | "dependencies": {} 97 | }, 98 | "com.unity.modules.cloth": { 99 | "version": "1.0.0", 100 | "depth": 0, 101 | "source": "builtin", 102 | "dependencies": { 103 | "com.unity.modules.physics": "1.0.0" 104 | } 105 | }, 106 | "com.unity.modules.director": { 107 | "version": "1.0.0", 108 | "depth": 0, 109 | "source": "builtin", 110 | "dependencies": { 111 | "com.unity.modules.audio": "1.0.0", 112 | "com.unity.modules.animation": "1.0.0" 113 | } 114 | }, 115 | "com.unity.modules.imageconversion": { 116 | "version": "1.0.0", 117 | "depth": 0, 118 | "source": "builtin", 119 | "dependencies": {} 120 | }, 121 | "com.unity.modules.imgui": { 122 | "version": "1.0.0", 123 | "depth": 0, 124 | "source": "builtin", 125 | "dependencies": {} 126 | }, 127 | "com.unity.modules.jsonserialize": { 128 | "version": "1.0.0", 129 | "depth": 0, 130 | "source": "builtin", 131 | "dependencies": {} 132 | }, 133 | "com.unity.modules.particlesystem": { 134 | "version": "1.0.0", 135 | "depth": 0, 136 | "source": "builtin", 137 | "dependencies": {} 138 | }, 139 | "com.unity.modules.physics": { 140 | "version": "1.0.0", 141 | "depth": 0, 142 | "source": "builtin", 143 | "dependencies": {} 144 | }, 145 | "com.unity.modules.physics2d": { 146 | "version": "1.0.0", 147 | "depth": 0, 148 | "source": "builtin", 149 | "dependencies": {} 150 | }, 151 | "com.unity.modules.screencapture": { 152 | "version": "1.0.0", 153 | "depth": 0, 154 | "source": "builtin", 155 | "dependencies": { 156 | "com.unity.modules.imageconversion": "1.0.0" 157 | } 158 | }, 159 | "com.unity.modules.subsystems": { 160 | "version": "1.0.0", 161 | "depth": 1, 162 | "source": "builtin", 163 | "dependencies": { 164 | "com.unity.modules.jsonserialize": "1.0.0" 165 | } 166 | }, 167 | "com.unity.modules.terrain": { 168 | "version": "1.0.0", 169 | "depth": 0, 170 | "source": "builtin", 171 | "dependencies": {} 172 | }, 173 | "com.unity.modules.terrainphysics": { 174 | "version": "1.0.0", 175 | "depth": 0, 176 | "source": "builtin", 177 | "dependencies": { 178 | "com.unity.modules.physics": "1.0.0", 179 | "com.unity.modules.terrain": "1.0.0" 180 | } 181 | }, 182 | "com.unity.modules.tilemap": { 183 | "version": "1.0.0", 184 | "depth": 0, 185 | "source": "builtin", 186 | "dependencies": { 187 | "com.unity.modules.physics2d": "1.0.0" 188 | } 189 | }, 190 | "com.unity.modules.ui": { 191 | "version": "1.0.0", 192 | "depth": 0, 193 | "source": "builtin", 194 | "dependencies": {} 195 | }, 196 | "com.unity.modules.uielements": { 197 | "version": "1.0.0", 198 | "depth": 0, 199 | "source": "builtin", 200 | "dependencies": { 201 | "com.unity.modules.imgui": "1.0.0", 202 | "com.unity.modules.jsonserialize": "1.0.0" 203 | } 204 | }, 205 | "com.unity.modules.umbra": { 206 | "version": "1.0.0", 207 | "depth": 0, 208 | "source": "builtin", 209 | "dependencies": {} 210 | }, 211 | "com.unity.modules.unityanalytics": { 212 | "version": "1.0.0", 213 | "depth": 0, 214 | "source": "builtin", 215 | "dependencies": { 216 | "com.unity.modules.unitywebrequest": "1.0.0", 217 | "com.unity.modules.jsonserialize": "1.0.0" 218 | } 219 | }, 220 | "com.unity.modules.unitywebrequest": { 221 | "version": "1.0.0", 222 | "depth": 0, 223 | "source": "builtin", 224 | "dependencies": {} 225 | }, 226 | "com.unity.modules.unitywebrequestassetbundle": { 227 | "version": "1.0.0", 228 | "depth": 0, 229 | "source": "builtin", 230 | "dependencies": { 231 | "com.unity.modules.assetbundle": "1.0.0", 232 | "com.unity.modules.unitywebrequest": "1.0.0" 233 | } 234 | }, 235 | "com.unity.modules.unitywebrequestaudio": { 236 | "version": "1.0.0", 237 | "depth": 0, 238 | "source": "builtin", 239 | "dependencies": { 240 | "com.unity.modules.unitywebrequest": "1.0.0", 241 | "com.unity.modules.audio": "1.0.0" 242 | } 243 | }, 244 | "com.unity.modules.unitywebrequesttexture": { 245 | "version": "1.0.0", 246 | "depth": 0, 247 | "source": "builtin", 248 | "dependencies": { 249 | "com.unity.modules.unitywebrequest": "1.0.0", 250 | "com.unity.modules.imageconversion": "1.0.0" 251 | } 252 | }, 253 | "com.unity.modules.unitywebrequestwww": { 254 | "version": "1.0.0", 255 | "depth": 0, 256 | "source": "builtin", 257 | "dependencies": { 258 | "com.unity.modules.unitywebrequest": "1.0.0", 259 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 260 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 261 | "com.unity.modules.audio": "1.0.0", 262 | "com.unity.modules.assetbundle": "1.0.0", 263 | "com.unity.modules.imageconversion": "1.0.0" 264 | } 265 | }, 266 | "com.unity.modules.vehicles": { 267 | "version": "1.0.0", 268 | "depth": 0, 269 | "source": "builtin", 270 | "dependencies": { 271 | "com.unity.modules.physics": "1.0.0" 272 | } 273 | }, 274 | "com.unity.modules.video": { 275 | "version": "1.0.0", 276 | "depth": 0, 277 | "source": "builtin", 278 | "dependencies": { 279 | "com.unity.modules.audio": "1.0.0", 280 | "com.unity.modules.ui": "1.0.0", 281 | "com.unity.modules.unitywebrequest": "1.0.0" 282 | } 283 | }, 284 | "com.unity.modules.vr": { 285 | "version": "1.0.0", 286 | "depth": 0, 287 | "source": "builtin", 288 | "dependencies": { 289 | "com.unity.modules.jsonserialize": "1.0.0", 290 | "com.unity.modules.physics": "1.0.0", 291 | "com.unity.modules.xr": "1.0.0" 292 | } 293 | }, 294 | "com.unity.modules.wind": { 295 | "version": "1.0.0", 296 | "depth": 0, 297 | "source": "builtin", 298 | "dependencies": {} 299 | }, 300 | "com.unity.modules.xr": { 301 | "version": "1.0.0", 302 | "depth": 0, 303 | "source": "builtin", 304 | "dependencies": { 305 | "com.unity.modules.physics": "1.0.0", 306 | "com.unity.modules.jsonserialize": "1.0.0", 307 | "com.unity.modules.subsystems": "1.0.0" 308 | } 309 | } 310 | } 311 | } 312 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 20 7 | productGUID: a2f129e4b97c49b479d93302c07f0cd1 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: SyntyEditorTools 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosUseCustomAppBackgroundBehavior: 0 56 | iosAllowHTTPDownload: 1 57 | allowedAutorotateToPortrait: 1 58 | allowedAutorotateToPortraitUpsideDown: 1 59 | allowedAutorotateToLandscapeRight: 1 60 | allowedAutorotateToLandscapeLeft: 1 61 | useOSAutorotation: 1 62 | use32BitDisplayBuffer: 1 63 | preserveFramebufferAlpha: 0 64 | disableDepthAndStencilBuffers: 0 65 | androidStartInFullscreen: 1 66 | androidRenderOutsideSafeArea: 1 67 | androidUseSwappy: 0 68 | androidBlitType: 0 69 | defaultIsNativeResolution: 1 70 | macRetinaSupport: 1 71 | runInBackground: 1 72 | captureSingleScreen: 0 73 | muteOtherAudioSources: 0 74 | Prepare IOS For Recording: 0 75 | Force IOS Speakers When Recording: 0 76 | deferSystemGesturesMode: 0 77 | hideHomeButton: 0 78 | submitAnalytics: 1 79 | usePlayerLog: 1 80 | bakeCollisionMeshes: 0 81 | forceSingleInstance: 0 82 | useFlipModelSwapchain: 1 83 | resizableWindow: 0 84 | useMacAppStoreValidation: 0 85 | macAppStoreCategory: public.app-category.games 86 | gpuSkinning: 1 87 | xboxPIXTextureCapture: 0 88 | xboxEnableAvatar: 0 89 | xboxEnableKinect: 0 90 | xboxEnableKinectAutoTracking: 0 91 | xboxEnableFitness: 0 92 | visibleInBackground: 1 93 | allowFullscreenSwitch: 1 94 | fullscreenMode: 1 95 | xboxSpeechDB: 0 96 | xboxEnableHeadOrientation: 0 97 | xboxEnableGuest: 0 98 | xboxEnablePIXSampling: 0 99 | metalFramebufferOnly: 0 100 | xboxOneResolution: 0 101 | xboxOneSResolution: 0 102 | xboxOneXResolution: 3 103 | xboxOneMonoLoggingLevel: 0 104 | xboxOneLoggingLevel: 1 105 | xboxOneDisableEsram: 0 106 | xboxOneEnableTypeOptimization: 0 107 | xboxOnePresentImmediateThreshold: 0 108 | switchQueueCommandMemory: 0 109 | switchQueueControlMemory: 16384 110 | switchQueueComputeMemory: 262144 111 | switchNVNShaderPoolsGranularity: 33554432 112 | switchNVNDefaultPoolsGranularity: 16777216 113 | switchNVNOtherPoolsGranularity: 16777216 114 | stadiaPresentMode: 0 115 | stadiaTargetFramerate: 0 116 | vulkanNumSwapchainBuffers: 3 117 | vulkanEnableSetSRGBWrite: 0 118 | m_SupportedAspectRatios: 119 | 4:3: 1 120 | 5:4: 1 121 | 16:10: 1 122 | 16:9: 1 123 | Others: 1 124 | bundleVersion: 0.1 125 | preloadedAssets: [] 126 | metroInputSource: 0 127 | wsaTransparentSwapchain: 0 128 | m_HolographicPauseOnTrackingLoss: 1 129 | xboxOneDisableKinectGpuReservation: 1 130 | xboxOneEnable7thCore: 1 131 | vrSettings: 132 | cardboard: 133 | depthFormat: 0 134 | enableTransitionView: 0 135 | daydream: 136 | depthFormat: 0 137 | useSustainedPerformanceMode: 0 138 | enableVideoLayer: 0 139 | useProtectedVideoMemory: 0 140 | minimumSupportedHeadTracking: 0 141 | maximumSupportedHeadTracking: 1 142 | hololens: 143 | depthFormat: 1 144 | depthBufferSharingEnabled: 1 145 | lumin: 146 | depthFormat: 0 147 | frameTiming: 2 148 | enableGLCache: 0 149 | glCacheMaxBlobSize: 524288 150 | glCacheMaxFileSize: 8388608 151 | oculus: 152 | sharedDepthBuffer: 1 153 | dashSupport: 1 154 | lowOverheadMode: 0 155 | protectedContext: 0 156 | v2Signing: 1 157 | enable360StereoCapture: 0 158 | isWsaHolographicRemotingEnabled: 0 159 | enableFrameTimingStats: 0 160 | useHDRDisplay: 0 161 | D3DHDRBitDepth: 0 162 | m_ColorGamuts: 00000000 163 | targetPixelDensity: 30 164 | resolutionScalingMode: 0 165 | androidSupportedAspectRatio: 1 166 | androidMaxAspectRatio: 2.1 167 | applicationIdentifier: {} 168 | buildNumber: {} 169 | AndroidBundleVersionCode: 1 170 | AndroidMinSdkVersion: 19 171 | AndroidTargetSdkVersion: 0 172 | AndroidPreferredInstallLocation: 1 173 | aotOptions: 174 | stripEngineCode: 1 175 | iPhoneStrippingLevel: 0 176 | iPhoneScriptCallOptimization: 0 177 | ForceInternetPermission: 0 178 | ForceSDCardPermission: 0 179 | CreateWallpaper: 0 180 | APKExpansionFiles: 0 181 | keepLoadedShadersAlive: 0 182 | StripUnusedMeshComponents: 1 183 | VertexChannelCompressionMask: 4054 184 | iPhoneSdkVersion: 988 185 | iOSTargetOSVersionString: 10.0 186 | tvOSSdkVersion: 0 187 | tvOSRequireExtendedGameController: 0 188 | tvOSTargetOSVersionString: 10.0 189 | uIPrerenderedIcon: 0 190 | uIRequiresPersistentWiFi: 0 191 | uIRequiresFullScreen: 1 192 | uIStatusBarHidden: 1 193 | uIExitOnSuspend: 0 194 | uIStatusBarStyle: 0 195 | appleTVSplashScreen: {fileID: 0} 196 | appleTVSplashScreen2x: {fileID: 0} 197 | tvOSSmallIconLayers: [] 198 | tvOSSmallIconLayers2x: [] 199 | tvOSLargeIconLayers: [] 200 | tvOSLargeIconLayers2x: [] 201 | tvOSTopShelfImageLayers: [] 202 | tvOSTopShelfImageLayers2x: [] 203 | tvOSTopShelfImageWideLayers: [] 204 | tvOSTopShelfImageWideLayers2x: [] 205 | iOSLaunchScreenType: 0 206 | iOSLaunchScreenPortrait: {fileID: 0} 207 | iOSLaunchScreenLandscape: {fileID: 0} 208 | iOSLaunchScreenBackgroundColor: 209 | serializedVersion: 2 210 | rgba: 0 211 | iOSLaunchScreenFillPct: 100 212 | iOSLaunchScreenSize: 100 213 | iOSLaunchScreenCustomXibPath: 214 | iOSLaunchScreeniPadType: 0 215 | iOSLaunchScreeniPadImage: {fileID: 0} 216 | iOSLaunchScreeniPadBackgroundColor: 217 | serializedVersion: 2 218 | rgba: 0 219 | iOSLaunchScreeniPadFillPct: 100 220 | iOSLaunchScreeniPadSize: 100 221 | iOSLaunchScreeniPadCustomXibPath: 222 | iOSUseLaunchScreenStoryboard: 0 223 | iOSLaunchScreenCustomStoryboardPath: 224 | iOSDeviceRequirements: [] 225 | iOSURLSchemes: [] 226 | iOSBackgroundModes: 0 227 | iOSMetalForceHardShadows: 0 228 | metalEditorSupport: 1 229 | metalAPIValidation: 1 230 | iOSRenderExtraFrameOnPause: 0 231 | appleDeveloperTeamID: 232 | iOSManualSigningProvisioningProfileID: 233 | tvOSManualSigningProvisioningProfileID: 234 | iOSManualSigningProvisioningProfileType: 0 235 | tvOSManualSigningProvisioningProfileType: 0 236 | appleEnableAutomaticSigning: 0 237 | iOSRequireARKit: 0 238 | iOSAutomaticallyDetectAndAddCapabilities: 1 239 | appleEnableProMotion: 0 240 | clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea 241 | templatePackageId: com.unity.template.3d@4.2.8 242 | templateDefaultScene: Assets/Scenes/SampleScene.unity 243 | AndroidTargetArchitectures: 1 244 | AndroidSplashScreenScale: 0 245 | androidSplashScreen: {fileID: 0} 246 | AndroidKeystoreName: 247 | AndroidKeyaliasName: 248 | AndroidBuildApkPerCpuArchitecture: 0 249 | AndroidTVCompatibility: 0 250 | AndroidIsGame: 1 251 | AndroidEnableTango: 0 252 | androidEnableBanner: 1 253 | androidUseLowAccuracyLocation: 0 254 | androidUseCustomKeystore: 0 255 | m_AndroidBanners: 256 | - width: 320 257 | height: 180 258 | banner: {fileID: 0} 259 | androidGamepadSupportLevel: 0 260 | AndroidValidateAppBundleSize: 1 261 | AndroidAppBundleSizeToValidate: 150 262 | m_BuildTargetIcons: [] 263 | m_BuildTargetPlatformIcons: [] 264 | m_BuildTargetBatching: 265 | - m_BuildTarget: Standalone 266 | m_StaticBatching: 1 267 | m_DynamicBatching: 0 268 | - m_BuildTarget: tvOS 269 | m_StaticBatching: 1 270 | m_DynamicBatching: 0 271 | - m_BuildTarget: Android 272 | m_StaticBatching: 1 273 | m_DynamicBatching: 0 274 | - m_BuildTarget: iPhone 275 | m_StaticBatching: 1 276 | m_DynamicBatching: 0 277 | - m_BuildTarget: WebGL 278 | m_StaticBatching: 0 279 | m_DynamicBatching: 0 280 | m_BuildTargetGraphicsJobs: 281 | - m_BuildTarget: MacStandaloneSupport 282 | m_GraphicsJobs: 0 283 | - m_BuildTarget: Switch 284 | m_GraphicsJobs: 1 285 | - m_BuildTarget: MetroSupport 286 | m_GraphicsJobs: 1 287 | - m_BuildTarget: AppleTVSupport 288 | m_GraphicsJobs: 0 289 | - m_BuildTarget: BJMSupport 290 | m_GraphicsJobs: 1 291 | - m_BuildTarget: LinuxStandaloneSupport 292 | m_GraphicsJobs: 1 293 | - m_BuildTarget: PS4Player 294 | m_GraphicsJobs: 1 295 | - m_BuildTarget: iOSSupport 296 | m_GraphicsJobs: 0 297 | - m_BuildTarget: WindowsStandaloneSupport 298 | m_GraphicsJobs: 1 299 | - m_BuildTarget: XboxOnePlayer 300 | m_GraphicsJobs: 1 301 | - m_BuildTarget: LuminSupport 302 | m_GraphicsJobs: 0 303 | - m_BuildTarget: AndroidPlayer 304 | m_GraphicsJobs: 0 305 | - m_BuildTarget: WebGLSupport 306 | m_GraphicsJobs: 0 307 | m_BuildTargetGraphicsJobMode: 308 | - m_BuildTarget: PS4Player 309 | m_GraphicsJobMode: 0 310 | - m_BuildTarget: XboxOnePlayer 311 | m_GraphicsJobMode: 0 312 | m_BuildTargetGraphicsAPIs: 313 | - m_BuildTarget: AndroidPlayer 314 | m_APIs: 150000000b000000 315 | m_Automatic: 0 316 | - m_BuildTarget: iOSSupport 317 | m_APIs: 10000000 318 | m_Automatic: 1 319 | - m_BuildTarget: AppleTVSupport 320 | m_APIs: 10000000 321 | m_Automatic: 0 322 | - m_BuildTarget: WebGLSupport 323 | m_APIs: 0b000000 324 | m_Automatic: 1 325 | m_BuildTargetVRSettings: 326 | - m_BuildTarget: Standalone 327 | m_Enabled: 0 328 | m_Devices: 329 | - Oculus 330 | - OpenVR 331 | openGLRequireES31: 0 332 | openGLRequireES31AEP: 0 333 | openGLRequireES32: 0 334 | m_TemplateCustomTags: {} 335 | mobileMTRendering: 336 | Android: 1 337 | iPhone: 1 338 | tvOS: 1 339 | m_BuildTargetGroupLightmapEncodingQuality: [] 340 | m_BuildTargetGroupLightmapSettings: [] 341 | playModeTestRunnerEnabled: 0 342 | runPlayModeTestAsEditModeTest: 0 343 | actionOnDotNetUnhandledException: 1 344 | enableInternalProfiler: 0 345 | logObjCUncaughtExceptions: 1 346 | enableCrashReportAPI: 0 347 | cameraUsageDescription: 348 | locationUsageDescription: 349 | microphoneUsageDescription: 350 | switchNetLibKey: 351 | switchSocketMemoryPoolSize: 6144 352 | switchSocketAllocatorPoolSize: 128 353 | switchSocketConcurrencyLimit: 14 354 | switchScreenResolutionBehavior: 2 355 | switchUseCPUProfiler: 0 356 | switchApplicationID: 0x01004b9000490000 357 | switchNSODependencies: 358 | switchTitleNames_0: 359 | switchTitleNames_1: 360 | switchTitleNames_2: 361 | switchTitleNames_3: 362 | switchTitleNames_4: 363 | switchTitleNames_5: 364 | switchTitleNames_6: 365 | switchTitleNames_7: 366 | switchTitleNames_8: 367 | switchTitleNames_9: 368 | switchTitleNames_10: 369 | switchTitleNames_11: 370 | switchTitleNames_12: 371 | switchTitleNames_13: 372 | switchTitleNames_14: 373 | switchPublisherNames_0: 374 | switchPublisherNames_1: 375 | switchPublisherNames_2: 376 | switchPublisherNames_3: 377 | switchPublisherNames_4: 378 | switchPublisherNames_5: 379 | switchPublisherNames_6: 380 | switchPublisherNames_7: 381 | switchPublisherNames_8: 382 | switchPublisherNames_9: 383 | switchPublisherNames_10: 384 | switchPublisherNames_11: 385 | switchPublisherNames_12: 386 | switchPublisherNames_13: 387 | switchPublisherNames_14: 388 | switchIcons_0: {fileID: 0} 389 | switchIcons_1: {fileID: 0} 390 | switchIcons_2: {fileID: 0} 391 | switchIcons_3: {fileID: 0} 392 | switchIcons_4: {fileID: 0} 393 | switchIcons_5: {fileID: 0} 394 | switchIcons_6: {fileID: 0} 395 | switchIcons_7: {fileID: 0} 396 | switchIcons_8: {fileID: 0} 397 | switchIcons_9: {fileID: 0} 398 | switchIcons_10: {fileID: 0} 399 | switchIcons_11: {fileID: 0} 400 | switchIcons_12: {fileID: 0} 401 | switchIcons_13: {fileID: 0} 402 | switchIcons_14: {fileID: 0} 403 | switchSmallIcons_0: {fileID: 0} 404 | switchSmallIcons_1: {fileID: 0} 405 | switchSmallIcons_2: {fileID: 0} 406 | switchSmallIcons_3: {fileID: 0} 407 | switchSmallIcons_4: {fileID: 0} 408 | switchSmallIcons_5: {fileID: 0} 409 | switchSmallIcons_6: {fileID: 0} 410 | switchSmallIcons_7: {fileID: 0} 411 | switchSmallIcons_8: {fileID: 0} 412 | switchSmallIcons_9: {fileID: 0} 413 | switchSmallIcons_10: {fileID: 0} 414 | switchSmallIcons_11: {fileID: 0} 415 | switchSmallIcons_12: {fileID: 0} 416 | switchSmallIcons_13: {fileID: 0} 417 | switchSmallIcons_14: {fileID: 0} 418 | switchManualHTML: 419 | switchAccessibleURLs: 420 | switchLegalInformation: 421 | switchMainThreadStackSize: 1048576 422 | switchPresenceGroupId: 423 | switchLogoHandling: 0 424 | switchReleaseVersion: 0 425 | switchDisplayVersion: 1.0.0 426 | switchStartupUserAccount: 0 427 | switchTouchScreenUsage: 0 428 | switchSupportedLanguagesMask: 0 429 | switchLogoType: 0 430 | switchApplicationErrorCodeCategory: 431 | switchUserAccountSaveDataSize: 0 432 | switchUserAccountSaveDataJournalSize: 0 433 | switchApplicationAttribute: 0 434 | switchCardSpecSize: -1 435 | switchCardSpecClock: -1 436 | switchRatingsMask: 0 437 | switchRatingsInt_0: 0 438 | switchRatingsInt_1: 0 439 | switchRatingsInt_2: 0 440 | switchRatingsInt_3: 0 441 | switchRatingsInt_4: 0 442 | switchRatingsInt_5: 0 443 | switchRatingsInt_6: 0 444 | switchRatingsInt_7: 0 445 | switchRatingsInt_8: 0 446 | switchRatingsInt_9: 0 447 | switchRatingsInt_10: 0 448 | switchRatingsInt_11: 0 449 | switchRatingsInt_12: 0 450 | switchLocalCommunicationIds_0: 451 | switchLocalCommunicationIds_1: 452 | switchLocalCommunicationIds_2: 453 | switchLocalCommunicationIds_3: 454 | switchLocalCommunicationIds_4: 455 | switchLocalCommunicationIds_5: 456 | switchLocalCommunicationIds_6: 457 | switchLocalCommunicationIds_7: 458 | switchParentalControl: 0 459 | switchAllowsScreenshot: 1 460 | switchAllowsVideoCapturing: 1 461 | switchAllowsRuntimeAddOnContentInstall: 0 462 | switchDataLossConfirmation: 0 463 | switchUserAccountLockEnabled: 0 464 | switchSystemResourceMemory: 16777216 465 | switchSupportedNpadStyles: 22 466 | switchNativeFsCacheSize: 32 467 | switchIsHoldTypeHorizontal: 0 468 | switchSupportedNpadCount: 8 469 | switchSocketConfigEnabled: 0 470 | switchTcpInitialSendBufferSize: 32 471 | switchTcpInitialReceiveBufferSize: 64 472 | switchTcpAutoSendBufferSizeMax: 256 473 | switchTcpAutoReceiveBufferSizeMax: 256 474 | switchUdpSendBufferSize: 9 475 | switchUdpReceiveBufferSize: 42 476 | switchSocketBufferEfficiency: 4 477 | switchSocketInitializeEnabled: 1 478 | switchNetworkInterfaceManagerInitializeEnabled: 1 479 | switchPlayerConnectionEnabled: 1 480 | ps4NPAgeRating: 12 481 | ps4NPTitleSecret: 482 | ps4NPTrophyPackPath: 483 | ps4ParentalLevel: 11 484 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 485 | ps4Category: 0 486 | ps4MasterVersion: 01.00 487 | ps4AppVersion: 01.00 488 | ps4AppType: 0 489 | ps4ParamSfxPath: 490 | ps4VideoOutPixelFormat: 0 491 | ps4VideoOutInitialWidth: 1920 492 | ps4VideoOutBaseModeInitialWidth: 1920 493 | ps4VideoOutReprojectionRate: 60 494 | ps4PronunciationXMLPath: 495 | ps4PronunciationSIGPath: 496 | ps4BackgroundImagePath: 497 | ps4StartupImagePath: 498 | ps4StartupImagesFolder: 499 | ps4IconImagesFolder: 500 | ps4SaveDataImagePath: 501 | ps4SdkOverride: 502 | ps4BGMPath: 503 | ps4ShareFilePath: 504 | ps4ShareOverlayImagePath: 505 | ps4PrivacyGuardImagePath: 506 | ps4NPtitleDatPath: 507 | ps4RemotePlayKeyAssignment: -1 508 | ps4RemotePlayKeyMappingDir: 509 | ps4PlayTogetherPlayerCount: 0 510 | ps4EnterButtonAssignment: 1 511 | ps4ApplicationParam1: 0 512 | ps4ApplicationParam2: 0 513 | ps4ApplicationParam3: 0 514 | ps4ApplicationParam4: 0 515 | ps4DownloadDataSize: 0 516 | ps4GarlicHeapSize: 2048 517 | ps4ProGarlicHeapSize: 2560 518 | playerPrefsMaxSize: 32768 519 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 520 | ps4pnSessions: 1 521 | ps4pnPresence: 1 522 | ps4pnFriends: 1 523 | ps4pnGameCustomData: 1 524 | playerPrefsSupport: 0 525 | enableApplicationExit: 0 526 | resetTempFolder: 1 527 | restrictedAudioUsageRights: 0 528 | ps4UseResolutionFallback: 0 529 | ps4ReprojectionSupport: 0 530 | ps4UseAudio3dBackend: 0 531 | ps4UseLowGarlicFragmentationMode: 1 532 | ps4SocialScreenEnabled: 0 533 | ps4ScriptOptimizationLevel: 0 534 | ps4Audio3dVirtualSpeakerCount: 14 535 | ps4attribCpuUsage: 0 536 | ps4PatchPkgPath: 537 | ps4PatchLatestPkgPath: 538 | ps4PatchChangeinfoPath: 539 | ps4PatchDayOne: 0 540 | ps4attribUserManagement: 0 541 | ps4attribMoveSupport: 0 542 | ps4attrib3DSupport: 0 543 | ps4attribShareSupport: 0 544 | ps4attribExclusiveVR: 0 545 | ps4disableAutoHideSplash: 0 546 | ps4videoRecordingFeaturesUsed: 0 547 | ps4contentSearchFeaturesUsed: 0 548 | ps4attribEyeToEyeDistanceSettingVR: 0 549 | ps4IncludedModules: [] 550 | ps4attribVROutputEnabled: 0 551 | monoEnv: 552 | splashScreenBackgroundSourceLandscape: {fileID: 0} 553 | splashScreenBackgroundSourcePortrait: {fileID: 0} 554 | blurSplashScreenBackground: 1 555 | spritePackerPolicy: 556 | webGLMemorySize: 16 557 | webGLExceptionSupport: 1 558 | webGLNameFilesAsHashes: 0 559 | webGLDataCaching: 1 560 | webGLDebugSymbols: 0 561 | webGLEmscriptenArgs: 562 | webGLModulesDirectory: 563 | webGLTemplate: APPLICATION:Default 564 | webGLAnalyzeBuildSize: 0 565 | webGLUseEmbeddedResources: 0 566 | webGLCompressionFormat: 1 567 | webGLLinkerTarget: 1 568 | webGLThreadsSupport: 0 569 | webGLWasmStreaming: 0 570 | scriptingDefineSymbols: {} 571 | platformArchitecture: {} 572 | scriptingBackend: {} 573 | il2cppCompilerConfiguration: {} 574 | managedStrippingLevel: {} 575 | incrementalIl2cppBuild: {} 576 | allowUnsafeCode: 0 577 | additionalIl2CppArgs: 578 | scriptingRuntimeVersion: 1 579 | gcIncremental: 0 580 | gcWBarrierValidation: 0 581 | apiCompatibilityLevelPerPlatform: {} 582 | m_RenderingPath: 1 583 | m_MobileRenderingPath: 1 584 | metroPackageName: Template_3D 585 | metroPackageVersion: 586 | metroCertificatePath: 587 | metroCertificatePassword: 588 | metroCertificateSubject: 589 | metroCertificateIssuer: 590 | metroCertificateNotAfter: 0000000000000000 591 | metroApplicationDescription: Template_3D 592 | wsaImages: {} 593 | metroTileShortName: 594 | metroTileShowName: 0 595 | metroMediumTileShowName: 0 596 | metroLargeTileShowName: 0 597 | metroWideTileShowName: 0 598 | metroSupportStreamingInstall: 0 599 | metroLastRequiredScene: 0 600 | metroDefaultTileSize: 1 601 | metroTileForegroundText: 2 602 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 603 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 604 | a: 1} 605 | metroSplashScreenUseBackgroundColor: 0 606 | platformCapabilities: {} 607 | metroTargetDeviceFamilies: {} 608 | metroFTAName: 609 | metroFTAFileTypes: [] 610 | metroProtocolName: 611 | XboxOneProductId: 612 | XboxOneUpdateKey: 613 | XboxOneSandboxId: 614 | XboxOneContentId: 615 | XboxOneTitleId: 616 | XboxOneSCId: 617 | XboxOneGameOsOverridePath: 618 | XboxOnePackagingOverridePath: 619 | XboxOneAppManifestOverridePath: 620 | XboxOneVersion: 1.0.0.0 621 | XboxOnePackageEncryption: 0 622 | XboxOnePackageUpdateGranularity: 2 623 | XboxOneDescription: 624 | XboxOneLanguage: 625 | - enus 626 | XboxOneCapability: [] 627 | XboxOneGameRating: {} 628 | XboxOneIsContentPackage: 0 629 | XboxOneEnableGPUVariability: 1 630 | XboxOneSockets: {} 631 | XboxOneSplashScreen: {fileID: 0} 632 | XboxOneAllowedProductIds: [] 633 | XboxOnePersistentLocalStorageSize: 0 634 | XboxOneXTitleMemory: 8 635 | XboxOneOverrideIdentityName: 636 | XboxOneOverrideIdentityPublisher: 637 | vrEditorSettings: 638 | daydream: 639 | daydreamIconForeground: {fileID: 0} 640 | daydreamIconBackground: {fileID: 0} 641 | cloudServicesEnabled: 642 | UNet: 1 643 | luminIcon: 644 | m_Name: 645 | m_ModelFolderPath: 646 | m_PortalFolderPath: 647 | luminCert: 648 | m_CertPath: 649 | m_SignPackage: 1 650 | luminIsChannelApp: 0 651 | luminVersion: 652 | m_VersionCode: 1 653 | m_VersionName: 654 | apiCompatibilityLevel: 6 655 | cloudProjectId: 656 | framebufferDepthMemorylessMode: 0 657 | projectName: 658 | organizationId: 659 | cloudEnabled: 0 660 | enableNativePlatformBackendsForNewInputSystem: 0 661 | disableOldInputManagerSupport: 0 662 | legacyClampBlendShapeWeights: 0 663 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.4.2f1 2 | m_EditorVersionWithRevision: 2019.4.2f1 (20b4642a3455) 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo 3DS: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | PSP2: 2 226 | Stadia: 5 227 | Standalone: 5 228 | WebGL: 3 229 | Windows Store Apps: 5 230 | XboxOne: 5 231 | iPhone: 2 232 | tvOS: 2 233 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Visit https://youtu.be/ljYOAoZYQOw and https://youtu.be/Pg6UZSdqKrYfor for video showcasing of the tool and it's use. 2 | 3 | Warning: Only the standard FantasyHero material currently works(You can use it as existing or create a new one from it). This appears to be an issue with Synty's pack and not my tool. All other materials in the standard and custom folders, FantasyHero_01, 02, etc.. appear broken. 4 |
Update: I've contacted Synty regarding the material issue, and it appears to be something related to URP. They've informed me they are currently working on a solution but the current solution is to upgrade to the URP and switch the shaders. This is only if you're attempting to use any material but the default FantasyHero. 5 | 6 | Steps to get up and running: 7 | 8 | 1. After installing package, drag and drop a Synty Modular Fantasy Hero model into the scene. 9 | The model can be the base model with no material assignments, the prefab with material assignments, any of the presets, or a custom character you've designed; 10 | as long as you kept the original hierarchy intact. 11 | 12 | 2. Add the ModularCharacterManager Component to the gameobject. This asset works by searching all the transforms of the object to find the necessary parts, 13 | so the component can be placed on the model gameobject, or a parent if that's your setup. 14 | Alternatively, you can just highlight the gameobject, and go into the new menu option ModularCharacter and select SetupWizard. 15 | This will give you the option to add the component through the custom editor. 16 | 17 | 3. After the component is added, select whether this is a new character or existing. New means you are setting up the character and resetting all it's parts to a base form. 18 | Existing means you are setting up a character, but keeping all the currently active parts on and registered. Do this if you want to keep a model looking exactly as it is. 19 | 20 | 4. Choose whether the model is male or female. If it's a new character, your choice can be changed in the editor. 21 | If it's an existing, make sure to match the gender with the currently active parts in order to make sure the parts are correctly registered to the right lists. 22 | 23 | 5. Create duplicate or use existing material. Creating a duplicate will have you select a material that will be duplicated and saved to BattleDrakeStudios/ModularCharacterEditor/Materials. 24 | Existing will have you choose a material that will be shared with any other objects that use that material. 25 | The material to be selected will need to be one of Synty's or one that uses their shader in order to for the tool to recognize the Shader Properties. 26 | 27 | 7. You will then be presented with the options to Commit which will initialize the character. 28 | Commit and Show Editor will initialize and automatically load the custom editor tool for modification. 29 | Reset will start over from the beginning. 30 | 31 | 8. Once initialized, your character is ready to go. Any changes can be made with the Modular Editor. 32 | Values for the parts range from -1 to all the parts currently registered under their respective hierarchies; 33 | -1 disables all active parts under that category and is a value used for the editor tool only. Disabling a part through the component requires only calling the DeactivatePart method with the bodypart. 34 | You can swap the gender between male and female at any stage and all parts will remain the same except eyebrows(male forms have more, so the value is reset to avoid an index out of bounds issue). 35 | Colors can be changed and are linked with Unity's Undo system making it easy to reverse any unwanted changes to the color system. 36 | 37 | 9. While the component is active and initialized, you have access to all the parts and the arrays that store them. 38 | The parts are arranged into two dictionaries for easy access and manipulation in game. 39 | To activate a part, you can call the method ActivePart in the ModularCharacterManager component class, passing in an enum ModularBodyPart for the part to activate, and the int partID which is the index of it within it's array. 40 | (the number in the Modular Editor is the correct partID you can use unless you wish to deactivate. Don't use -1, that's for the tool only). 41 | The activepart method will automatically deactivate any currently active parts for that particular bodypart, meaning no direct deactivating is required when activating another part. 42 | If you wish to deactivate a part manually, however, you can do so using the DeactivatePart method, putting in only the ModularBodyPart you wish to deactivate. 43 | 44 | ARMOR CREATOR TOOL: 45 | 46 | A new tool added to the original pack. This tool allows you to create custom armor pieces to attach to your character like in many popular MMO's. Steps to get it working. 47 | 48 | 1. Setup a new character from the Synty prefab. Choose the gender you wish as the base(can toggle between in the tool). Use an existing material, select fantasy hero. 49 | (The other materials are not functioning properly. An issue with Synty's pack, not mine). Commit changes. 50 | 2. Rename gameobject to "Pf_ArmorCreatorBase" without the quotations. 51 | 3. Create a Resources folder in your Assets project folder. 52 | 4. Drag and drop the gameobject into the resources folder. 53 | 5. Go into BattleDrakeStudios menu, select ModularCharacters > ArmorCreator. 54 | 6. Tool is now loaded! Preview window can be manipulated with different mouse buttons. Left Mouse button to rotate back and forth, and spin. Right mouse button to roll. 55 | Holding scroll/middle mouse button will reposition. Scrollwheel will zoom in and out. Holding shift will increase the speed of these functions. 56 | 7. Dropdown to select armor parts. If you wish to setup your own custom popup, access the enum class ModularArmorType and set up the different armor selections. Aftewards, 57 | go into the ModularArmorCreator class and scroll to the very bottom. There is a method to setup which parts are associated with each option. Name the cases to match your enum, 58 | then add the parts you want associated with the enum value to its case block. 59 | Afterwards, the tool should automatically populate the options for you. No further configuration needed. Create the item using your settings, and the created modularpart will reflect those changes. 60 | 8. After creating the item, you can create an icon using the built in Icon Creator. The tool was also released as a standalone, but i've included in this pack for you, and all setup with the tool. 61 | You can use it to create icons of the modular pieces, or any prefabs you drag and drop into the object field. The tool will work independently of the charactereditor. 62 | 9. After created the armorpart, it'll be created as a ModularArmor scriptableobject. Use your existing item structure, or create an item scriptable object from the asset menu I created for you. 63 | 10. Drag the modulararmor scriptable into the objectfield in the item. 64 | 11. Take an existing initialized character in the scene, and attached the demo EquipmentManager script to it. Make sure to remove the randomizer script if it's still on. 65 | 12. Increase the array size to add the items you want, and drag and drop them into the fields. 66 | 13. Hit play, and watch your item get automatically equipped! Use the equipmentmanager as a reference to how equipment is activated. 67 | 68 | Tips: You'll notice the base always spawns towards the top of the preview view. This is because the preview places the object based on it's privot point, which is at the feet for the modular characters. 69 | To fix this, you can create an empty game object and name it Pf_ArmorCreatorBase. Afterwards, attach the modularfantasy prefab and set it's y position to -1. Run the setup wizard on the parent gameobject. 70 | Drag and drop the prefab into the resources folder. Now your preview object will spawn in the center of the window! 71 | 72 | The youtube video goes over all this and can be used as a reference on how to use the tool. Any additional questions or concerns can be directed to me at battledrakecreations@gmail.com 73 | --------------------------------------------------------------------------------