示例#1
0
 /// <summary>
 ///     <para>Updates the variation value for this prefab instance. The variation buffer for the prototype must be defined
 ///     with <see cref="DefinePrototypeVariationBuffer{T}"/> before using this.</para>
 /// </summary>
 /// <typeparam name="T">The type of variation buffer. Must be defined in the instance prototype's shader.</typeparam>
 /// <param name="manager">The manager that defines the prototypes you want to GPU instance.</param>
 /// <param name="prefabInstance">The prefab instance to update the variation at.</param>
 /// <param name="bufferName">The name of the variation buffer in the prototype's shader.</param>
 /// <param name="value">The value of the variation.</param>
 public static void UpdateVariation <T>(GPUInstancerPrefabManager manager, GPUInstancerPrefab prefabInstance, string bufferName, T value)
 {
     prefabInstance.AddVariation(bufferName, value);
     manager.UpdateVariationData(prefabInstance, bufferName, value);
 }