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


C# Single类代码示例

本文整理汇总了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();
    }
开发者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


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