public static GreebleDefinition ProceduralGreebleType(GreebleDefinition[] greebleDefinitions, float timeSinceDespawn = 0f) { if (greebleDefinitions == null) { return(null); } int num = 0; for (int i = 0; i < greebleDefinitions.Length; i++) { GreebleDefinition greebleDefinition = greebleDefinitions[i]; num += greebleDefinition.Chance; } int num2 = GreebleUtility_Networked.ProceduralValue(0, num); num = 0; for (int j = 0; j < greebleDefinitions.Length; j++) { GreebleDefinition greebleDefinition2 = greebleDefinitions[j]; num += greebleDefinition2.Chance; if (num2 < num) { return(greebleDefinition2); } } return(null); }
public static GreebleDefinition ProceduralGreebleType(GreebleDefinition[] greebleDefinitions, float timeSinceDespawn = 0f) { if (greebleDefinitions == null) { return(null); } int num = 0; foreach (GreebleDefinition greebleDefinition in greebleDefinitions) { num += greebleDefinition.Chance; } int num2 = GreebleUtility_Networked.ProceduralValue(0, num); num = 0; foreach (GreebleDefinition greebleDefinition2 in greebleDefinitions) { num += greebleDefinition2.Chance; if (num2 < num) { return(greebleDefinition2); } } return(null); }
public static Quaternion ProceduralRotation() { return(Quaternion.Euler(GreebleUtility_Networked.ProceduralAngle(), GreebleUtility_Networked.ProceduralAngle(), GreebleUtility_Networked.ProceduralAngle())); }
public static Vector3 ProceduralDirection() { return(Vector3.Normalize(GreebleUtility_Networked.ProceduralDirectionFast())); }
public static Vector3 ProceduralDirectionFast() { return(new Vector3(GreebleUtility_Networked.ProceduralValue(-1f, 1f), GreebleUtility_Networked.ProceduralValue(-1f, 1f), GreebleUtility_Networked.ProceduralValue(-1f, 1f))); }
public static float ProceduralAngle() { return(GreebleUtility_Networked.ProceduralValue(0f, 360f)); }