public ParticleState GetParticle(int index) { if (index >= GetParticleCount()) { throw new ArgumentOutOfRangeException(nameof(index)); } InstanceData instanceData = _instanceData[index]; ParticleStateInternal internalState = _particleStates[index]; return(new ParticleState(instanceData.Offset, internalState.Velocity, instanceData.Alpha, instanceData.Size, internalState.Age)); }
public void SetParticle(int index, ParticleState state) { if (index >= GetParticleCount()) { throw new ArgumentOutOfRangeException(nameof(index)); } InstanceData id = new InstanceData(state.Offset, state.Alpha, state.Size); _instanceData[index] = id; // _instanceData[index].Offset = state.Offset; // _instanceData[index].Alpha = state.Alpha; // _instanceData[index].Size = state.Size; ParticleStateInternal psi = new ParticleStateInternal(); psi.Velocity = state.Velocity; psi.Age = state.Age; _particleStates[index] = psi; // _particleStates[index].Velocity = state.Velocity; // _particleStates[index].Age = state.Age; }