本文整理汇总了C#中Single类的典型用法代码示例。如果您正苦于以下问题:C# Single类的具体用法?C# Single怎么用?C# Single使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Single类属于命名空间,在下文中一共展示了Single类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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");
}
示例3: Vector4
public Vector4(Single x, Single y, Single z, Single w)
{
W = w;
X = x;
Y = y;
Z = z;
}
示例4: ToSingle
public static Single ToSingle(string valueToParse, Single defaultValue)
{
Single returnValue;
if (!Single.TryParse(valueToParse, out returnValue))
returnValue = defaultValue;
return returnValue;
}
示例5: Trigger
public Trigger()
{
Periodical periodical = new Periodical();
this.periodical = periodical;
Single single = new Single();
this.single = single;
}
示例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();
}
示例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();
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}