Как вызвать метод сущности из систем React Native Engine

#javascript #reactjs #react-native #react-native-android

#javascript #reactjs #react-native #react-native-android

Вопрос:

Мой игровой движок js ;

  <GameEngine
            ref={(ref) => {
              this.refGameEngine = ref;
            }}
            running={this.state.running}
            onEvent={this.onEvent}
            systems={[EngineCycle]}
            entities={this.entities}>
</GameEngine>
 

моя система js ;

 import Matter from 'matter-js';
import StaticVariable from './StaticVariable';

const EngineCycle = (entities, { touches, time, dispatch, events }) => {
     //entities.snake
     entities.snake.onPress(); -> this is not working
     entities.snake.renderer.onPress() ; -> this is not working too.
}
 

Вопрос в том, как вызвать метод сущности объектов gameengine?