docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GenerateRandomSeedFromIndex

    GenerateRandomSeedFromIndex(int, uint)

    Generates a random seed by hashing three values together: an arbitrary index value, the current scenario iteration, and a base random seed. This method is useful for deterministically generating random seeds from within a for-loop.

    Declaration
    public uint GenerateRandomSeedFromIndex(int iteration, uint baseSeed = 539662031)
    Parameters
    Type Name Description
    int iteration

    An offset value hashed inside the seed generator

    uint baseSeed

    An offset value hashed inside the seed generator

    Returns
    Type Description
    uint

    The generated random seed

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)