Example #1
0
    public void UnregisterSystem <T>() where T : SystemBase
    {
        var type = typeof(T);

        if (!SystemDic.ContainsKey(type))
        {
            return;
        }
        SystemDic.Remove(type);
    }
Example #2
0
    public void RegisterSystem <T>() where T : SystemBase, new()
    {
        var system = new T();
        var type   = typeof(T);

        if (SystemDic.ContainsKey(type))
        {
            Debug.LogErrorFormat("System : [{0}] has already registered", type);
            return;
        }
        SystemDic[typeof(T)] = system;
    }