本文整理汇总了C#中DataManager.readFile方法的典型用法代码示例。如果您正苦于以下问题:C# DataManager.readFile方法的具体用法?C# DataManager.readFile怎么用?C# DataManager.readFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataManager
的用法示例。
在下文中一共展示了DataManager.readFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: loadSkillList
private void loadSkillList() {
DataManager manager = new DataManager ();
BasePlayer baseplayer = GameConstants.findPlayerInProject ().GetComponent<ToonCharacter_PlayerScript> ().getBasePlayer ();
switch(baseplayer.playerType) {
case PlayerType.MELEE:
skillList = manager.readFile<List<BaseSkill>> (GameConstants.skillList_Melee_Filename);
break;
case PlayerType.DISTANCE:
skillList = manager.readFile<List<BaseSkill>> (GameConstants.skillList_Archer_Filename);
break;
case PlayerType.MAGIC:
skillList = manager.readFile<List<BaseSkill>> (GameConstants.skillList_Mage_Filename);
break;
}
activeSkillList = new List<BaseSkill> ();
passiveSkillList = new List<BaseSkill> ();
Dictionary<string, int> skillLevel = baseplayer.playerStats.skillLevel;
// extract active and passive Skills
foreach (BaseSkill skill in skillList) {
if (skillLevel.ContainsKey(skill.identifier)) {
skill.level = skillLevel[skill.identifier];
}
if (skill.type == Skill.type.AKTIVE) {
activeSkillList.Add (skill);
} else {
passiveSkillList.Add (skill);
}
}
}
示例2: loadPlayer
public void loadPlayer () {
DataManager dataManager = new DataManager ();
BasePlayer basePlayer = dataManager.readFile<BasePlayer> (GameConstants.saveFileName);
switch (basePlayer.playerType) {
case PlayerType.MELEE:
playerObject = instantiatePlayerObject(prefabObjectMelee, basePlayer);
break;
case PlayerType.DISTANCE:
playerObject = instantiatePlayerObject(prefabObjectArcher, basePlayer);
break;
case PlayerType.MAGIC:
playerObject = instantiatePlayerObject(prefabObjectMage, basePlayer);
break;
}
playerObject.transform.SetParent(this.gameObject.transform);
playerObject.GetComponent<ToonCharacter_PlayerScript>().setBasePlayer(basePlayer);
playerObject.name = playerObject.name.Split('(')[0];
}
示例3: loadSkillList
private List<BaseSkill> loadSkillList(PlayerType type) {
DataManager manager = new DataManager ();
switch (type) {
case PlayerType.MELEE:
return manager.readFile<List<BaseSkill>> (GameConstants.skillList_Melee_Filename);
case PlayerType.MAGIC:
return manager.readFile<List<BaseSkill>> (GameConstants.skillList_Mage_Filename);
case PlayerType.DISTANCE:
return manager.readFile<List<BaseSkill>> (GameConstants.skillList_Archer_Filename);
}
return null;
}