LTDescr.setCanvasRotateAround C# (CSharp) Method

setCanvasRotateAround() public method

public setCanvasRotateAround ( ) : LTDescr
return LTDescr
    public LTDescr setCanvasRotateAround()
    {
        this.type = TweenAction.CANVAS_ROTATEAROUND;
        this.initInternal = this.initCanvasRotateAround;
        this.easeInternal = ()=>{
            newVect = easeMethod();
            val = newVect.x;
            RectTransform rect = this.rectTransform;
            Vector3 origPos = rect.localPosition;
            rect.RotateAround((Vector3)rect.TransformPoint( this._optional.point ), this._optional.axis, -val);
            Vector3 diff = origPos - rect.localPosition;

            rect.localPosition = origPos - diff; // Subtract the amount the object has been shifted over by the rotate, to get it back to it's orginal position
            rect.rotation = this._optional.origRotation;
            rect.RotateAround((Vector3)rect.TransformPoint( this._optional.point ), this._optional.axis, val);
        };
        return this;
    }
LTDescr