Photon Quantum 2.1.1

Public Member Functions | List of all members
Quantum.Core.FrameBase.FrameBaseUnsafe Struct Reference

Frame API to give access to C# unsafe pointers and advanced immediate operations. More...

Inherits IDisposable.

Public Member Functions

void CommitAllCommands ()
 Trigger the execution of entity and component deletion. More...
 
ComponentBlockIterator< T > GetComponentBlockIterator< T > ()
 Get a component iterator that cycles blocks of component pointers. More...
 
ComponentBlockIterator< T > GetComponentBlockIterator< T > (int offset, int count)
 Get a component iterator that cycles blocks of component pointers, using a start offset and count More...
 
T * GetPointer< T > (EntityRef entityRef)
 Gets a pointer to a component that can be changed directly without writing the component back with Set<T>(EntityRef, T). More...
 
bool TryGetPointer< T > (EntityRef entityRef, out T *value)
 Similar to GetPointer<T>(EntityRef) but does not throw an exception if the component is not present. More...
 

Detailed Description

Frame API to give access to C# unsafe pointers and advanced immediate operations.

Usage: Frame.Unsafe.Get

Member Function Documentation

◆ GetComponentBlockIterator< T >() [1/2]

ComponentBlockIterator<T> Quantum.Core.FrameBase.FrameBaseUnsafe.GetComponentBlockIterator< T > ( )
inline

Get a component iterator that cycles blocks of component pointers.

Template Parameters
TComponent type
Returns
Block iterator
var region = 1UL << 1;
var navMeshAgents = f.Unsafe.GetComponentBlockIterator<NavMeshAgent>();
while (navMeshAgents.NextBlock(out EntityRef* entities, out NavMeshAgent* agents, out int count)) {
for (int i = 0; i<count; i++) {
var entity = entities[i];
var agent = &amp;agents[i];
agent->SetNavMeshRegionActive(region, !agent->IsNavMeshRegionActive(region));
}
}
Type Constraints
T :unmanaged 
T :IComponent 

◆ GetComponentBlockIterator< T >() [2/2]

ComponentBlockIterator<T> Quantum.Core.FrameBase.FrameBaseUnsafe.GetComponentBlockIterator< T > ( int  offset,
int  count 
)
inline

Get a component iterator that cycles blocks of component pointers, using a start offset and count

Template Parameters
TComponent type
Parameters
offsetOffset of entities we want
countHow many entities we want
Returns
Block iterator
var region = 1UL << 1;
var navMeshAgents = f.Unsafe.GetComponentBlockIterator<NavMeshAgent>(32, 16);
while (navMeshAgents.NextBlock(out EntityRef* entities, out NavMeshAgent* agents, out int count)) {
for (int i = 0; i<count; i++) {
var entity = entities[i];
var agent = &amp;agents[i];
agent->SetNavMeshRegionActive(region, !agent->IsNavMeshRegionActive(region));
}
}
Type Constraints
T :unmanaged 
T :IComponent 

◆ CommitAllCommands()

void Quantum.Core.FrameBase.FrameBaseUnsafe.CommitAllCommands ( )
inline

Trigger the execution of entity and component deletion.