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


C# Vector4.ToString方法代码示例

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


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

示例1: Vector4ToStringTest

        public void Vector4ToStringTest()
        {
            string separator = CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator;
            CultureInfo enUsCultureInfo = new CultureInfo("en-US");

            Vector4 v1 = new Vector4(2.5f, 2.0f, 3.0f, 3.3f);

            string v1str = v1.ToString();
            string expectedv1 = string.Format(CultureInfo.CurrentCulture
                , "<{1:G}{0} {2:G}{0} {3:G}{0} {4:G}>"
                , separator, 2.5, 2, 3, 3.3);
            Assert.Equal(expectedv1, v1str);

            string v1strformatted = v1.ToString("c", CultureInfo.CurrentCulture);
            string expectedv1formatted = string.Format(CultureInfo.CurrentCulture
                , "<{1:c}{0} {2:c}{0} {3:c}{0} {4:c}>"
                , separator, 2.5, 2, 3, 3.3);
            Assert.Equal(expectedv1formatted, v1strformatted);

            string v2strformatted = v1.ToString("c", enUsCultureInfo);
            string expectedv2formatted = string.Format(enUsCultureInfo
                , "<{1:c}{0} {2:c}{0} {3:c}{0} {4:c}>"
                , enUsCultureInfo.NumberFormat.NumberGroupSeparator, 2.5, 2, 3, 3.3);
            Assert.Equal(expectedv2formatted, v2strformatted);

            string v3strformatted = v1.ToString("c");
            string expectedv3formatted = string.Format(CultureInfo.CurrentCulture
                , "<{1:c}{0} {2:c}{0} {3:c}{0} {4:c}>"
                , separator, 2.5, 2, 3, 3.3);
            Assert.Equal(expectedv3formatted, v3strformatted);
        }
开发者ID:Rayislandstyle,项目名称:corefx,代码行数:31,代码来源:Vector4Tests.cs

示例2: Vector4_ToStringTest

 public void Vector4_ToStringTest()
 {
     Vector4 v = new Vector4(1.0f, 2.2f, 3.33f, 4.444f);
     Assert.AreEqual("Vector4(1, 2.2, 3.33, 4.444)", v.ToString());
 }
开发者ID:HaKDMoDz,项目名称:Irelia,代码行数:5,代码来源:Vector4Test.cs

示例3: ToStringTest

        public void ToStringTest()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-IE");
            Assert.AreEqual("{X:-124 Y:352.234 Z:123.123 W:-108.3253}", c.ToString(), "#1");

            System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("de-DE");
            Assert.AreEqual("{X:-124 Y:352,234 Z:123,123 W:-108,3253}", c.ToString(), "#2");

            Vector4 v = new Vector4(1324.2353252353223f, 1324.2353252353223f, 1324.2353252353223f, -108.325345f);
            Assert.AreEqual("{X:1324,235 Y:1324,235 Z:1324,235 W:-108,3253}", v.ToString(), "#3");
        }
开发者ID:sergios1234,项目名称:monoxna,代码行数:11,代码来源:Vector4Tests.cs

示例4: SetVector4

 /**
  *  This will save the datatype value inside the register, with a string
  *  key to identify and retrieve it. This will override any previous key
  */
 public static void SetVector4 (string key, Vector4 value)
 {
     SetString(key, value.ToString());
 }
开发者ID:DeeQuation,项目名称:Unity-Playerpreferences,代码行数:8,代码来源:PlayerPrefs.cs

示例5: should_print_vector_to_string

        public void should_print_vector_to_string()
        {
            Vector4 v = new Vector4(1, 2, 3, 4);

             Assert.That(v.ToString(), Iz.EqualTo("1.000000 2.000000 3.000000 4.000000"));
        }
开发者ID:CapnK,项目名称:Duffer,代码行数:6,代码来源:BasicTypesTests.cs

示例6: ToString

        public new void ToString()
        {
            var vector = new Vector4(1.1f, 2.2f, 3.3f, 4.4f);

            Assert.AreEqual("X: 1.1 Y: 2.2 Z: 3.3 W: 4.4", vector.ToString());
        }
开发者ID:Christof,项目名称:afterglow,代码行数:6,代码来源:Test_Vector4.cs

示例7: Add

	public static WWWForm Add(this WWWForm form, string key, Vector4 value)
	{
		form.AddField(key, value.ToString());
		return form;
	}
开发者ID:uptopgames,项目名称:baseproject,代码行数:5,代码来源:ExtensionWWWForm.cs

示例8: UpdatePlayerFourDPosition

 /**
  * The FirstPersonController knows in which direction the player goes in 3D.
  * The GameEngine knows which 3D space is actually displayed.
  *
  * This method updates the 4D position of the player, depending on which 3D space he's in.
  * */
 public void UpdatePlayerFourDPosition(float right, float up, float forward)
 {
     Vector4 deltaCoordinates = new Vector4 (right, up, forward, 0);
     Matrix4x4 transformMatrix = new Matrix4x4 ();
     transformMatrix.SetColumn (0, fourDLevelRight);
     transformMatrix.SetColumn (1, fourDLevelUp);
     transformMatrix.SetColumn (2, fourDLevelForward);
     transformMatrix.SetColumn (3, Vector4.zero);
     fourDPlayerPosition += transformMatrix * deltaCoordinates;
     Debug.Log ("New 4D Coordinates = " + fourDPlayerPosition.ToString ());
 }
开发者ID:RemiFusade2,项目名称:FourDWorld_Proto,代码行数:17,代码来源:GameEngine.cs


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