- Home /
Question by
Moure Dievarse · Oct 29, 2014 at 09:46 PM ·
spritesprite renderersprite sheet
Can I get a sprite from a sprite sheet?
Hello, I made SpriteSheet by using TexturePacker.
And I try to use Sprite in the SpriteSheet. But, Sprite Value is Null.
using UnityEngine;
using System.Collections;
public class TileMap : MonoBehaviour {
public GameObject tile;
void Start () {
(GameObject.Instantiate(tile) as GameObject).GetComponent<SpriteRenderer>().sprite = Resources.Load<Sprite>("character");
}
void Update () {
}
}
How Can I get a sprite from Sheet in the script?
sorry to unskilled in English...
save.png
(9.0 kB)
Comment