//[RuntimeInitializeOnLoadMethod] //public static void LoadFromRecord() { // CharacterInfo info = new CharacterInfo(); // info= info.Load<CharacterInfo>(); // Debug.Log(info.Items.Weapons.Count); //} public CharacterInfo(CharacterLogic Logic) { ID = Logic.GetID(); Level = Logic.GetLevel(); Exp = Logic.GetExp(); Career = Logic.GetCareer(); Attribute = Logic.GetAttribute(); CurrentHP = Logic.GetCurrentHP(); MaxHP = Logic.GetMaxHP(); Items = new ItemGroup(); Skills = new SkillGroup(); }
public void Init(CharacterLogic ch) { Text_Name.text = ch.GetName(); Text_Job.text = ch.GetCareerName(); Text_LV.text = ch.Info.Level.ToString(); Text_EXP.text = ch.GetExp().ToString(); string curHp = null; if (ch.GetCurrentHP() == ch.Info.MaxHP) { curHp = "<color=green>" + ch.GetCurrentHP() + "</color>"; } if (ch.GetCurrentHP() >= ch.Info.MaxHP / 2 && ch.GetCurrentHP() < ch.Info.MaxHP) { curHp = "<color=orange>" + ch.GetCurrentHP() + "</color>"; } if (ch.GetCurrentHP() < ch.Info.MaxHP / 2) { curHp = "<color=red>" + ch.GetCurrentHP() + "</color>"; } Text_HP.text = curHp + "/" + ch.GetMaxHP(); }
public void ShowAttackInfo(CharacterLogic currentCharacterLogic, CharacterLogic logic) { WeaponItem equipWeapon = currentCharacterLogic.Info.Items.GetEquipWeapon(); var def = ResourceManager.GetWeaponDef(equipWeapon.ID); int afterHP = currentCharacterLogic.GetCurrentHP() - BattleLogic.GetAttackDamage(logic, currentCharacterLogic); Left_BattleAttackInfo.Show(currentCharacterLogic.GetPortrait(), def.Icon, def.CommonProperty.Name, currentCharacterLogic.GetMaxHP(), currentCharacterLogic.GetCurrentHP(), afterHP, currentCharacterLogic.GetHit(), BattleLogic.GetAttackDamage(currentCharacterLogic, logic), currentCharacterLogic.GetCritical(), BattleLogic.GetAttackCount(currentCharacterLogic, logic)); equipWeapon = logic.Info.Items.GetEquipWeapon(); def = ResourceManager.GetWeaponDef(equipWeapon.ID); afterHP = logic.GetCurrentHP() - BattleLogic.GetAttackDamage(currentCharacterLogic, logic); Right_BattleAttackInfo.Show(logic.GetPortrait(), def.Icon, def.CommonProperty.Name, logic.GetMaxHP(), logic.GetCurrentHP(), afterHP, logic.GetHit(), BattleLogic.GetAttackDamage(logic, currentCharacterLogic), logic.GetCritical(), BattleLogic.GetAttackCount(logic, currentCharacterLogic)); }