1
Fork 0
mirror of https://github.com/Steffo99/octogem.git synced 2024-11-22 13:04:19 +00:00
octogem/Assets/Scripts/Components/Rendering/GenericRenderer.cs

38 lines
876 B
C#
Raw Normal View History

2018-09-30 14:35:17 +00:00
using UnityEngine;
public class GenericRenderer : MonoBehaviour
{
private RuntimeAnimatorController animatorController;
private SpriteRenderer spriteRenderer;
private Animator animator;
public RuntimeAnimatorController AnimatorController
{
get
{
return animatorController;
}
set
{
animatorController = value;
animator.runtimeAnimatorController = value;
}
}
public virtual void Awake()
{
spriteRenderer = GetComponent<SpriteRenderer>();
animator = GetComponent<Animator>();
if (spriteRenderer == null)
{
Debug.LogError("Missing spriteRenderer on rendered GameObject");
}
if (animator == null)
{
Debug.LogError("Missiong animator on rendered GameObject");
}
}
}