首页 > 其他 > 详细

GameLoad

时间:2016-06-25 09:35:56      阅读:253      评论:0      收藏:0      [点我收藏+]

using UnityEngine;
using System.Collections;

public class GameLoad : MonoBehaviour {

public GameObject magicianPrefab;
public GameObject swordmanPrefab;

void Awake() {
int selectdIndex = PlayerPrefs.GetInt("SelectedCharacterIndex");
string name = PlayerPrefs.GetString("name");

GameObject go = null;
if (selectdIndex == 0) {
go = GameObject.Instantiate(magicianPrefab) as GameObject;
} else if (selectdIndex == 1) {
go = GameObject.Instantiate(swordmanPrefab) as GameObject;
}
go.GetComponent<PlayerStatus>().name = name;
}
}

GameLoad

原文:http://www.cnblogs.com/ZeroMurder/p/5615815.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!