本文整理汇总了C#中FileManager.ReadSystemTexture方法的典型用法代码示例。如果您正苦于以下问题:C# FileManager.ReadSystemTexture方法的具体用法?C# FileManager.ReadSystemTexture怎么用?C# FileManager.ReadSystemTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileManager
的用法示例。
在下文中一共展示了FileManager.ReadSystemTexture方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetSystem
public void SetSystem(PlanetSystem sys, int row, int col)
{
//Debug.Log (row + " , " + col + " :::::: " + hexMap.Length + " ::::::::::: " + hexMap[row].Length);
Vector2 arrayCoords = axialToArrayCoords(col, row);
//Debug.Log (arrayCoords.x + " , " + arrayCoords.y);
SystemHex hex = hexMap[(int)arrayCoords.x][(int)arrayCoords.y];
hex.System = sys;
hex.SetSection(sectionNumber);
hex.SetPosition(new Vector2(row, col));
fileManager = GameObject.Find("Manager").GetComponent<FileManager>();
Material topMaterial = hex.gameObject.transform.FindChild ("Top").renderer.material;
topMaterial.mainTexture = fileManager.ReadSystemTexture(sys.Name, sys.Id, hex.gameObject);
topMaterial.color = new Color(topMaterial.color.r, topMaterial.color.g, topMaterial.color.b, 1.0f);
Material sideMaterial = hex.gameObject.renderer.material;
sideMaterial.mainTexture = fileManager.ReadSystemTexture("Empty System 1", "Empty System 1", hex.gameObject);
sideMaterial.color = new Color(0.035f, 0.075f, 0.212f, 1.0f);
hex.gameObject.transform.FindChild("Top").gameObject.SetActive(true);
hex.gameObject.name = hex.System.Name;
if (sys.isSpecial()) {
foreach (SystemHex iterHex in HexesInRadius(hex.GetPosition(), 1)) {
iterHex.NextToSpecial = true;
}
}
hex.IsValidPlacement = false;
}
示例2: setEmptyHexSlot
private SystemHex setEmptyHexSlot(GameObject hexPrefab, Vector3 hexLocation, float rotation, Color emptyColor)
{
GameObject hexObject = (GameObject)GameObject.Instantiate(hexPrefab, hexLocation, Quaternion.identity);
SystemHex sysHex = hexObject.AddComponent<SystemHex>();
hexObject.transform.parent = GameObject.Find("Board").transform;
hexObject.transform.Rotate(0.0f, -rotation, 0.0f);
hexObject.transform.FindChild("Top").gameObject.SetActive(false);
fileManager = GameObject.Find("Manager").GetComponent<FileManager>();
// Material topMaterial = hexObject.transform.FindChild ("Top").renderer.material;
// topMaterial.mainTexture = fileManager.ReadSystemTexture("Regular System (Back)", "Regular System (Back)", hexObject);
// topMaterial.color = new Color(topMaterial.color.r, topMaterial.color.g, topMaterial.color.b, .3f);
Material sideMaterial = hexObject.renderer.material;
sideMaterial.mainTexture = fileManager.ReadSystemTexture("System Placeholder", "System Placeholder", hexObject);
emptyColor.a = 0.3f;
sideMaterial.color = emptyColor;
hexObject.name = "<Empty System Slot>";
sysHex.IsValidPlacement = false;
return sysHex;
}
示例3: BoardSection
public BoardSection(int section, PlanetSystem[][] inMap, int[] inFirstColumns, Vector3 sectionOrigin, GameObject pHexPrefab, float pHexSize)
{
sectionNumber = section;
origin = sectionOrigin;
maxRowSize = inMap [inMap.Length / 2].Length/2;
hexSize = pHexSize;
firstColumns = inFirstColumns;
hexMap = new SystemHex[inMap.Length][];
for(int i=0;i<inMap.Length;i++) {
SystemHex[] hexRow = new SystemHex[inMap[i].Length];
for(int j=0;j<inMap[i].Length;j++) {
//Create hex object and add systemHex script
GameObject hexObject = (GameObject)GameObject.Instantiate(pHexPrefab, GetHexLocation (j,i), Quaternion.identity);
SystemHex sysHex = hexObject.AddComponent<SystemHex>();
sysHex.System = inMap[i][j];
sysHex.SetSection(sectionNumber);
sysHex.SetPosition(arrayCoordsToAxial(i, j));
hexObject.transform.parent = GameObject.Find("Board").transform;
fileManager = GameObject.Find("Manager").GetComponent<FileManager>();
hexObject.transform.FindChild("Top").renderer.material.mainTexture = fileManager.ReadSystemTexture(inMap[i][j].Name, inMap[i][j].Id, hexObject);
hexObject.name = inMap[i][j].Name;
hexRow[j] = sysHex;
}
hexMap[i] = hexRow;
}
}