コード例 #1
0
ファイル: BattleViewModels.cs プロジェクト: K-Yoshiki/menko
		List<UnitVM> CreateUnitVMList(MenkoBattleData[] unitList)
		{
			List<UnitVM> unitVMList = new List<UnitVM>();
			for (int i = 0; i < unitList.Length; ++i)
			{
				var unit = unitList[i];
				string path = AssetPath.GetMonsterFaceTexPath(unit.BaseData.ID);
				var assetData = AssetManager.Load<Sprite>(path);
				var face = assetData.Asset as Sprite;
				var vm = new UnitVM(face, unit.IsRepresent, unit.SkillData.NeedTurn);
                unitVMList.Add(vm);
				unit.UnitViewModel = vm;
			}
			return unitVMList;
		}
コード例 #2
0
        List <UnitVM> CreateUnitVMList(MenkoBattleData[] unitList)
        {
            List <UnitVM> unitVMList = new List <UnitVM>();

            for (int i = 0; i < unitList.Length; ++i)
            {
                var    unit      = unitList[i];
                string path      = AssetPath.GetMonsterFaceTexPath(unit.BaseData.ID);
                var    assetData = AssetManager.Load <Sprite>(path);
                var    face      = assetData.Asset as Sprite;
                var    vm        = new UnitVM(face, unit.IsRepresent, unit.SkillData.NeedTurn);
                unitVMList.Add(vm);
                unit.UnitViewModel = vm;
            }
            return(unitVMList);
        }