mirror of
https://github.com/DerTyp7/example-top-down-unity.git
synced 2025-10-30 12:57:08 +01:00
char parse to sprite
This commit is contained in:
25
Assets/CharSpriteManager.cs
Normal file
25
Assets/CharSpriteManager.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CharSpriteManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
List<CharSprite> charSprites = new List<CharSprite>();
|
||||
|
||||
private void Start()
|
||||
{
|
||||
LoadIntoList();
|
||||
}
|
||||
void LoadIntoList()
|
||||
{
|
||||
CharSprite[] loadedRes = Resources.FindObjectsOfTypeAll<CharSprite>();
|
||||
|
||||
foreach (CharSprite sprite in loadedRes)
|
||||
{
|
||||
Debug.Log(sprite.name);
|
||||
charSprites.Add(sprite);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user