Exemplo n.º 1
0
    void Start()
    {
        _instance = this;

        Debug.Log("Root Start");
        mPluginManager = new NFPluginManager();
        mPluginManager.Registered(new NFSDKPlugin(mPluginManager));
        mPluginManager.Registered(new NFLogicPlugin(mPluginManager));
        mPluginManager.Registered(new NFUIPlugin(mPluginManager));
        mPluginManager.Registered(new NFScenePlugin(mPluginManager));


        mClassModule = mPluginManager.FindModule <NFIClassModule>();
        mNetModule   = mPluginManager.FindModule <NFNetModule>();
        mUIModule    = mPluginManager.FindModule <NFUIModule>();

        //mClassModule.SetDataPath("../../_Out/");

        if (RuntimePlatform.Android == Application.platform ||
            RuntimePlatform.IPhonePlayer == Application.platform)
        {
            //mPluginManager.FindModule<NFIClassModule>().SetDataPath("./");
        }

        mPluginManager.Awake();
        mPluginManager.Init();
        mPluginManager.AfterInit();

        mUIModule.ShowUI <NFUILogin>();
        mTool.Init();

        mNetModule.StartConnect("192.168.13.133", 14001);

        DontDestroyOnLoad(gameObject);
    }
Exemplo n.º 2
0
    void Start()
    {
        _instance = this;

        Debug.Log("Root Start " + Application.platform);
        RenderSettings.fog = false;

        mConfig.Load();


        mPluginManager.Registered(new NFSDKPlugin(mPluginManager));
        mPluginManager.Registered(new NFUIPlugin(mPluginManager));
        mPluginManager.Registered(new NFScenePlugin(mPluginManager));

        mKernelModule = mPluginManager.FindModule <NFIKernelModule>();
        mClassModule  = mPluginManager.FindModule <NFIClassModule>();
        mNetModule    = mPluginManager.FindModule <NFNetModule>();
        mUIModule     = mPluginManager.FindModule <NFUIModule>();
        mLogModule    = mPluginManager.FindModule <NFLogModule>();


        mClassModule.SetDataPath(mConfig.GetDataPath());

        mPluginManager.Awake();
        mPluginManager.Init();
        mPluginManager.AfterInit();

        mUIModule.ShowUI <NFUILogin>();

        if (mConfig.GetServerList().Count > 1)
        {
            mbShowServer = true;
        }
        else
        {
            string strTargetIP = "127.0.0.1";
            if (mConfig.GetSelectServer(ref strTargetIP))
            {
                mNetModule.StartConnect(strTargetIP, port);
            }
        }



        DontDestroyOnLoad(gameObject);
    }