/*
 *Copyright(C) 2024 by Chief All rights reserved.
 *Unity版本：2023.2.5f1c1 
 *作者:Chief  
 *创建日期: 2024-02-28 
 *模块说明：Ecs通用模块
 *版本: 1.0
*/

using Unity.Entities;

namespace Aster.DotsRender
{
    /// <summary>
    /// 渲染通用
    /// </summary>
    public static class DotsRenderUtils
    {
        #region 初始化与卸载

        public static bool Inited { get; private set; }

        private static AsterDotsRenderRunner Runner => AsterDotsRenderRunner.Get;

        public static void Init(World world)
        {
            if (Inited)
            {
                Logger.LogError("不能重复初始化 AsterDotsRender");
                return;
            }

            AsterDotsRenderRunner.Create();
            Inited = true;
        }

        public static void Dispose()
        {
            if (!Inited)
                return;

            AsterDotsRenderRunner.Release();
            Inited = false;
        }

        #endregion

    }
}