本文整理汇总了C#中Level.constructMatrix方法的典型用法代码示例。如果您正苦于以下问题:C# Level.constructMatrix方法的具体用法?C# Level.constructMatrix怎么用?C# Level.constructMatrix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Level
的用法示例。
在下文中一共展示了Level.constructMatrix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: remoteCall
protected IEnumerator remoteCall()
{
changinglevels = true;
WWW content = new WWW(@"http://wiki-412.appspot.com/json/alpha2.json");
while(!content.isDone)
{
Debug.Log("fetching");
yield return null;
}
string hold = content.text;
currentlevel = JsonMapper.ToObject<Level>(hold);
currentlevel.fixLimits();
currentlevel.constructMatrix(3);
generateLevel();
changinglevels = false;
}
示例2: read
//Use stream reader and external json library to read in a saved level
//after loading in make sure to fix limits to the maximums so that padding will be consistent when added
//then make the matrix of right size, including padding
protected void read(int padding)
{
Debug.Log ("reading level");
if(!Application.isWebPlayer)
{
using(StreamReader file = new StreamReader(Application.dataPath+"/Levels/"+currentlevel.name+".json"))
{
string hold = file.ReadToEnd();
currentlevel = JsonMapper.ToObject<Level>(hold);
}
currentlevel.fixLimits();
currentlevel.constructMatrix(padding);
generateLevel();
}
else if(Application.isWebPlayer)
{
StartCoroutine(remoteCall());
}
}