Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (_ori_LineType != LineType)
        {
            this.ShowLines();
            this.SetLinesPos();
            _ori_LineType = LineType;
        }
        if (_ori_LineWidth != LineWidth)
        {
            this.SetLinesPos();
            _ori_LineWidth = LineWidth;
        }
        if (_ori_Size != this._rect.sizeDelta)
        {
            this.SetLinesPos();
            _ori_Size = this._rect.sizeDelta;
        }
        if (_ori_LineColor != LineColor)
        {
            this.SetLinesColor();
            _ori_LineColor = LineColor;
        }

        this._rect.localScale    = new Vector3(FlipX ? -1 : 1, FlipY ? -1 : 1, 0);
        this._rect.localRotation = Quaternion.Euler(0, 0, Rotation);
    }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        this._rect = this.GetComponent <RectTransform>();
        _lineRects = new RectTransform[3];
        for (int i = 0; i < this.transform.childCount; i++)
        {
            _lineRects[i] = this.transform.GetChild(i).GetComponent <RectTransform>();
        }

        _ori_LineType  = LineType;
        _ori_LineWidth = LineWidth;
        _ori_LineColor = LineColor;
        _ori_Size      = this._rect.sizeDelta;
    }