コード例 #1
0
ファイル: DaigramWindow.cs プロジェクト: rehafj/Moral
    public void CreateSingleBox(float x, float y, Dialoug node, string text, boxTypes type)
    {
        GameObject temp;

        if (type == boxTypes.playerNormal)
        {
            temp = Instantiate(PlayerReesponceBox, new Vector2(xPosition, yPostion), Quaternion.identity);
        }
        else if (type == boxTypes.PlayerFM)
        {
            temp = Instantiate(PlayerFMResponceBox, new Vector2(xPosition, yPostion), Quaternion.identity);
        }
        else if (type == boxTypes.CNPCFM)
        {
            temp = Instantiate(CNPCfmBox, new Vector2(xPosition, yPostion), Quaternion.identity);
        }
        else
        {
            temp = Instantiate(CNPCUIResponceBoxPrefab, new Vector2(xPosition, yPostion), Quaternion.identity);
        }

        temp.gameObject.transform.SetParent(parentContent.transform, false);
        temp.gameObject.GetComponentInChildren <Text>().text  = text;
        temp.gameObject.GetComponentInChildren <Text>().color = Color.black;


        yPostion += -130;
    }
コード例 #2
0
        public resizeSelectBox(Object containerItem, boxTypes boxType)
        {
            if (containerItem is placeableItem)
                _container = (placeableItem)containerItem;
            else
                if (containerItem is Rectangle)
                    _rectangle = (Rectangle)containerItem;

            _boxType = boxType;
            resizeBoxPen = new Pen(resizeBoxColor, 3.0f);
            resizeBoxBrush = new SolidBrush(resizeBoxColor);
        }
コード例 #3
0
ファイル: DaigramWindow.cs プロジェクト: rehafj/Moral
    public void CreateMultipleBoxes(List <Dialoug> nodes, string text, string Selectedpattern, boxTypes type)
    {
        //currentPosition.transform.position = new Vector2 (currentPosition.rect.x,  currentPosition.rect.y - 180);currentPosition.rect.position
        foreach (Dialoug d in nodes)
        {
            GameObject temp;
            if (type == boxTypes.playerNormal)
            {
                temp = Instantiate(PlayerReesponceBox, new Vector2(xPosition, yPostion), Quaternion.identity);
            }
            else if (type == boxTypes.PlayerFM)
            {
                temp = Instantiate(PlayerFMResponceBox, new Vector2(xPosition, yPostion), Quaternion.identity);
            }
            else if (type == boxTypes.CNPCFM)
            {
                temp = Instantiate(CNPCfmBox, new Vector2(xPosition, yPostion), Quaternion.identity);
            }
            else
            {
                temp = Instantiate(CNPCUIResponceBoxPrefab, new Vector2(xPosition, yPostion), Quaternion.identity);
            }


            temp.gameObject.transform.SetParent(parentContent.transform, false);
            temp.gameObject.GetComponentInChildren <Text>().text   = d.mainOpinionOnAtopic;
            temp.gameObject.GetComponentInChildren <Text>().color  = Color.grey;
            temp.gameObject.GetComponentInChildren <Image>().color = Color.grey;
            xPosition += 240;

            if (d.Pattern == Selectedpattern)
            {
                temp.gameObject.GetComponentInChildren <Text>().color  = Color.black;
                temp.gameObject.GetComponentInChildren <Image>().color = Color.white;
                yPostion -= 130;
            }
        }
    }