码迷,mamicode.com
首页 > 其他好文 > 详细

GameLoad

时间:2016-06-25 09:38:55      阅读:178      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!