Entitas.Systems.Add C# (CSharp) Method

Add() public method

public Add ( ISystem system ) : Systems
system ISystem
return Systems
        public virtual Systems Add(ISystem system)
        {
            var initializeSystem = system as IInitializeSystem;
            if(initializeSystem != null) {
                _initializeSystems.Add(initializeSystem);
            }

            var executeSystem = system as IExecuteSystem;
            if(executeSystem != null) {
                _executeSystems.Add(executeSystem);
            }

            var cleanupSystem = system as ICleanupSystem;
            if(cleanupSystem != null) {
                _cleanupSystems.Add(cleanupSystem);
            }

            var tearDownSystem = system as ITearDownSystem;
            if(tearDownSystem != null) {
                _tearDownSystems.Add(tearDownSystem);
            }

            return this;
        }

Usage Example

        //-------------------------------------------------
        //	UNITY FUNCTIONS
        //-------------------------------------------------
        void Awake()
        {
            PhotonNetwork.autoJoinLobby          = false;
            PhotonNetwork.automaticallySyncScene = true;

            _contexts      = Contexts.sharedInstance;
            _systems       = new Feature("Launcher Systems");
            _serverSystems = new Feature("Server Systems");

            _systems.Add(new ModifyPseudoSystem(_contexts, PseudoField));
            _systems.Add(new ValidateButtonSystem(_contexts, ValidateButton));
            _systems.Add(new ConnectionSystem(_contexts, this, Settings));
            _systems.Add(new ConnectionUiSystem(_contexts, LoadingScreen));

            _serverSystems.Add(new LoadingLobbySystem(_contexts, Settings));
        }
All Usage Examples Of Entitas.Systems::Add