Set Achivement system in main Homescene

Achievements
Mahamfatimaee 1 month ago
parent ccb2741265
commit 3224f24efd

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: ed9b95dc6ed6d0647ad7f1a8f305385d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

@ -9529,6 +9529,7 @@ MonoBehaviour:
coinForHintText: {fileID: 1790415148045805149}
skipCoinObj: {fileID: 1790415148045804968}
skipCoinValueText: {fileID: 1024550697}
hintcheck: 0
debugHints: 0
--- !u!114 &1790415148045805191
MonoBehaviour:
@ -10229,6 +10230,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7d4d1386b58481ac8338b97496451549, type: 3}
m_Name:
m_EditorClassIdentifier:
slider: {fileID: 5885820980592021006, guid: dda90d41bf5587f4ea2905ee372f4608, type: 3}
hintslider: {fileID: 1051964499492098825, guid: 31cb6cbadbc791844a2c5d75437211f4,
type: 3}
_cellPrefab:
- {fileID: 1790415148045804981, guid: 4f7a5f448033b8e4c895a7d4fcb89e3e, type: 3}
- {fileID: 1790415148045804992, guid: 6fd6ed12f3e506d44b59ac7c04ffb652, type: 3}
@ -10253,10 +10257,11 @@ MonoBehaviour:
_space: 0
levelGroups:
- {fileID: 11400000, guid: 3cdd9d8df70f43d5ae2246b73451a8bf, type: 2}
- {fileID: 11400000, guid: d61999cc37d04360a3f0bf32267bf82a, type: 2}
- {fileID: 11400000, guid: 46272a75089b90d44b27700883ff8da3, type: 2}
- {fileID: 11400000, guid: d606e6845dd447e2bf40638facbc7c7e, type: 2}
- {fileID: 11400000, guid: e5f4032f73074b45aa468e2ecf71f81c, type: 2}
- {fileID: 11400000, guid: cf6a4a494d684237bcf9ce01e1ac77ae, type: 2}
boolcheck: {fileID: 0}
allCellList:
- {fileID: 0}
- {fileID: 0}
@ -10293,6 +10298,10 @@ MonoBehaviour:
closeGameOver: 0
row: 0
column: 0
levepopup: {fileID: 0}
prefeb: {fileID: 3103223411245280076, guid: a839d31fd6b8ca7409802d7859982b69, type: 3}
pointadd: {fileID: 0}
valas: 0
--- !u!114 &1790415148045805218
MonoBehaviour:
m_ObjectHideFlags: 0

File diff suppressed because it is too large Load Diff

@ -9,9 +9,6 @@ public class instantiateprefab : MonoBehaviour
public GameObject prefab, panel;
public GameObject[] positionArray;
public Transform parentTf;
//public Text[] values;
// public int[] minValues;
// public int[] maxValues;
public List<LevelGroup> levelGroups;
public int minIndex = 0;
public int maxIndex = 8;
@ -25,10 +22,8 @@ public class instantiateprefab : MonoBehaviour
private List<Slider> sliders = new List<Slider>();
public GamePlayManager gameplay;
public Slider sliderprefabalue, hintcheckvalue;
public string[] ModeNames;
public int value;
// public GameObject level;
public LevelGroupButton levelGroupButton;
private LevelGroupButton levelGroupButton;
public void Awake()
{
levelGroupButton=GetComponent<LevelGroupButton>();
@ -45,10 +40,10 @@ public class instantiateprefab : MonoBehaviour
}
InstantiateSSlider(positionArray.Length, new Vector3(0, -100, 0));
InstantiateSSlider(positionArray.Length + 1, new Vector3(0, -200, 0));
InstantiateSSlider(positionArray.Length + 2, new Vector3(0, -300, 0));
InstantiateSSlider(positionArray.Length + 3, new Vector3(0, -400, 0));
InstantiateExtraSlider(positionArray.Length, new Vector3(0, -100, 0));
InstantiateExtraSlider(positionArray.Length + 1, new Vector3(0, -200, 0));
InstantiateExtraSlider(positionArray.Length + 2, new Vector3(0, -300, 0));
InstantiateExtraSlider(positionArray.Length + 3, new Vector3(0, -400, 0));
// Add listener to the button
@ -97,7 +92,7 @@ public class instantiateprefab : MonoBehaviour
}
public void InstantiateSSlider(int index, Vector3 position)
public void InstantiateExtraSlider(int index, Vector3 position)
{
GameObject sliderObject = Instantiate(prefab, position, Quaternion.identity, parentTf);
sliderObject.GetComponent<ScoreButton>().myIndex = index + 1;
@ -110,7 +105,7 @@ public class instantiateprefab : MonoBehaviour
}
else
{
sliderObject.name = "Slider - Extra " + (index - manger.AchievementList.Count + 1);
sliderObject.name = "" + (index - manger.AchievementList.Count + 1);
}
// Set the Mode text for extra sliders
@ -121,13 +116,14 @@ public class instantiateprefab : MonoBehaviour
Text modeText = child.GetComponent<Text>();
if (modeText != null)
{
if (index < ModeNames.Length)
// Set mode text based on the achievement name if within the achievement list range
if (index < manger.AchievementList.Count)
{
modeText.text = ModeNames[index];
modeText.text = manger.AchievementList[index].DisplayName.ToString();
}
else
{
modeText.text = "Extra Mode " + (index - ModeNames.Length + 1);
modeText.text = "" + (index - manger.AchievementList.Count + 1);
}
}
}
@ -140,13 +136,14 @@ public class instantiateprefab : MonoBehaviour
"0 / 10"; // Fallback for extra sliders
}
}
Slider slider = sliderObject.GetComponent<Slider>();
if (slider != null)
{
slider.minValue = 0;
slider.maxValue = (index < manger.AchievementList.Count) ? manger.AchievementList[index].ProgressGoal : 10;
// slider.value = (index < manger.AchievementList.Count) ? manger.AchievementList[index].ProgressCurrent : 0;
sliders.Add(slider); // Store the slider in the list
}
@ -160,7 +157,7 @@ public class instantiateprefab : MonoBehaviour
sliderAtIndex7.value += 1;
sliderAtIndex7.maxValue = 10;
sliderAtIndex7.minValue = 0;
// Ensure the name of the slider at index 7 matches the AchievementList
}
}
@ -177,33 +174,9 @@ public class instantiateprefab : MonoBehaviour
}
public void Update()
{
SliderValueAtIndex9();
SliderValueAtIndex10();
for (int i = 0; i < sliders.Count; i++)
{
if (levelGroups[i].CompletedLevel == levelGroups[i].TotalLevel)
{
sliders[i].maxValue = levelGroups[i].TotalLevel;
// Increment the TotalLevel by 5 immediately
levelGroups[i].TotalLevel += 5;
score.completetargets += 1;
score.points += 50 *score.myIndex;
// score. targetText.text = "" + completetargets.ToString();
if (levelGroupButton != null)
{
levelGroupButton.UpdateUI();
}
}
}
}
public void SliderValueAtIndex9()
{
@ -249,5 +222,32 @@ public class instantiateprefab : MonoBehaviour
panel.SetActive(false);
}
public void ChangeTotalvalue()
{
for (int i = 0; i < sliders.Count; i++)
{
if (levelGroups[i].CompletedLevel == levelGroups[i].TotalLevel)
{
sliders[i].maxValue = levelGroups[i].TotalLevel;
// Increment the TotalLevel by 5 immediately
levelGroups[i].TotalLevel += 5;
score.completetargets += 1;
score.points += 50 * score.myIndex;
// score. targetText.text = "" + completetargets.ToString();
if (levelGroupButton != null)
{
levelGroupButton.UpdateUI();
}
}
}
}
}

@ -68,7 +68,7 @@ public class GameScene : MonoBehaviour
{
Sound.instance.PlayButton(Sound.Button.Back);
GameManager.openLevelSelection = true;
SceneManager.LoadScene("HomeScene1");
SceneManager.LoadScene("HomeScene");
}
}

@ -2619,6 +2619,12 @@ MonoBehaviour:
- Progress: 0
LastProgressUpdate: 0
Achieved: 0
- Progress: 0
LastProgressUpdate: 0
Achieved: 0
- Progress: 0
LastProgressUpdate: 0
Achieved: 0
AchievementList:
- Key: 'Easy '
DisplayName: Complete Easy Levels
@ -2675,9 +2681,31 @@ MonoBehaviour:
ProgressGoal: 0
NotificationFrequency: 0
ProgressSuffix:
- Key: ads
- Key: Hint
DisplayName: Levels Complete With Hint
Description: Hint check
LockedIcon: {fileID: 0}
LockOverlay: 0
AchievedIcon: {fileID: 0}
Spoiler: 0
Progression: 0
ProgressGoal: 0
NotificationFrequency: 0
ProgressSuffix:
- Key: Watch Ads
DisplayName: Watch 10 Ads
Description: watch ads
Description: Ads
LockedIcon: {fileID: 0}
LockOverlay: 0
AchievedIcon: {fileID: 0}
Spoiler: 0
Progression: 0
ProgressGoal: 0
NotificationFrequency: 0
ProgressSuffix:
- Key: Watch Ads
DisplayName: Watch 20 Ads
Description: Ads
LockedIcon: {fileID: 0}
LockOverlay: 0
AchievedIcon: {fileID: 0}
@ -2686,9 +2714,9 @@ MonoBehaviour:
ProgressGoal: 0
NotificationFrequency: 0
ProgressSuffix:
- Key: extra
DisplayName: extra
Description: extraaa
- Key: Pipe Rotation Count
DisplayName: Pipe Rotation Number
Description: Pipe Rotation
LockedIcon: {fileID: 0}
LockOverlay: 0
AchievedIcon: {fileID: 0}

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: a55ee4efaad27d948ba5f03fc6d7bc80
DefaultImporter:
guid: 785ba0892cccb424686266af6be628db
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:

@ -1042,7 +1042,7 @@ RectTransform:
m_GameObject: {fileID: 8666872430276523867}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalScale: {x: 1.5039, y: 1.5039, z: 1.5039}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2018436702493492130}
@ -1060,7 +1060,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -51, y: 0}
m_AnchoredPosition: {x: -1, y: -9}
m_SizeDelta: {x: 160, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &8144627697084440105
@ -1138,6 +1138,7 @@ MonoBehaviour:
progress: {fileID: 813425859468727190}
levelname: {fileID: 5312961109301411640}
manager: {fileID: 0}
valus: 0
myIndex: -1
--- !u!1 &9181119804508602202
GameObject:

Loading…
Cancel
Save