Commit 46819e4c authored by saad's avatar saad

add final details

parent f5328474
...@@ -2351,7 +2351,7 @@ CanvasGroup: ...@@ -2351,7 +2351,7 @@ CanvasGroup:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8529946597286006889} m_GameObject: {fileID: 8529946597286006889}
m_Enabled: 1 m_Enabled: 1
m_Alpha: 1 m_Alpha: 0
m_Interactable: 1 m_Interactable: 1
m_BlocksRaycasts: 1 m_BlocksRaycasts: 1
m_IgnoreParentGroups: 0 m_IgnoreParentGroups: 0
......
using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;
public class ScreenFeedback : MonoBehaviour
{
[SerializeField] private Image screen;
[SerializeField] private RawImage screen2;
[SerializeField] Color backgroundColor1;
[SerializeField] Color backgroundColor2;
public void ScreenFlash(bool isCorrect)
{
if (screen == null) return;
if (screen2 == null) return;
Color flashColor = isCorrect ? Color.green : Color.red;
screen.color = flashColor;
screen2.color = flashColor;
screen.DOColor(backgroundColor1, 0.4f)
.SetEase(Ease.OutQuad);
screen2.DOColor(backgroundColor2, 0.4f)
.SetEase(Ease.OutQuad);
}
}
fileFormatVersion: 2
guid: 1857b0b75973e1248857888fa690d294
\ No newline at end of file
This diff is collapsed.
...@@ -44,7 +44,6 @@ MonoBehaviour: ...@@ -44,7 +44,6 @@ MonoBehaviour:
physics2DEnabled: 1 physics2DEnabled: 1
spriteEnabled: 1 spriteEnabled: 1
uiEnabled: 1 uiEnabled: 1
uiToolkitEnabled: 0
textMeshProEnabled: 0 textMeshProEnabled: 0
tk2DEnabled: 0 tk2DEnabled: 0
deAudioEnabled: 0 deAudioEnabled: 0
......
...@@ -149,15 +149,15 @@ MonoBehaviour: ...@@ -149,15 +149,15 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: Assembly-CSharp::com.al_arcade.tf.TfPrefabBuilder m_EditorClassIdentifier: Assembly-CSharp::com.al_arcade.tf.TfPrefabBuilder
environmentPrefab: {fileID: 767925755488989416, guid: 983f1bf4576e3bc4f8f307ad22550827, type: 3} environmentPrefab: {fileID: 767925755488989416, guid: 983f1bf4576e3bc4f8f307ad22550827, type: 3}
cameraPosition: {x: -11, y: 3.5, z: 12} cameraPosition: {x: -18.91, y: 5.55, z: 12}
cameraLookAt: {x: 0, y: 1.5, z: 12} cameraLookAt: {x: 0, y: 1.5, z: 12}
cameraFOV: 70 cameraFOV: 50
cameraBgColor: {r: 1, g: 1, b: 1, a: 1} cameraBgColor: {r: 1, g: 1, b: 1, a: 1}
directionalLightPrefab: {fileID: 0} directionalLightPrefab: {fileID: 0}
extraLightPrefabs: [] extraLightPrefabs: []
ambientColor: {r: 0.29411766, g: 0.30588236, b: 0.37254903, a: 1} ambientColor: {r: 0.29411766, g: 0.30588236, b: 0.37254903, a: 1}
productionLinePrefab: {fileID: 7900226303095226123, guid: 53ddabda3db822246a8119259b379d98, type: 3} productionLinePrefab: {fileID: 7900226303095226123, guid: 53ddabda3db822246a8119259b379d98, type: 3}
productionLinePosition: {x: 0, y: 0, z: 2} productionLinePosition: {x: -2.5, y: 0, z: 2}
questionScreenPrefab: {fileID: 7860356177688906163, guid: a7bc5322cb612b441b312eaecb1fe426, type: 3} questionScreenPrefab: {fileID: 7860356177688906163, guid: a7bc5322cb612b441b312eaecb1fe426, type: 3}
questionScreenPosition: {x: 0, y: 5, z: 12} questionScreenPosition: {x: 0, y: 5, z: 12}
handsPrefab: {fileID: 0} handsPrefab: {fileID: 0}
...@@ -172,7 +172,7 @@ MonoBehaviour: ...@@ -172,7 +172,7 @@ MonoBehaviour:
sfxSlam: {fileID: 0} sfxSlam: {fileID: 0}
correctBurstParticle: {fileID: 0} correctBurstParticle: {fileID: 0}
wrongBurstParticle: {fileID: 0} wrongBurstParticle: {fileID: 0}
confettiParticle: {fileID: 0} confettiParticle: {fileID: 4938095755617958530, guid: f7cbea08757184fa8a51c08635e337d9, type: 3}
sparksParticle: {fileID: 0} sparksParticle: {fileID: 0}
starBurstParticle: {fileID: 0} starBurstParticle: {fileID: 0}
arabicFont: {fileID: 11400000, guid: 8b4edeefed0fc9f60b1084045988b4cb, type: 2} arabicFont: {fileID: 11400000, guid: 8b4edeefed0fc9f60b1084045988b4cb, type: 2}
...@@ -284,7 +284,7 @@ Camera: ...@@ -284,7 +284,7 @@ Camera:
m_Enabled: 1 m_Enabled: 1
serializedVersion: 2 serializedVersion: 2
m_ClearFlags: 2 m_ClearFlags: 2
m_BackGroundColor: {r: 1, g: 1, b: 1, a: 0} m_BackGroundColor: {r: 0.9764706, g: 0.98039216, b: 0.9882353, a: 0}
m_projectionMatrixMode: 1 m_projectionMatrixMode: 1
m_GateFitMode: 2 m_GateFitMode: 2
m_FOVAxisMode: 0 m_FOVAxisMode: 0
......
...@@ -218,7 +218,7 @@ namespace com.al_arcade.tf ...@@ -218,7 +218,7 @@ namespace com.al_arcade.tf
{ if (audio.sfxVictory != null) audio.PlayVictory(); else audio.PlaySuccessJingle(); } { if (audio.sfxVictory != null) audio.PlayVictory(); else audio.PlaySuccessJingle(); }
var particles = SSParticleManager.Instance; var particles = SSParticleManager.Instance;
if (particles != null) particles.PlayScreenConfetti(); if (particles != null) particles.PlayConfetti(new Vector3(-2 , 3 , 12));
if (productionLine != null) yield return productionLine.ProductComplete(); if (productionLine != null) yield return productionLine.ProductComplete();
yield return new WaitForSeconds(0.5f); yield return new WaitForSeconds(0.5f);
......
...@@ -272,7 +272,6 @@ namespace com.al_arcade.tf ...@@ -272,7 +272,6 @@ namespace com.al_arcade.tf
ResetScale(_leftBtn, _leftBtnBaseScale); ResetScale(_leftBtn, _leftBtnBaseScale);
ResetScale(_rightBtn, _rightBtnBaseScale); ResetScale(_rightBtn, _rightBtnBaseScale);
} }
private void OnDestroy() private void OnDestroy()
{ {
KillIdleTweens(); KillIdleTweens();
......
...@@ -42,6 +42,7 @@ namespace com.al_arcade.tf ...@@ -42,6 +42,7 @@ namespace com.al_arcade.tf
{ {
if (product == null || startPoint == null || endPoint == null) if (product == null || startPoint == null || endPoint == null)
yield break; yield break;
if (materialOffsetController != null) if (materialOffsetController != null)
{ {
materialOffsetController.AddOffset( materialOffsetController.AddOffset(
...@@ -49,6 +50,7 @@ namespace com.al_arcade.tf ...@@ -49,6 +50,7 @@ namespace com.al_arcade.tf
0.2f 0.2f
); );
} }
currentDistance = Mathf.Clamp( currentDistance = Mathf.Clamp(
currentDistance + stepDistance, currentDistance + stepDistance,
0, 0,
...@@ -67,8 +69,6 @@ namespace com.al_arcade.tf ...@@ -67,8 +69,6 @@ namespace com.al_arcade.tf
.WaitForCompletion(); .WaitForCompletion();
product.DOPunchScale(Vector3.one * 0.12f, 0.3f); product.DOPunchScale(Vector3.one * 0.12f, 0.3f);
} }
public IEnumerator MoveBackward(float distance) public IEnumerator MoveBackward(float distance)
...@@ -76,6 +76,8 @@ namespace com.al_arcade.tf ...@@ -76,6 +76,8 @@ namespace com.al_arcade.tf
if (product == null || startPoint == null || endPoint == null) if (product == null || startPoint == null || endPoint == null)
yield break; yield break;
float previousDistance = currentDistance;
currentDistance = Mathf.Clamp( currentDistance = Mathf.Clamp(
currentDistance - stepDistance, currentDistance - stepDistance,
0, 0,
...@@ -91,6 +93,9 @@ namespace com.al_arcade.tf ...@@ -91,6 +93,9 @@ namespace com.al_arcade.tf
seq.Append(product.DOShakePosition(0.3f, 0.08f, 15)); seq.Append(product.DOShakePosition(0.3f, 0.08f, 15));
// ✅ Offset only if we were NOT already at step 0
if (previousDistance > 0f)
{
seq.AppendCallback(() => seq.AppendCallback(() =>
{ {
if (materialOffsetController != null) if (materialOffsetController != null)
...@@ -101,6 +106,7 @@ namespace com.al_arcade.tf ...@@ -101,6 +106,7 @@ namespace com.al_arcade.tf
); );
} }
}); });
}
seq.Append(product seq.Append(product
.DOLocalMove(targetPos, 0.5f) .DOLocalMove(targetPos, 0.5f)
...@@ -132,7 +138,7 @@ namespace com.al_arcade.tf ...@@ -132,7 +138,7 @@ namespace com.al_arcade.tf
DOTween.Kill(product); DOTween.Kill(product);
product.localPosition = startPoint.localPosition; product.localPosition = startPoint.localPosition;
product.localRotation = Quaternion.identity; product.localRotation = Quaternion.identity;
door.DOMoveY(1, 1).SetEase(Ease.OutBack); door.DOMoveY(0.5f, 1).SetEase(Ease.OutBack);
} }
} }
} }
......
...@@ -4,18 +4,21 @@ using ALArcade.ArabicTMP; ...@@ -4,18 +4,21 @@ using ALArcade.ArabicTMP;
namespace com.al_arcade.tf namespace com.al_arcade.tf
{ {
using LightSide;
using shared; using shared;
public class TfQuestionScreen : MonoBehaviour public class TfQuestionScreen : MonoBehaviour
{ {
[SerializeField] private ArabicTextMeshPro _questionText; [SerializeField] private UniText _questionText;
[SerializeField] private ArabicTextMeshPro _sourceText; [SerializeField] private UniText _sourceText;
[SerializeField] private ArabicTextMeshPro _feedbackText; [SerializeField] private ArabicTextMeshPro _feedbackText;
[SerializeField] private ScreenFeedback _screenFeedback;
private Material _screenMat; private Material _screenMat;
private Material _feedbackMat; private Material _feedbackMat;
private GameObject _feedbackPanel; private GameObject _feedbackPanel;
public void Build(Vector3 position, Vector3 cameraPos) public void Build(Vector3 position, Vector3 cameraPos)
{ {
transform.position = position; transform.position = position;
...@@ -77,31 +80,12 @@ namespace com.al_arcade.tf ...@@ -77,31 +80,12 @@ namespace com.al_arcade.tf
textObj.transform.localPosition = new Vector3(0, 0.25f, -0.25f); textObj.transform.localPosition = new Vector3(0, 0.25f, -0.25f);
textObj.transform.localRotation = Quaternion.identity; textObj.transform.localRotation = Quaternion.identity;
_questionText = textObj.AddComponent<ArabicTextMeshPro>();
_questionText.alignment = TMPro.TextAlignmentOptions.Center;
_questionText.color = Color.white;
_questionText.fontStyle = TMPro.FontStyles.Bold;
_questionText.enableAutoSizing = true;
_questionText.fontSizeMin = 1.8f;
_questionText.fontSizeMax = 3.8f;
_questionText.rectTransform.sizeDelta = new Vector2(6.2f, 2.2f);
_questionText.enableWordWrapping = true;
_questionText.overflowMode = TMPro.TextOverflowModes.Ellipsis;
SSFontManager.Apply(_questionText);
var srcObj = new GameObject("SourceText"); var srcObj = new GameObject("SourceText");
srcObj.transform.SetParent(transform); srcObj.transform.SetParent(transform);
srcObj.transform.localPosition = new Vector3(0, -1.15f, -0.25f); srcObj.transform.localPosition = new Vector3(0, -1.15f, -0.25f);
srcObj.transform.localRotation = Quaternion.identity; srcObj.transform.localRotation = Quaternion.identity;
_sourceText = srcObj.AddComponent<ArabicTextMeshPro>();
_sourceText.alignment = TMPro.TextAlignmentOptions.Center;
_sourceText.color = SSColorPalette.WithAlpha(Color.white, 0.45f);
_sourceText.fontSize = 1.5f;
_sourceText.rectTransform.sizeDelta = new Vector2(6f, 0.5f);
SSFontManager.Apply(_sourceText);
_feedbackPanel = GameObject.CreatePrimitive(PrimitiveType.Cube); _feedbackPanel = GameObject.CreatePrimitive(PrimitiveType.Cube);
...@@ -192,7 +176,7 @@ namespace com.al_arcade.tf ...@@ -192,7 +176,7 @@ namespace com.al_arcade.tf
if (_questionText != null) if (_questionText != null)
{ {
_questionText.arabicText = text; _questionText.Text = text;
DOTween.Kill(_questionText.transform, "qScale"); DOTween.Kill(_questionText.transform, "qScale");
_questionText.transform.localScale = Vector3.one * 0.6f; _questionText.transform.localScale = Vector3.one * 0.6f;
_questionText.DOFade(0, 0); _questionText.DOFade(0, 0);
...@@ -202,7 +186,7 @@ namespace com.al_arcade.tf ...@@ -202,7 +186,7 @@ namespace com.al_arcade.tf
} }
if (_sourceText != null) if (_sourceText != null)
_sourceText.arabicText = !string.IsNullOrEmpty(source) ? $"{source}" : ""; _sourceText.Text = !string.IsNullOrEmpty(source) ? $"{source}" : "";
if (_screenMat != null) if (_screenMat != null)
...@@ -219,6 +203,10 @@ namespace com.al_arcade.tf ...@@ -219,6 +203,10 @@ namespace com.al_arcade.tf
public void ShowFeedback(bool correct, int streak) public void ShowFeedback(bool correct, int streak)
{ {
if (_screenFeedback != null)
{
_screenFeedback.ScreenFlash(correct);
}
if (_feedbackText != null) if (_feedbackText != null)
{ {
_feedbackText.arabicText = correct _feedbackText.arabicText = correct
...@@ -245,8 +233,8 @@ namespace com.al_arcade.tf ...@@ -245,8 +233,8 @@ namespace com.al_arcade.tf
public void Clear() public void Clear()
{ {
if (_questionText != null) _questionText.arabicText = ""; if (_questionText != null) _questionText.Text = "";
if (_sourceText != null) _sourceText.arabicText = ""; if (_sourceText != null) _sourceText.Text = "";
if (_feedbackText != null) _feedbackText.arabicText = ""; if (_feedbackText != null) _feedbackText.arabicText = "";
if (_feedbackMat != null) if (_feedbackMat != null)
{ {
......
...@@ -68,7 +68,22 @@ MonoBehaviour: ...@@ -68,7 +68,22 @@ MonoBehaviour:
- rid: 1402396885666234435 - rid: 1402396885666234435
- rid: 1402396885666234436 - rid: 1402396885666234436
m_RuntimeSettings: m_RuntimeSettings:
m_List: [] m_List:
- rid: 8615661552602186033
- rid: 8615661552602186036
- rid: 8615661552602186037
- rid: 8615661552602186040
- rid: 8615661552602186041
- rid: 8615661552602186042
- rid: 8615661552602186045
- rid: 8615661552602186048
- rid: 8615661552602186049
- rid: 8615661552602186051
- rid: 8615661552602186053
- rid: 8615661552602186057
- rid: 8615661552602186058
- rid: 8615661552602186061
- rid: 1402396885666234435
m_AssetVersion: 10 m_AssetVersion: 10
m_ObsoleteDefaultVolumeProfile: {fileID: 0} m_ObsoleteDefaultVolumeProfile: {fileID: 0}
m_RenderingLayerNames: m_RenderingLayerNames:
......
...@@ -6,8 +6,8 @@ EditorBuildSettings: ...@@ -6,8 +6,8 @@ EditorBuildSettings:
serializedVersion: 2 serializedVersion: 2
m_Scenes: m_Scenes:
- enabled: 1 - enabled: 1
path: Assets/Scenes/CS/CS.unity path: Assets/Scenes/TF/TF.unity
guid: 4013c5c8b28e4e746859513f1ec95b1e guid: c2f60049cef0f6b44b9445afcf550aff
m_configObjects: m_configObjects:
com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3} com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3}
m_UseUCBPForAssetBundles: 0 m_UseUCBPForAssetBundles: 0
...@@ -13,7 +13,7 @@ PlayerSettings: ...@@ -13,7 +13,7 @@ PlayerSettings:
useOnDemandResources: 0 useOnDemandResources: 0
accelerometerFrequency: 60 accelerometerFrequency: 60
companyName: DefaultCompany companyName: DefaultCompany
productName: My project productName: True False
defaultCursor: {fileID: 0} defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0} cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
...@@ -548,7 +548,8 @@ PlayerSettings: ...@@ -548,7 +548,8 @@ PlayerSettings:
openGLRequireES31: 0 openGLRequireES31: 0
openGLRequireES31AEP: 0 openGLRequireES31AEP: 0
openGLRequireES32: 0 openGLRequireES32: 0
m_TemplateCustomTags: {} m_TemplateCustomTags:
PRODUCT_DESCRIPTION:
mobileMTRendering: mobileMTRendering:
Android: 1 Android: 1
iPhone: 1 iPhone: 1
...@@ -815,10 +816,10 @@ PlayerSettings: ...@@ -815,10 +816,10 @@ PlayerSettings:
webGLDebugSymbols: 0 webGLDebugSymbols: 0
webGLEmscriptenArgs: webGLEmscriptenArgs:
webGLModulesDirectory: webGLModulesDirectory:
webGLTemplate: APPLICATION:Default webGLTemplate: APPLICATION:PWA
webGLAnalyzeBuildSize: 0 webGLAnalyzeBuildSize: 0
webGLUseEmbeddedResources: 0 webGLUseEmbeddedResources: 0
webGLCompressionFormat: 0 webGLCompressionFormat: 2
webGLWasmArithmeticExceptions: 0 webGLWasmArithmeticExceptions: 0
webGLLinkerTarget: 1 webGLLinkerTarget: 1
webGLThreadsSupport: 0 webGLThreadsSupport: 0
......
...@@ -21,10 +21,10 @@ EditorUserSettings: ...@@ -21,10 +21,10 @@ EditorUserSettings:
value: 5a08575f5207595a0f5d59741173094444164f7d7d2a23317c7a4465bbe1646d value: 5a08575f5207595a0f5d59741173094444164f7d7d2a23317c7a4465bbe1646d
flags: 0 flags: 0
RecentlyUsedSceneGuid-5: RecentlyUsedSceneGuid-5:
value: 5701055506000a030f5c542744260844404f4d73797975367c2c1e6ab7e2653d value: 5304575f5c0c51035d5a5e771271594417154e7c2d7b70647b7b4c35bbe1646d
flags: 0 flags: 0
RecentlyUsedSceneGuid-6: RecentlyUsedSceneGuid-6:
value: 5304575f5c0c51035d5a5e771271594417154e7c2d7b70647b7b4c35bbe1646d value: 5701055506000a030f5c542744260844404f4d73797975367c2c1e6ab7e2653d
flags: 0 flags: 0
RecentlyUsedSceneGuid-7: RecentlyUsedSceneGuid-7:
value: 0003525055055d020e0b0a7216755d444215417e787d27362e2f4866b2e1323e value: 0003525055055d020e0b0a7216755d444215417e787d27362e2f4866b2e1323e
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment