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(); animator = GetComponent(); if (spriteRenderer == null) { Debug.LogError("Missing spriteRenderer on rendered GameObject"); } if (animator == null) { Debug.LogError("Missiong animator on rendered GameObject"); } } }