本文整理汇总了C#中Vector3i.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3i.ToString方法的具体用法?C# Vector3i.ToString怎么用?C# Vector3i.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3i
的用法示例。
在下文中一共展示了Vector3i.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetChunkAt
public Chunk GetChunkAt(Vector3i position) {
return chunks[position.ToString()];
}
示例2: removeByPosition
private void removeByPosition(List<string> _coords)
{
try {
int x = int.MinValue;
int.TryParse (_coords [0], out x);
int y = int.MinValue;
int.TryParse (_coords [1], out y);
int z = int.MinValue;
int.TryParse (_coords [2], out z);
if (x == int.MinValue || y == int.MinValue || z == int.MinValue) {
SdtdConsole.Instance.Output ("At least one of the given coordinates is not a valid integer");
return;
}
Vector3i vectorKfpValue = new Vector3i(x, y, z);
Vector3i vectorKfpMin = new Vector3i (x-3, y-3, z-3);
Vector3i vectorKfpMax = new Vector3i (x+3, y+3, z+3);
PersistentPlayerList PlayersLst = GameManager.Instance.GetPersistentPlayerList ();
Boolean KFound = false;
Dictionary<Vector3i, PersistentPlayerData> positionToLPBlockOwner = PlayersLst.m_lpBlockMap;
foreach (KeyValuePair<Vector3i, PersistentPlayerData> current in positionToLPBlockOwner)
{
if ((int)current.Key.x >= (int)vectorKfpMin.x && (int)current.Key.x <= (int)vectorKfpMax.x)
{
SdtdConsole.Instance.Output("Coordinates X found: " + (int)current.Key.x);
if ((int)current.Key.y >= (int)vectorKfpMin.y && (int)current.Key.y <= (int)vectorKfpMax.y)
{
SdtdConsole.Instance.Output("Coordinates Y found: " + (int)current.Key.y);
if ((int)current.Key.z >= (int)vectorKfpMin.z && (int)current.Key.z <= (int)vectorKfpMax.z)
{
SdtdConsole.Instance.Output("Coordinates Z found: " + (int)current.Key.z);
Vector3i vectorKfpEnd = new Vector3i ((int)current.Key.x, (int)current.Key.y, (int)current.Key.z);
BlockChangeInfo bci = new BlockChangeInfo (vectorKfpEnd, 0, true);
List<BlockChangeInfo> changes = new List<BlockChangeInfo> ();
changes.Add (bci);
GameManager.Instance.SetBlocksRPC (changes);
SdtdConsole.Instance.Output ("Land protection block at (" + vectorKfpEnd.ToString() + ") removed");
KFound = true;
return;
}
}
}
}
if (!KFound)
{
SdtdConsole.Instance.Output("Aucune keystone trouvee a cet emplacement (" + vectorKfpValue.ToString() + ").");
}
} catch (Exception e) {
Log.Out ("Error in RemoveLandProtection.removeByPosition: " + e);
}
}
示例3: MakeChunk
Chunk MakeChunk(Vector3i location) {
var chunk = new Chunk();
chunk.cubeSize = cubeSize;
chunk.blockMaterial = material;
chunk.cubeLegend = cubeLegend;
//chunkGameObject.transform.localScale = Vector3.one
chunk.gridPosition = location;
chunk.cubeObject = this;
chunk.dimensionsInCubes = chunkDimensions.Clone();
chunk.gridPosition = location;
chunks[location.ToString()] = chunk;
return chunk;
}
示例4: HookMouseEvents
public static void HookMouseEvents()
{
ChunkManager cm = AManager<ChunkManager>.getInstance();
RaycastHit raycastHit;
Vector3[] array;
string str;
if(Physics.Raycast(Camera.current.ScreenPointToRay(Input.mousePosition), out raycastHit)) {
if(raycastHit.transform.tag == "PickPlane") {
Vector3 normalized = (raycastHit.point - Camera.current.transform.position).normalized;
array = cm.Pick(raycastHit.point, normalized, true);
} else {
array = cm.Pick(Camera.current.transform.position, Camera.current.ScreenPointToRay(Input.mousePosition).direction, true);
}
Vector3 pos = cm.GetWorldPosition(array[0], array[1]);
Vector3i abs = new Vector3i((int)(array[0].x*cm.chunkSize.x+array[1].x),(int)array[0].y,(int)(array[0].z*cm.chunkSize.z+array[1].z));
str =
"World: "+pos.ToString()+"\n"+
"Chunk: "+array[0].ToString()+"\n"+
"ChkBlk: "+array[1].ToString()+"\n"+
"AbsBlk: "+abs.ToString()+"\n"+
"Hit: "+raycastHit.transform.tag;
;
} else {
array = cm.Pick(Camera.current.transform.position);
Vector3 pos = cm.GetWorldPosition(array[0], array[1]);
Vector3i abs = new Vector3i((int)(array[0].x*cm.chunkSize.x+array[1].x),(int)array[0].y,(int)(array[0].z*cm.chunkSize.z+array[1].z));
str =
"World: "+pos.ToString()+"\n"+
"Chunk: "+array[0].ToString()+"\n"+
"ChkBlk: "+array[1].ToString()+"\n"+
"AbsBlk: "+abs.ToString()+"\n"
;
}
UI.guiText.transform.position = Camera.main.ScreenToViewportPoint(Input.mousePosition);
UI.guiText.text = str;
}