Hi, i just updated the new Unity UI and encountered an annoying problem here.
I have been trying to modify the RectTransform in order to create a flying in effect of menu but having difficulty on setting the position x through custom action, the x value is always larger than the value i set ...
The code below actually successfully modified the y and z value, just not working on the x value...
public FsmFloat rectTransFormPosX;
public bool everyFrame;
private RectTransform _rectTransform;
public override void Reset()
{
rectTransFormPosX = null;
everyFrame = false;
}
public override void OnEnter()
{
GameObject _go = Fsm.GetOwnerDefaultTarget(gameObject);
if (_go!=null)
{
_rectTransform = _go.GetComponent<RectTransform>();
}
DoSetRectTransformValue();
if (!everyFrame)
Finish();
}
void DoSetRectTransformValue()
{
if (_rectTransform!=null)
{
_rectTransform.localPosition = new Vector3(rectTransFormPosX.Value, 4f, 0f);
}
}
or anyone already done this? Tried searching on ecosystem but in vain