本文整理汇总了C#中Single类的典型用法代码示例。如果您正苦于以下问题:C# Single类的具体用法?C# Single怎么用?C# Single使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Single类属于命名空间,在下文中一共展示了Single类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: EasyLCD
public EasyLCD(EasyBlocks block, double scale = 1.0)
{
this.block = block.GetBlock(0);
if(this.block.Type() == "Wide LCD panel") this.wPanel = 72;
this.screen = (IMyTextPanel)(block.GetBlock(0).Block);
this.fontSize = block.GetProperty<Single>("FontSize");
this.width = (int)((double)this.wPanel / this.fontSize);
this.height = (int)((double)this.hPanel / this.fontSize);
this.buffer = new char[this.width * this.height];
this.clear();
this.update();
}
开发者ID:jkeywo,项目名称:EasyAPI,代码行数:14,代码来源:EasyLCD.cs
示例2: WithRefsWithReturn
public object WithRefsWithReturn(
ref string param1,
ref int param2,
ref short param3,
ref long param4,
ref uint param5,
ref ushort param6,
ref ulong param7,
ref bool param8,
ref double param9,
ref decimal param10,
ref int? param11,
ref object param12,
ref char param13,
ref DateTime param14,
ref Single param15,
ref IntPtr param16,
ref UInt16 param17,
ref UInt32 param18,
ref UInt64 param19,
ref UIntPtr param20
)
{
throw new Exception("Foo");
}
开发者ID:vlaci,项目名称:Anotar,代码行数:25,代码来源:OnException.cs
示例3: Vector4
public Vector4(Single x, Single y, Single z, Single w)
{
W = w;
X = x;
Y = y;
Z = z;
}
开发者ID:uQr,项目名称:referencesource,代码行数:7,代码来源:Vector4_Intrinsics.cs
示例4: ToSingle
public static Single ToSingle(string valueToParse, Single defaultValue)
{
Single returnValue;
if (!Single.TryParse(valueToParse, out returnValue))
returnValue = defaultValue;
return returnValue;
}
开发者ID:benjaminaaron,项目名称:SumoVizUnity_ModSem,代码行数:7,代码来源:TryParseWithDefault.cs
示例5: Trigger
public Trigger()
{
Periodical periodical = new Periodical();
this.periodical = periodical;
Single single = new Single();
this.single = single;
}
开发者ID:jpush,项目名称:jpush-api-csharp-client,代码行数:7,代码来源:Trigger.cs
示例6: Initialize
public override void Initialize(Single Mass)
{
base.Initialize(Mass);
Ram = transform.GetChild(0).gameObject;
Ram.rigidbody.mass = Mass;
Ram.GetComponent<FixedJoint>().connectedBody = ConnectedBody;
UpdateValues();
}
开发者ID:EranYaacobi,项目名称:Centipede,代码行数:9,代码来源:RamEnd.cs
示例7: Update
// Update is called once per frame
void Update()
{
if (GameObject.Find("Player").GetComponent<Player>().GameOver)
return;
GameTime += Time.deltaTime;
Single Score = ((Single)Math.Round (GameTime, 0)) * 1000;
GameObject.Find ("TimerHudText").GetComponent<Text> ().text = Score.ToString();
}
开发者ID:dneuschaefer-rube,项目名称:rg_hackathon_2015_string,代码行数:10,代码来源:Global.cs
示例8: Write
public static void Write(this BinaryWriter writer, Single value, bool invertEndian = false)
{
if (invertEndian)
{
writer.WriteInvertedBytes(BitConverter.GetBytes(value));
}
else
{
writer.Write(value);
}
}
开发者ID:r2d2rigo,项目名称:BinaryEndiannessExtensions,代码行数:11,代码来源:BinaryWriterExtensions.cs
示例9: TestCtor
public static void TestCtor()
{
Single i = new Single();
Assert.True(i == 0);
i = 41;
Assert.True(i == 41);
i = (Single)41.3;
Assert.True(i == (Single)41.3);
}
开发者ID:johnhhm,项目名称:corefx,代码行数:11,代码来源:Single.cs
示例10: DrawText
public void DrawText(String str, Font font, Single offsetX, Single offsetY, TextAnchor anchor)
{
if (str == null) return;
var guiText = GetText();
guiText.text = str;
guiText.anchor = anchor;
guiText.alignment = TextAlignment.Center;
guiText.font = font;
guiText.pixelOffset = new Vector2(offsetX - Screen.width * 0.5f, Screen.height * 0.5f - offsetY);
}
开发者ID:AlexisHenriquezB,项目名称:SpaceMooney,代码行数:11,代码来源:SimpleHUD.cs
示例11: DrawBar
public void DrawBar(Texture2D border, Texture2D fill, Single x, Single y, Single w, Single h, Single p)
{
Rect bgRect = new Rect(x, y, w, h);
Rect barRect = new Rect(x + 1, y + 1, (w - 2) * p, h - 2);
var col = new Color(0.5f, 0.5f, 0.5f, 0.5f);
if (border != null) DrawTexture(border, bgRect, col);
DrawTexture(fill, barRect, col);
}
开发者ID:AlexisHenriquezB,项目名称:SpaceMooney,代码行数:11,代码来源:SimpleHUD.cs
示例12: DiscreteTransform
/// <summary>
/// Discrete Fourier transform. Input array of arbitrary size.
/// </summary>
/// <param name="input">Input array to be transformed.</param>
/// <returns>Output Fourier transformed array.</returns>
public static Single[] DiscreteTransform(Single[] input)
{
Single[] result = new Single[input.Length];
if (input.Length > 0)
{
for (int i = 0; i < input.Length; i++)
for (int j = 0; j < input.Length; j++)
result[i] += input[j] * Single.RootOfUnity(input.Length, -i * j);
}
return result;
}
开发者ID:imintsystems,项目名称:Kean,代码行数:16,代码来源:Single.cs
示例13: CopyTo
/// <summary>
/// Copies the contents of the vector into the given array, starting from the given index.
/// </summary>
/// <exception cref="ArgumentNullException">If array is null.</exception>
/// <exception cref="RankException">If array is multidimensional.</exception>
/// <exception cref="ArgumentOutOfRangeException">If index is greater than end of the array or index is less than zero.</exception>
/// <exception cref="ArgumentException">If number of elements in source vector is greater than those available in destination array
/// or if there are not enough elements to copy.</exception>
public void CopyTo(Single[] array, int index)
{
if (array == null)
throw new ArgumentNullException("values");
if (index < 0 || index >= array.Length)
throw new ArgumentOutOfRangeException(SR.Format(SR.Arg_ArgumentOutOfRangeException, index));
if ((array.Length - index) < 2)
throw new ArgumentException(SR.Format(SR.Arg_ElementsInSourceIsGreaterThanDestination, index));
array[index] = X;
array[index + 1] = Y;
}
开发者ID:jsalvadorp,项目名称:corefx,代码行数:19,代码来源:Vector2_Intrinsics.cs
示例14: Initialize
public void Initialize(Rigidbody ConnectedBody, Vector3 Anchor, Vector3 RemoteAnchor, Int32 LinksCount, Single DesiredLengthRate, Single SpringForce, Single DampingRate, Single RopeTotalMass)
{
this.ConnectedBody = ConnectedBody;
this.Anchor = Anchor;
this.RemoteAnchor = RemoteAnchor;
this.LinksCount = LinksCount;
this.SpringForce = SpringForce;
this.DampingRate = DampingRate;
this.RopeTotalMass = RopeTotalMass;
this.DesiredLengthRate = DesiredLengthRate;
InitializeJoints();
}
开发者ID:EranYaacobi,项目名称:Centipede,代码行数:13,代码来源:RopeJoint.cs
示例15: ChangeBoardSize
public void ChangeBoardSize(Single s)
{
int newsize = Constants.BOARDSIZE + (int)s * 2;
Debug.Log(newsize);
mainBoard = new Board(newsize);
Player1 = new Player(Constants.BLACKCOLOR, ref mainBoard, tglBlackAI.GetComponent<Toggle>().isOn);
Player2 = new Player(Constants.WHITECOLOR, ref mainBoard, tglWhiteAI.GetComponent<Toggle>().isOn);
txtBoardSize.GetComponent<Text>().text = "Board Size: " + newsize + " x " + newsize;
CreateBoard();
}
开发者ID:stuartsoft,项目名称:TinyGo,代码行数:13,代码来源:BoardPrefab.cs
示例16: Update
public void Update()
{
if (active)
{
active = false;
var geometry = new Quad(origin, left, up, size, color);
var stream = new Single(geometry);
var factory = new MeshFactory(stream);
var filter = GetComponent<MeshFilter>();
filter.mesh = new Mesh();
factory.Bind(filter.mesh);
}
}
开发者ID:shadowmint,项目名称:unity-n-procedural,代码行数:13,代码来源:QuadTestComponent.cs
示例17: Vector2CopyToTest
public void Vector2CopyToTest()
{
Vector2 v1 = new Vector2(2.0f, 3.0f);
Vector2 v2 = new Vector2(4.5f, 6.5f);
Single[] a = new Single[3];
Single[] b = new Single[2];
v1.CopyTo(a, 1);
v1.CopyTo(b);
Assert.Equal(0.0, a[0]);
Assert.Equal(2.0, a[1]);
Assert.Equal(3.0, a[2]);
Assert.Equal(2.0, b[0]);
Assert.Equal(3.0, b[1]);
}
开发者ID:svcgany1,项目名称:corefx,代码行数:15,代码来源:Vector2Tests.cs
示例18: WorkOnInstanceAndLocal_1
private void WorkOnInstanceAndLocal_1()
{
Single localDouble; int i, j;
for ( i = 0; i < 100; i++ )
{
int index = randomNumGen.Next(0, ValueArraySize);
instanceInt_1 = ValueArray[index];
Thread.Sleep(index);
localDouble = instanceInt_1;
for ( j = 0; j < ValueArraySize; j++ )
if ( ValueArray[j].CompareTo(localDouble) == 0 )
break;
if (j == ValueArraySize )
throw new Exception("WorkOnInstanceAndLocal: Atomicity of Read/Write violated - " + localDouble);
}
}
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:16,代码来源:co8830single.cs
示例19: addNewCType
public CleaningType addNewCType(string title, string desc, Single val)
{
CleaningType c = new CleaningType();
if (title != "" && title != null && desc != "" && desc != null && val > 0)
{
c.name = title;
c.cTypeValue = val;
c.description = desc;
db.CleaningTypes.AddObject(c);
db.SaveChanges();
return c;
}
else
return c;
}
开发者ID:radneyalquiza,项目名称:homecleaningteam,代码行数:16,代码来源:SecondaryEntitiesManager.cs
示例20: Vector3CopyToTest
public void Vector3CopyToTest()
{
Vector3 v1 = new Vector3(2.0f, 3.0f, 3.3f);
Single[] a = new Single[4];
Single[] b = new Single[3];
v1.CopyTo(a, 1);
v1.CopyTo(b);
Assert.Equal(0.0f, a[0]);
Assert.Equal(2.0f, a[1]);
Assert.Equal(3.0f, a[2]);
Assert.Equal(3.3f, a[3]);
Assert.Equal(2.0f, b[0]);
Assert.Equal(3.0f, b[1]);
Assert.Equal(3.3f, b[2]);
}
开发者ID:svcgany1,项目名称:corefx,代码行数:16,代码来源:Vector3Tests.cs
注:本文中的Single类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论