Improvement in obstacle according to difficulty logic

dev-ali
Ali Sharoz 2 days ago
parent cd11812c91
commit 6a4a25a9bd

@ -2512,8 +2512,8 @@ Transform:
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0.7071068, z: -0.7071068, w: 0}
m_LocalPosition: {x: 0, y: 3.75, z: -0.07}
m_LocalScale: {x: 0.75, y: 0.75, z: 0.4}
m_ConstrainProportionsScale: 0
m_LocalScale: {x: 1, y: 1, z: 0.53333336}
m_ConstrainProportionsScale: 1
m_Children:
- {fileID: 1697168102}
m_Father: {fileID: 0}
@ -3109,7 +3109,7 @@ Transform:
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
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_Children:
- {fileID: 606170163}

@ -21,18 +21,42 @@ public class Obstacle : MonoBehaviour
List<GameObject> DifficultyList()
{
int difficultyLevel = (int)GameManager.instance.difficultyLevel;
return difficultyLevel == 0 ? easyObstacleObjs : difficultyLevel == 1 ? mediumObstacleObjs : hardObstacleObjs;
//if (difficultyLevel == 0)
//{
// return easyObstacleObjs;
//}
//else if (difficultyLevel == 1)
//{
// return mediumObstacleObjs;
//}
//else
//{
// return HardObstacleObjs;
//}
//return difficultyLevel == 0 ? easyObstacleObjs : difficultyLevel == 1 ? mediumObstacleObjs : hardObstacleObjs;
int percentAge = Random.Range(0, 100);
if (difficultyLevel == 0)
{
return easyObstacleObjs;
}
else if (difficultyLevel == 1)
{
if (percentAge < 75)
{
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