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


C# Note.GetId方法代码示例

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


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

示例1: Awake

    void Awake()
    {
        this.arialFont = (Font)Resources.GetBuiltinResource (typeof(Font), "Arial.ttf");

        //load the JSON
        var dict = JSON.Parse(notesJsonAsset.text);
        JSONArray notesJson = dict["notes"].AsArray;

        // the notepad
        gameObject.SetActive(false);

        //make the note deatil GO
        this.noteDetailGO = new GameObject("noteDetailGO");
        this.noteDetailGO.transform.SetParent(gameObject.transform, false);
        this.noteDetailGO.SetActive(false);

        RectTransform ndrect = noteDetailGO.AddComponent<RectTransform>();
        RectTransformExtensions.SetSize(ndrect,new Vector2(730,330));

        GameObject btnBack = UIExtensions.MakeTextColorButton(
            "buttonback",
            new Vector2(160,30),
            new Vector2(210, 200),
            "Go Back",
            arialFont, 18, Color.white,
            Color.gray,
            TextAnchor.MiddleCenter,
            BackCallback);

        btnBack.transform.SetParent(this.noteDetailGO.transform, false);

        // note text
        this.noteDetailText = this.noteDetailGO.AddComponent<Text>();
        this.noteDetailText.font = arialFont;
        this.noteDetailText.color = Color.white;
        this.noteDetailText.fontSize = 18;
        this.noteDetailText.horizontalOverflow = HorizontalWrapMode.Wrap;

        //make the notes list GO
        this.notesListGO = new GameObject("notesListGO");
        this.notesListGO.transform.SetParent(gameObject.transform, false);

        foreach (JSONNode noteNode in notesJson) {
            Debug.Log(noteNode.ToString());
            Note n = new Note(
                (string)noteNode["id"],
                (string)noteNode["title"],
                (string)noteNode["text"]);
            notes.Add(n);

            int ox = -376;
            int oy = 210;
            GameObject btnNote = UIExtensions.MakeTextOnlyButton(
                n.GetId(),
                new Vector2(730,30),
                new Vector2((float)ox,-(float)(notes.Count*30)+oy),
                n.GetTitle(),
                arialFont, 18, Color.white, TextAnchor.MiddleLeft,
                ButtonEvent);
            btnNote.transform.SetParent(this.notesListGO.transform, false);

        }
    }
开发者ID:claytantor,项目名称:shadow-haven-unity,代码行数:63,代码来源:NotepadController.cs


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