Ejemplo n.º 1
0
        private void OnUpdateRotation(RpcArgs pArgs)
        {
            if (AttachedEntity == Entity.Null || AttachedManager == null || AttachedManager.EntityManager == null)
            {
                return;
            }

            //Read the position-data to update from the stream
            UpdateRotation updateRotation = new UpdateRotation()
            {
                send     = false,
                rotation = new float4(pArgs.GetNext <float>(), pArgs.GetNext <float>(), pArgs.GetNext <float>(), pArgs.GetNext <float>())
            };

            //Get the ReceiveBuffer from our Entity
            DynamicBuffer <UpdateRotationBufferComponent> buffer = AttachedManager.EntityManager.GetBuffer <UpdateRotationBufferComponent>(AttachedEntity);

            //Add the UpdateRotationBufferComponent so it can be used by the appropriate system
            buffer.Add(new UpdateRotationBufferComponent()
            {
                Value = updateRotation
            });
        }
Ejemplo n.º 2
0
 internal void RaiseUpdateRotation(ref OpenTK.Quaternion q) => UpdateRotation?.Invoke(q);