Improvement in obstacle according to difficulty logic

dev-ali
Ali Sharoz 5 months ago
parent cd11812c91
commit 6a4a25a9bd

@ -2512,8 +2512,8 @@ Transform:
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0.7071068, z: -0.7071068, w: 0} m_LocalRotation: {x: 0, y: 0.7071068, z: -0.7071068, w: 0}
m_LocalPosition: {x: 0, y: 3.75, z: -0.07} m_LocalPosition: {x: 0, y: 3.75, z: -0.07}
m_LocalScale: {x: 0.75, y: 0.75, z: 0.4} m_LocalScale: {x: 1, y: 1, z: 0.53333336}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 1
m_Children: m_Children:
- {fileID: 1697168102} - {fileID: 1697168102}
m_Father: {fileID: 0} m_Father: {fileID: 0}
@ -3109,7 +3109,7 @@ Transform:
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.006667455, z: 9.952501} m_LocalPosition: {x: 0, y: 0.006667455, z: 9.952501}
m_LocalScale: {x: 1.25, y: 1.25, z: 1.25} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 1 m_ConstrainProportionsScale: 1
m_Children: m_Children:
- {fileID: 606170163} - {fileID: 606170163}

@ -21,18 +21,42 @@ public class Obstacle : MonoBehaviour
List<GameObject> DifficultyList() List<GameObject> DifficultyList()
{ {
int difficultyLevel = (int)GameManager.instance.difficultyLevel; int difficultyLevel = (int)GameManager.instance.difficultyLevel;
return difficultyLevel == 0 ? easyObstacleObjs : difficultyLevel == 1 ? mediumObstacleObjs : hardObstacleObjs; //return difficultyLevel == 0 ? easyObstacleObjs : difficultyLevel == 1 ? mediumObstacleObjs : hardObstacleObjs;
//if (difficultyLevel == 0) int percentAge = Random.Range(0, 100);
//{
// return easyObstacleObjs; if (difficultyLevel == 0)
//} {
//else if (difficultyLevel == 1) return easyObstacleObjs;
//{ }
// return mediumObstacleObjs; else if (difficultyLevel == 1)
//} {
//else if (percentAge < 75)
//{ {
// return HardObstacleObjs; return mediumObstacleObjs;
//} }
else
{
Debug.Log("Difficulty Medium but Obstacle Easy");
return easyObstacleObjs;
}
}
else
{
if (percentAge < 75)
{
return hardObstacleObjs;
}
else if (percentAge >= 75 && percentAge < 87)
{
Debug.Log("Difficulty Hard but Obstacle Medium");
return mediumObstacleObjs;
}
else
{
Debug.Log("Difficulty Hard but Obstacle Easy");
return easyObstacleObjs;
}
}
} }
} }

Loading…
Cancel
Save