예제 #1
0
        public void Start()
        {
            var contexts = Contexts.sharedInstance;

#if UNITY_EDITOR
            ContextObserverHelper.ObserveAll(contexts);
#endif

#if UNITY_EDITOR
            _feature = FeatureObserverHelper.CreateFeature(null);
#else
            // init systems, auto collect matched systems, no manual Systems.Add(ISystem) required
            _feature = new Feature(null);
#endif
            _feature.Initialize();
        }
예제 #2
0
    void Start()
    {
        var contexts = Contexts.sharedInstance;

#if UNITY_EDITOR
        ContextObserverHelper.ObserveAll(contexts);
#endif
        data = new Data();
        data.LoadLevel(1);



#if UNITY_EDITOR
        _gameSystem = FeatureObserverHelper.CreateFeature(null);
#else
        //init systems, auto collect matched systems, no manual Systems.Add(ISystem) required
        _gameSystem = new Feature(null);
#endif
        _gameSystem.Initialize();
    }
예제 #3
0
        public void Start()
        {
            var contexts = Contexts.sharedInstance;

#if UNITY_EDITOR
            ContextObserverHelper.ObserveAll(contexts);
#endif

            // create random entity
            var rand    = new System.Random();
            var context = Contexts.Default;
            var e       = context.CreateEntity();
            e.Add <PositionComponent>();
            e.Add <VelocityComponent>().SetValue(rand.Next() % 10, rand.Next() % 10);

#if UNITY_EDITOR
            _feature = FeatureObserverHelper.CreateFeature(null);
#else
            // init systems, auto collect matched systems, no manual Systems.Add(ISystem) required
            _feature = new Feature(null);
#endif
            _feature.Initialize();
        }