private void AddLine(Vector2 startPos, Vector2 endPos)
    {
        ImageLine newObj = Instantiate(ResourcesHandler.Instance.ImageLine).GetComponent <ImageLine>();

        newObj.Initialize(this.transform, startPos, endPos);
        GameUtils.EchoRectTransformAnchor(myRectTransform, newObj.MyRectTransform);
        newObj.gameObject.name = "ImageLine" + lines.Count;
        newObj.SetColor(lineColor);
        newObj.SetThickness(lineThickness);
        lines.Add(newObj);
    }
Exemple #2
0
        private void MakeBorderLine(int side)
        {
            Line      line      = GetBorderLine(side);
            ImageLine imageLine = Instantiate(ResourcesHandler.Instance.imageLine).GetComponent <ImageLine>();

            imageLine.Initialize(this.transform, line.start, line.end);
            imageLine.name = "BorderLine_" + side;
            imageLine.SetThickness(4);
            imageLine.SetColor(new Color(0, 0, 0, 0.75f));
            imageLine.gameObject.layer = this.gameObject.layer;
            i_borders[side]            = imageLine;
        }