Skip to content

Commit 3512b53

Browse files
committed
Merge branch 'beta-bugs' of github.com:Autodesk/synthesis into beta-bugs
2 parents 1e70187 + 0403045 commit 3512b53

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

engine/Assets/Scripts/ModuleLoader/Api.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ public class Api : MonoBehaviour {
4343

4444
public void Start() // Must happen after ResourceLedger is initialized (in Awake)
4545
{
46-
if (Instance == null)
46+
if (Instance == null) {
4747
Instance = this;
48+
} else {
49+
Destroy(gameObject);
50+
return;
51+
}
4852

4953
SetupApplication(); // Always do this first
5054

@@ -103,6 +107,10 @@ private void SetupApplication() {
103107
// PanelScaler.ScaleMode.ConstantPhysicalSize;
104108
}
105109

110+
private void OnDestroy() {
111+
Instance = null;
112+
}
113+
106114
private class LoggerImpl : SynthesisAPI.Utilities.ILogger {
107115
private bool debugLogsEnabled = true;
108116
private bool _isEnabled = true;

engine/Assets/Scripts/UI/MainMenu/LinksTween.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ public class LinksTween : MonoBehaviour, IPointerEnterHandler, IPointerExitHandl
2121
public void OnPointerEnter(PointerEventData eventData) {
2222
text = gameObject.GetComponent<TMP_Text>();
2323
sizeStart = text.fontSize;
24-
SynthesisTween.MakeTween(_growKey, text.fontSize, sizeEnd, 1f,
25-
(t, a, b) => SynthesisTweenInterpolationFunctions.FloatInterp(t, (float) a, (float) b),
26-
SynthesisTweenScaleFunctions.EaseOutCubic, TweenUp);
24+
if (!SynthesisTween.TweenExists(_growKey))
25+
SynthesisTween.MakeTween(_growKey, text.fontSize, sizeEnd, 1f,
26+
(t, a, b) => SynthesisTweenInterpolationFunctions.FloatInterp(t, (float) a, (float) b),
27+
SynthesisTweenScaleFunctions.EaseOutCubic, TweenUp);
2728
}
2829

2930
public void OnPointerExit(PointerEventData eventData) {

engine/Assets/Scripts/Utilities/Tween/SynthesisTween.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ public SynthesisTweenStatus(object val, float prog) {
6969
CurrentProgress = prog;
7070
}
7171
}
72+
73+
public static Boolean TweenExists(string key) {
74+
return _tweens.ContainsKey(key);
75+
}
7276
}
7377

7478
public static class SynthesisTweenScaleFunctions {

0 commit comments

Comments
 (0)