using XGame.Framework;
using System;
using UnityEditor;

namespace XGame.Editor.Asset
{
    public static class PlatformUtil
    {
        public static PlatformType ActivePlatform => BuildTargetToPlatformType(EditorUserBuildSettings.activeBuildTarget);
        public static PlatformType BuildTargetToPlatformType(BuildTarget target)
        {
            switch (target)
            {
                case BuildTarget.StandaloneOSX:
                    return PlatformType.Mac;
                case BuildTarget.StandaloneWindows:
                case BuildTarget.StandaloneWindows64:
                    return PlatformType.Windows;
                case BuildTarget.iOS:
                    return PlatformType.iOS;
                case BuildTarget.Android:
                    return PlatformType.Android;
                default:
                    throw new NotImplementedException();
            }
        }
    }

}
