using ET; using FairyGUI; using Cal.DataTable; using System; using System.Collections.Generic; using UnityEngine; using ET.EventType; namespace ET { public static class CharacterHelper { public static JobType GetJobTypeById(int jobId) { return (JobType)(jobId % 2 != 0 ? jobId / 2 + 1 : jobId / 2); } public static string SexToSTring(SexType sex) { switch (sex) { default: case SexType.Male: return "男"; case SexType.Famale: return "女"; } } public static string GetLevelString(Unit unit,int fixedLevel =0) { try { NumericComponent num = unit.GetComponent(); int level = num.GetAsInt(NumericType.Level); if (level == 0) return fixedLevel + string.Empty; int trans = num.GetAsInt(NumericType.Transmigration); return GetLevelString(trans,level); } catch (Exception e) { Log.Error(e); } return "0·0"; } public static string GetLevelString(int trans, int level) { try { int baseLevel = ConstDefine.levelArr[trans]; int newLevel = level - baseLevel; return $"{trans}·{newLevel}"; } catch (Exception e) { Log.Error(e); } return "0·0"; } } }