Entitas Shu (b) create a startup script Entitas

First, the basic configuration

Basic Configuration

 

 

Second, create a startup script Entitas

The script is created and assigned to the scene empty objects.

The script action:

Using Unity lifecycle API, the basic framework of the life cycle interface calls look, this framework code will work.

using Entitas;
using UnityEngine;

namespace Game
{
    public class GameController : MonoBehaviour
    {
        Systems _system;

        public void Start()
        {
            _system = new Feature("Systems");
            _system.Initialize();
        }

        private void Update()
        {
            _system.Execute();
            _system.Cleanup();
        }

        private void OnDestroy()
        {
            _system.TearDown();
        }
    }
}

 

Published 320 original articles · won praise 77 · views 170 000 +

Guess you like

Origin blog.csdn.net/weixin_38239050/article/details/103431193