Esempio n. 1
0
        /// <summary>
        /// Randomizes and returns the random seed value for a <see cref="SubstanceGraph"/> asset.
        /// </summary>
        /// <param name="graph">The graph to randomize the seed value for.</param>
        public static int RandomizeSeed(this SubstanceGraph graph)
        {
            int newSeed = Random.Range(int.MinValue, int.MaxValue);

            graph.SetInputInt(RandomSeedParameter, newSeed);

            return(newSeed);
        }
    public void AddScratches()
    {
        var scratches = graph.GetInputInt("Metal_Scratches_Amount");

        scratches += (int)(scratchSpeed * Time.fixedDeltaTime);
        graph.SetInputInt("Metal_Scratches_Amount", scratches);
        graph.QueueForRender();
        Substance.Game.Substance.RenderSubstancesAsync();
    }
Esempio n. 3
0
        /// <summary>
        /// Set the random seed value for a <see cref="SubstanceGraph"/> asset. Returns the new seed value.
        /// </summary>
        /// <param name="graph">The <see cref="SubstanceGraph"/> to set the random seed value for.</param>
        /// <param name="seed">Value to set the random seed to.</param>
        public static int SetRandomSeed(this SubstanceGraph graph, int seed)
        {
            graph.SetInputInt(RandomSeedParameter, seed);

            return(seed);
        }