/// <summary>
        /// Update matrices from a group.
        /// </summary>
        public void UpdateMatrices(IParticleTargetGroup group)
        {
            group.UpdateMatrices();

            System.Array.Copy(group.MatrixData, 0, _matrixData, 0, group.MatrixData.Length);

            _matrixBuffer.SetData(_matrixData);
        }
        /// <summary>
        /// Set a target group.
        /// </summary>
        public void SetGroup(IParticleTargetGroup group, ParticleTargetSubGroup subGroup = null)
        {
            DisableAllParticles();

            UpdateMatrices(group);

            UpdateInitData(group.AllInitData);

            if (subGroup == null)
            {
                UpdateIndices(group.Indices);
            }
            else
            {
                UpdateIndices(subGroup.GetIndices());
            }

            UpdateAllBuffers(_kernelSetupParticles);

            Dispatch(_kernelSetupParticles);

            _particleMat.SetTexture(_propertyDef.TexturesID, group.TextureArray);
        }