Beispiel #1
0
    public void Init(bool isView)
    {
        m_isView = isView;
        try
        {
            Type[] types = GetSystemTypes();

            for (int i = 0; i < types.Length; i++)
            {
                SystemBase tmp = (SystemBase)types[i].Assembly.CreateInstance(types[i].FullName);
                m_systemList.Add(tmp);
                tmp.m_world = this;
                tmp.Init();
            }

            //初始化RecordSystemBase

            types = GetRecordSystemTypes();
            for (int i = 0; i < types.Length; i++)
            {
                Type type = typeof(RecordSystem <>);
                type = type.MakeGenericType(types[i]);

                RecordSystemBase tmp = (RecordSystemBase)Activator.CreateInstance(type);;
                m_recordList.Add(tmp);
                m_recordDict.Add(types[i].Name, tmp);
                tmp.m_world = this;
                tmp.Init();
            }
        }
        catch (Exception e)
        {
            Debug.LogError("WorldBase Init Exception:" + e.ToString());
        }
    }
Beispiel #2
0
    public void Init(bool isView)
    {
        try
        {
            Type[] types = GetSystemTypes();

            for (int i = 0; i < types.Length; i++)
            {
                SystemBase tmp = (SystemBase)types[i].Assembly.CreateInstance(types[i].FullName);
                m_systemList.Add(tmp);
                tmp.m_world = this;
                tmp.Init();
            }

            //初始化ViweSystem
            if (isView)
            {
                types = GetViewSystemTypes();
                for (int i = 0; i < types.Length; i++)
                {
                    ViewSystemBase tmp = (ViewSystemBase)types[i].Assembly.CreateInstance(types[i].FullName);
                    m_systemList.Add(tmp);
                    tmp.m_world = this;
                    tmp.Init();
                }
            }
        }
        catch (Exception e)
        {
            Debug.LogError("WorldBase Init Exception:" + e.ToString());
        }
    }
    void InitSystem()
    {
        Type[] types = GetSystemTypes();

        for (int i = 0; i < types.Length; i++)
        {
            SystemBase tmp = (SystemBase)types[i].Assembly.CreateInstance(types[i].FullName);
            m_systemList.Add(tmp);
            tmp.m_world = this;
            tmp.Init();
        }
    }
Beispiel #4
0
    public void Init()
    {
        try
        {
            Type[] types = GetSystemTypes();

            for (int i = 0; i < types.Length; i++)
            {
                SystemBase tmp = (SystemBase)types[i].Assembly.CreateInstance(types[i].FullName);
                m_systemList.Add(tmp);
                tmp.Init();
            }
        }
        catch (Exception e)
        {
            Debug.Log("WorldBase Init Exception:" + e.ToString());
        }
    }