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


C# NPC.getBubbleBorderColor方法代码示例

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


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

示例1: generateBubble

    public BubbleData generateBubble(NPC cha, string text, GameObject talker = null)
    {
        BubbleData bubble = new BubbleData (text, new Vector2 (40, 60), new Vector2 (40, 45));

        Color textColor, textOutline, background, border;
        ColorUtility.TryParseHtmlString (cha.getTextFrontColor (), out textColor);
        ColorUtility.TryParseHtmlString (cha.getTextBorderColor (), out textOutline);
        ColorUtility.TryParseHtmlString (cha.getBubbleBkgColor (), out background);
        ColorUtility.TryParseHtmlString (cha.getBubbleBorderColor (), out border);

        bubble.TextColor = textColor;
        bubble.TextOutlineColor = textOutline;
        bubble.BaseColor = background;
        bubble.OutlineColor = border;

        if (talker != null) {
            Vector2 position = talker.transform.localPosition;
            position.y += talker.transform.localScale.y / 2;

            bubble.Destiny = position;
            bubble.Origin = new Vector2 (position.x, position.y - 10f);
        } else {
            bubble.Origin = new Vector2 (40, 60);
            bubble.Destiny = new Vector2 (40, 45);
        }

        return bubble;
    }
开发者ID:Synpheros,项目名称:eAdventure4Unity,代码行数:28,代码来源:GUIManager.cs

示例2: generateFor

    public static Texture2D generateFor(NPC npc)
    {
        Texture2D ret;
        if (npc.getShowsSpeechBubbles ()) {
            ret = new Texture2D (32, 32);
            Color background = Color.white;
            Color border = Color.black;

            ColorUtility.TryParseHtmlString (npc.getBubbleBkgColor (), out background);
            ColorUtility.TryParseHtmlString (npc.getBubbleBorderColor (), out background);

            BorderGenerator.Circle (ret, 16, 16, 15, border);
        } else {
            if (transparent == null) {
                transparent = Resources.Load ("1x1") as Texture2D;
            }
            ret = transparent;
        }

        return ret;
    }
开发者ID:Synpheros,项目名称:eAdventure4Unity,代码行数:21,代码来源:BorderGenerator.cs


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