protected void ToLeft() { Vector2 targetAnchorPos = RectTrans.anchoredPosition - Vector2.right * offset; RectTrans.DOAnchorPos(targetAnchorPos, UIEffectTime.SLIDE_FROM_Right).SetEase(Ease.Linear).OnComplete(() => { if (OnExitComplete != null) { OnExitComplete(); } }); }
protected void FromLeft() { InitPos(); offset = DefaultScreenWidth + RectTrans.sizeDelta.x; RectTrans.anchoredPosition = DefaultAnchorPos - Vector2.right * offset; RectTrans.DOAnchorPos(DefaultAnchorPos, UIEffectTime.SLIDE_FROM_Right).SetEase(Ease.Linear).OnComplete(() => { if (onEnterComplete != null) { onEnterComplete(); } }); }