|
@@ -1,4 +1,5 @@
|
|
|
-using System.Collections;
|
|
|
+using System;
|
|
|
+using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using _Packages.PaperFoldAsset.Paper_Fold.Scripts;
|
|
@@ -57,7 +58,7 @@ public class Paper : MonoBehaviour
|
|
|
public PossibleCombination[] possibleCombinations;
|
|
|
|
|
|
public IEnumerable<Folding> Folding => foldingsParent.Cast<Transform>().Select(x => x.GetComponent<Folding>());
|
|
|
-
|
|
|
+ private Action levelCompleteCallBack;
|
|
|
private void Awake()
|
|
|
{
|
|
|
backFilter = paperBackRenderer.GetComponent<MeshFilter>();
|
|
@@ -74,6 +75,11 @@ public class Paper : MonoBehaviour
|
|
|
.setOnComplete(() => LoadingState.IsLoading = false);
|
|
|
}
|
|
|
|
|
|
+ public void setPaperCallBack(Action levelCompleteCallBackTemp)
|
|
|
+ {
|
|
|
+ levelCompleteCallBack = levelCompleteCallBackTemp;
|
|
|
+ }
|
|
|
+
|
|
|
// Start is called before the first frame update
|
|
|
void Start()
|
|
|
{
|
|
@@ -303,6 +309,7 @@ public class Paper : MonoBehaviour
|
|
|
}
|
|
|
|
|
|
onPaperStateChanged?.Invoke();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void CheckForLevelComplete()
|
|
@@ -384,6 +391,7 @@ public class Paper : MonoBehaviour
|
|
|
}
|
|
|
|
|
|
UIManager.setLevelCompleteDelegate?.Invoke();
|
|
|
+ levelCompleteCallBack?.Invoke();
|
|
|
yield break;
|
|
|
}
|
|
|
|
|
@@ -450,6 +458,11 @@ public class Paper : MonoBehaviour
|
|
|
|
|
|
StartCoroutine(UnfoldingProcedureCoroutine());
|
|
|
}
|
|
|
+
|
|
|
+ private void OnDisable()
|
|
|
+ {
|
|
|
+ levelCompleteCallBack = null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
[System.Serializable]
|