LTDescr.setRotateAround C# (CSharp) Method

setRotateAround() public method

public setRotateAround ( ) : LTDescr
return LTDescr
    public LTDescr setRotateAround()
    {
        this.type = TweenAction.ROTATE_AROUND;
        this.initInternal = ()=>{
            this.fromInternal.x = 0f;
            this._optional.origRotation = trans.rotation;
        };
        this.easeInternal = ()=>{
            newVect = easeMethod();
            val = newVect.x;
            Vector3 origPos = trans.localPosition;
            Vector3 rotateAroundPt = (Vector3)trans.TransformPoint( this._optional.point );
            // Debug.Log("this._optional.point:"+this._optional.point);
            trans.RotateAround(rotateAroundPt, this._optional.axis, -this._optional.lastVal);
            Vector3 diff = origPos - trans.localPosition;

            trans.localPosition = origPos - diff; // Subtract the amount the object has been shifted over by the rotate, to get it back to it's orginal position
            trans.rotation = this._optional.origRotation;

            rotateAroundPt = (Vector3)trans.TransformPoint( this._optional.point );
            trans.RotateAround(rotateAroundPt, this._optional.axis, val);

            this._optional.lastVal = val;
        };
        return this;
    }
LTDescr