using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace TFramework
{
    /// <summary>
    /// UI资源标记
    /// </summary>
    public class UIResourceAttribute : Attribute
    {
        public ResLoadMode LoadMode { get; private set; }
        public string ResourcePath { get; private set; }
        public string AssetBundleName { get; private set; }
        public string AssetPath { get; private set; }

        public string WorlUIDomain { get; private set; }

        /// <summary>
        /// UI资源标记
        /// </summary>
        /// <param name="resourcePath">资源的Resource路径</param>
        /// <param name="assetBundleName">资源的AB包名字</param>
        /// <param name="assetPath">资源相对路径</param>
        /// <param name="loadMode">加载模式</param>
        /// <param name="canvasType">UI挂载Canvas类型</param>
        /// <param name="worldUIDomain">世界UI作用域</param>
        public UIResourceAttribute(string resourcePath, string assetBundleName, string assetPath, ResLoadMode loadMode,string worldUIDomain)
        {
            LoadMode = loadMode;
            ResourcePath = resourcePath;
            AssetBundleName = assetBundleName;
            AssetPath = assetPath;
            WorlUIDomain = worldUIDomain;
        }

        public UIResourceAttribute(string resourcePath, string worldUIDomain)
        {
            LoadMode = ResLoadMode.Resourece;
            ResourcePath = resourcePath;
            AssetBundleName = "";
            AssetPath = "";
            WorlUIDomain = worldUIDomain;
        }

        public UIResourceAttribute(string assetBundleName, string assetPath, string worldUIDomain)
        {
            LoadMode = ResLoadMode.AssetBundle;
            ResourcePath = "";
            AssetBundleName = assetBundleName;
            AssetPath = assetPath;
            WorlUIDomain = worldUIDomain;
        }
    }
}
