public GameObject ChooseRandomResource() { GameObject result = null; for (int i = 0; i < resources.Length; i++) { Drillable.ResourceType resourceType = resources[i]; if (resourceType.chance >= 1f) { result = CraftData.GetPrefabForTechType(resourceType.techType, true); break; } PlayerEntropy component = Player.main.gameObject.GetComponent <PlayerEntropy>(); global::Utils.Assert(component != null, "see log", null); if (component.CheckChance(resourceType.techType, resourceType.chance)) { result = CraftData.GetPrefabForTechType(resourceType.techType, true); break; } } return(result); }
private GameObject ChooseRandomResource() { GameObject result = null; for (int i = 0; i < drillable.resources.Length; i++) { Drillable.ResourceType resourceType = drillable.resources[i]; if (resourceType.chance >= 1f) { result = CraftData.GetPrefabForTechType(resourceType.techType, true); break; } PlayerEntropy component = Player.main.gameObject.GetComponent <PlayerEntropy>(); if (component.CheckChance(resourceType.techType, resourceType.chance)) { result = CraftData.GetPrefabForTechType(resourceType.techType, true); break; } } return(result); }