当前位置: 首页>>代码示例>>C#>>正文


C# Vector3i.ToString方法代码示例

本文整理汇总了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()];
	}
开发者ID:carriercomm,项目名称:cubed,代码行数:3,代码来源:CubedObjectBehaviour.cs

示例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);
            }
        }
开发者ID:Ketchu13,项目名称:7dtd_Commands_Extended,代码行数:58,代码来源:RemoveLandProtection.cs

示例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;
	}
开发者ID:carriercomm,项目名称:cubed,代码行数:14,代码来源:CubedObjectBehaviour.cs

示例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;
        }
开发者ID:eglo,项目名称:HCRMod,代码行数:37,代码来源:TestFunctions.cs


注:本文中的Vector3i.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。