Esempio n. 1
0
    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);
    }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
 public static Quaternion ProceduralRotation()
 {
     return(Quaternion.Euler(GreebleUtility_Networked.ProceduralAngle(), GreebleUtility_Networked.ProceduralAngle(), GreebleUtility_Networked.ProceduralAngle()));
 }
Esempio n. 4
0
 public static Vector3 ProceduralDirection()
 {
     return(Vector3.Normalize(GreebleUtility_Networked.ProceduralDirectionFast()));
 }
Esempio n. 5
0
 public static Vector3 ProceduralDirectionFast()
 {
     return(new Vector3(GreebleUtility_Networked.ProceduralValue(-1f, 1f), GreebleUtility_Networked.ProceduralValue(-1f, 1f), GreebleUtility_Networked.ProceduralValue(-1f, 1f)));
 }
Esempio n. 6
0
 public static float ProceduralAngle()
 {
     return(GreebleUtility_Networked.ProceduralValue(0f, 360f));
 }