using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RandomManager : MonoBehaviour
{
    static System.Random p_myIntRandom;
    static System.Random p_myFloatRandom;


    /// <summary>
    /// Return a random int
    /// </summary>
    /// <param name="min"></param>
    /// <param name="max"></param>
    /// <returns></returns>
    public static int getIntRandom(int min, int max)
    {
        int result = 0;
        if (p_myIntRandom == null)
        {
            p_myIntRandom = new System.Random();
        }
        result = p_myIntRandom.Next(min, max);
        return result;
    }

    public static float getFloatRandom(float max)
    {
        float result = 0;
        if (p_myFloatRandom == null)
        {
            p_myFloatRandom = new System.Random();
        }
        result = float.Parse(p_myFloatRandom.NextDouble().ToString()) * 100 % max;
        return result;
    }
}