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


C# Ray.ToString方法代码示例

本文整理汇总了C#中Ray.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Ray.ToString方法的具体用法?C# Ray.ToString怎么用?C# Ray.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ray的用法示例。


在下文中一共展示了Ray.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

    // Update is called once per frame
    void Update()
    {
        if( Input.GetMouseButtonDown(0) )
            {
                ray = Camera.main.ScreenPointToRay( Input.mousePosition );

                Debug.Log ( ray.ToString() );

                if (!Physics.Raycast( ray, out hit))
                {
                    return;
                }
            }
        velocity = hit.point - this.transform.position;
        distance = velocity.magnitude;
        rotation.SetLookRotation(velocity);
        //velocity = transform.TransformDirection(velocity);
        //velocity *= speed;

        if ( distance > 10 )
        {
            _controller.transform.rotation = Quaternion.Slerp(this.transform.rotation, rotation, rot_speed * Time.deltaTime);
            transform.Translate(Vector3.forward * speed * Time.deltaTime);
            //_controller.Move( velocity.normalized * speed * Time.deltaTime);
        }
    }
开发者ID:umbarger,项目名称:AI_Extra,代码行数:27,代码来源:KinFollow.cs

示例2: Update

		void Update ()
		{
				if (Input.GetKey (KeyCode.Mouse0)) {
						//-----------debug------------------------------------------------------------------------------
						Origin_start = Shoot.transmitOrigin;
						Origin.text = Origin_start.ToString ();
						//print (Shoot.transmitDistance);
						//print (" x=" + Shoot.transmitRayX);
						//print (Shoot.transmitRayY);
						//print (Shoot.transmitRayZ);
						//------------Bullet GUI -----------------------------------------------------------------------
						range_hit = Shoot.transmitDistance;
						Range.text = range_hit.ToString ();


						//Bullet_X = Shoot.transmitRayX;
						//info_X.text = Bullet_X.ToString ();

						//Bullet_X = Shoot.valTourelleX;
						//info_X.text = Bullet_X.ToString ();

						Shoot.valTourelleX = float.Parse (info_X.text);
						Shoot.valTourelleY = float.Parse (info_Y.text);

						//Bullet_Y = Shoot.transmitRayY;
						//info_Y.text = Bullet_Y.ToString ();



						Bullet_X = Shoot.transmitRayX;
						Bullet_Y = Shoot.transmitRayY;
						info_Z.text = "Y:"  + Bullet_Y.ToString () + " X:"  + Bullet_X.ToString () ;
				}
	
		}
开发者ID:loursbrun,项目名称:sniperspiritV3,代码行数:35,代码来源:InfoBullet.cs

示例3: CanConvertToStringAndBack

		public void CanConvertToStringAndBack()
		{
			var ray = new Ray(Vector3D.UnitX, Vector3D.UnitY);
			var stringRay = ray.ToString();
			Assert.AreEqual("Ray({1, 0, 0},{0, 1, 0})", stringRay);
			var retrievedRay = new Ray(stringRay);
			Assert.AreEqual(ray.Origin, retrievedRay.Origin);
			Assert.AreEqual(ray.Direction, retrievedRay.Direction);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:9,代码来源:RayTests.cs


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