Skip to content

Commit

Permalink
Fixed Checkered Texture error
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielBigardi committed May 4, 2023
1 parent 723c252 commit 23dcc65
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Editor/SpriteAnimationEditorWindow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections;
using System.IO;
using System.Linq;
using Unity.EditorCoroutines.Editor;
using UnityEditor;
Expand Down Expand Up @@ -27,7 +28,12 @@ protected override void OnEnable()
{
base.OnEnable();

_transparentCheckboardTexture = Resources.Load<Texture2D>("Sprite Animator/checkered");
string scriptPath = AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this));
string scriptFolder = Path.GetDirectoryName(scriptPath);
string spritesPath = Path.Combine("Sprites");
string checkeredTexturePath = Path.Combine(scriptFolder, spritesPath, "checkered.png");
_transparentCheckboardTexture = AssetDatabase.LoadAssetAtPath<Texture2D>(checkeredTexturePath);

if (_spriteAnimationObject != null)
{
_serializedObject = new SerializedObject(_spriteAnimationObject);
Expand Down
Binary file added Editor/Sprites/checkered.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 123 additions & 0 deletions Editor/Sprites/checkered.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.gabrielbigardi.spriteanimator",
"version": "2.0.0",
"version": "2.0.1",
"displayName": "2D Sprite Animator",
"description": "Performatic, simple and easy animator for 2D games",
"unity": "2020.3",
Expand Down

0 comments on commit 23dcc65

Please sign in to comment.