mirror of
https://github.com/Steffo99/better-tee.git
synced 2024-11-26 16:54:17 +00:00
18 lines
555 B
C#
18 lines
555 B
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class SetSpriteFromDrawableFrame : MonoBehaviour
|
|||
|
{
|
|||
|
protected DrawableFrame frame;
|
|||
|
protected SpriteRenderer spriteRenderer;
|
|||
|
|
|||
|
void Start()
|
|||
|
{
|
|||
|
frame = GetComponent<DrawableFrame>();
|
|||
|
spriteRenderer = GetComponent<SpriteRenderer>();
|
|||
|
Sprite sprite = Sprite.Create(frame.texture, new Rect(0, 0, frame.resolution.x, frame.resolution.y), new Vector2(0.5f, 0.5f), frame.resolution.x);
|
|||
|
spriteRenderer.sprite = sprite;
|
|||
|
}
|
|||
|
}
|