Skip to content

Commit 1aeffff

Browse files
committed
feat: Add fading option
1 parent c8c0d60 commit 1aeffff

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Assets/JCSUnity/Scripts/Effects/Tweener/JCS_TransformTweener.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ private void ContinueTween()
736736
}
737737

738738
float distance = 0;
739+
739740
Vector3 selfVal = GetSelfTransformTypeVector3();
740741
Vector3 targetVal = GetTargetTransformTypeVector3();
741742

@@ -752,9 +753,9 @@ private void ContinueTween()
752753
// record down the target position
753754
mRecordTargetTransformValue = targetVal;
754755

755-
756756
// Check if close enough to the distance we target.
757757
distance = Vector3.Distance(selfVal, targetVal);
758+
758759
if (distance <= mStopTweenDistance)
759760
{
760761
// call the call back.

Assets/JCSUnity/Scripts/UI/JCS_Canvas.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,14 @@ public void ToggleVisibility(bool mute = false)
385385
Show(mute);
386386
}
387387

388+
/// <summary>
389+
/// Return true if the canvas is fading in/out.
390+
/// </summary>
391+
public bool IsFading()
392+
{
393+
return mFading != JCS_FadeType.NONE;
394+
}
395+
388396
/// <summary>
389397
/// Prompt warning if there are multiple main canvases in the scene.
390398
/// </summary>

Assets/JCSUnity/Scripts/UI/JCS_CanvasComp.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,6 @@ protected virtual void Awake()
6969
public virtual void Show(bool mute = false) => mCanvas.Show(mute);
7070
public virtual void Hide(bool mute = false) => mCanvas.Hide(mute);
7171
public virtual void ToggleVisibility(bool mute = false) => mCanvas.ToggleVisibility(mute);
72+
public virtual bool IsFading() => mCanvas.IsFading();
7273
}
7374
}

0 commit comments

Comments
 (0)