using CommonLang;
using UnityEngine;

namespace ET.Client
{
    [ComponentOf(typeof(Scene))]
    public class ModelViewComponent : Entity, IAwake, IDestroy
    {
        [StaticField]
        public static ModelViewComponent Instance;
    }

    [FriendOf(typeof(ModelViewComponent))]
    public static class ModelViewComponentSystem
    {
        [ObjectSystem]
        public class ModelViewComponentAwakeSystem : AwakeSystem<ModelViewComponent>
        {
            protected override void Awake(ModelViewComponent self)
            {
                ModelViewComponent.Instance = self;
            }
        }

        [ObjectSystem]
        public class ModelViewComponentDestroySystem : DestroySystem<ModelViewComponent>
        {
            protected override void Destroy(ModelViewComponent self)
            {
                ModelViewComponent.Instance = null;
            }
        }
    }
}