Fix build issues due to comparison operators
This commit is contained in:
@@ -35,6 +35,14 @@ public class GameManager : MonoBehaviour
|
||||
void Awake()
|
||||
{
|
||||
_instance = this;
|
||||
if (gameSettings == null)
|
||||
{
|
||||
gameSettings = Resources.Load<GameSettings>("DefaultSettings");
|
||||
if (gameSettings == null)
|
||||
{
|
||||
Debug.LogError("GameSettings asset not found in Resources!");
|
||||
}
|
||||
}
|
||||
// DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
|
||||
@@ -69,7 +77,8 @@ public class GameManager : MonoBehaviour
|
||||
if (gameSettings == null || gameSettings.combinationRules == null) return null;
|
||||
foreach (var rule in gameSettings.combinationRules)
|
||||
{
|
||||
if ((rule.itemA == item1 && rule.itemB == item2) || (rule.itemA == item2 && rule.itemB == item1))
|
||||
if ((PickupItemData.AreEquivalent(rule.itemA, item1) && PickupItemData.AreEquivalent(rule.itemB, item2)) ||
|
||||
(PickupItemData.AreEquivalent(rule.itemA, item2) && PickupItemData.AreEquivalent(rule.itemB, item1)))
|
||||
{
|
||||
return rule;
|
||||
}
|
||||
@@ -85,7 +94,7 @@ public class GameManager : MonoBehaviour
|
||||
if (gameSettings == null || gameSettings.slotItemConfigs == null || slotItem == null) return null;
|
||||
foreach (var config in gameSettings.slotItemConfigs)
|
||||
{
|
||||
if (config.slotItem == slotItem)
|
||||
if (PickupItemData.AreEquivalent(slotItem, config.slotItem))
|
||||
return config;
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user