当前位置: 首页>>代码示例>>C#>>正文


C# DataManager.readFile方法代码示例

本文整理汇总了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);
			}
		}
	}
开发者ID:VtheunforgivenV,项目名称:DigitaleSpiele,代码行数:39,代码来源:UIManager_SkillSystem.cs

示例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];
    }
开发者ID:VtheunforgivenV,项目名称:DigitaleSpiele,代码行数:19,代码来源:LoadPlayer.cs

示例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;
	}
开发者ID:VtheunforgivenV,项目名称:DigitaleSpiele,代码行数:17,代码来源:PlayerStats.cs


注:本文中的DataManager.readFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。