-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
25 changed files
with
8,386 additions
and
40 deletions.
There are no files selected for viewing
133 changes: 133 additions & 0 deletions
133
FairyTaleDefender/Assets/_Game/Materials/ColorPalettes/Tile_Surface.mat
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
FairyTaleDefender/Assets/_Game/Materials/ColorPalettes/Tile_Surface.mat.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file modified
BIN
+2.34 KB
(110%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Corner_Diagonal.fbx
Binary file not shown.
Binary file modified
BIN
+2.34 KB
(110%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Corner_Inner.fbx
Binary file not shown.
Binary file modified
BIN
+2.34 KB
(110%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Corner_Outer.fbx
Binary file not shown.
Binary file modified
BIN
+2.34 KB
(110%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Flat.fbx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Ground.fbx
Binary file not shown.
Binary file modified
BIN
+2.36 KB
(110%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Slope.fbx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Water_Corner.fbx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Water_Slope.fbx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Water_Source_with_stones.fbx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Water_Straight.fbx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Way_Corner.fbx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Way_Slope.fbx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Way_Stage.fbx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Way_Straight.fbx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Way_T-Cross.fbx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
FairyTaleDefender/Assets/_Game/Models/Environment/Tiles/Way_X-Cross.fbx
Binary file not shown.
40 changes: 0 additions & 40 deletions
40
...nder/Assets/_Game/Scripts/Editor/AssetProcessors/DefaultColorPaletteAssetPostprocessor.cs
This file was deleted.
Oops, something went wrong.
66 changes: 66 additions & 0 deletions
66
...efender/Assets/_Game/Scripts/Editor/AssetProcessors/DefaultMaterialsAssetPostprocessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using System; | ||
using System.Linq; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace BoundfoxStudios.FairyTaleDefender.Editor.AssetProcessors | ||
{ | ||
public class DefaultMaterialsAssetPostprocessor : AssetPostprocessor | ||
{ | ||
private const string ColorPaletteSummerMaterialGuid = "178b74dc53be54709b84d85209d03744"; | ||
private const string TileSurfaceMaterialGuid = "4a52ce37bf16a42a29e689c796f909ac"; | ||
|
||
private Material? OnAssignMaterialModel(Material material, Renderer renderer) | ||
{ | ||
if (TryHandleMaterial(material, "ColorPalette", FindColorPaletteSummerMaterial, out var colorPaletteMaterial)) | ||
{ | ||
return colorPaletteMaterial; | ||
} | ||
|
||
if (TryHandleMaterial(material, "Surface", FindTileSurfaceMaterial, out var surfaceMaterial)) | ||
{ | ||
return surfaceMaterial; | ||
} | ||
|
||
return null; | ||
} | ||
|
||
private bool TryHandleMaterial(Material material, string name, Func<Material?> materialAccessor, | ||
out Material? materialToApply) | ||
{ | ||
materialToApply = null; | ||
|
||
if (material.name != name) | ||
{ | ||
return false; | ||
} | ||
|
||
var importer = (ModelImporter)assetImporter; | ||
var existingRemaps = importer.GetExternalObjectMap(); | ||
var hasRemap = existingRemaps.Any(kvp => kvp.Key.name == name); | ||
|
||
if (hasRemap) | ||
{ | ||
return false; | ||
} | ||
|
||
materialToApply = materialAccessor(); | ||
|
||
return true; | ||
} | ||
|
||
private Material? FindColorPaletteSummerMaterial() => FindMaterial(ColorPaletteSummerMaterialGuid); | ||
|
||
private Material? FindTileSurfaceMaterial() => FindMaterial(TileSurfaceMaterialGuid); | ||
|
||
private Material? FindMaterial(string guidString) | ||
{ | ||
GUID.TryParse(guidString, out var guid); | ||
context.DependsOnSourceAsset(guid); | ||
var path = AssetDatabase.GUIDToAssetPath(guidString); | ||
return AssetDatabase.LoadAssetAtPath<Material>(path); | ||
} | ||
|
||
public override uint GetVersion() => 5; | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.