Exemplo n.º 1
0
 // Use this for initialization
 private void Awake()
 {
     mkernelModule  = NFPluginManager.Instance().FindModule <NFIKernelModule>();
     mClassModule   = NFPluginManager.Instance().FindModule <NFIClassModule>();
     mLoginModule   = NFPluginManager.Instance().FindModule <NFLoginModule>();
     mElementModule = NFPluginManager.Instance().FindModule <NFIElementModule>();
 }
Exemplo n.º 2
0
    // Use this for initialization
    private void Awake()
    {
        mkernelModule  = NFPluginManager.Instance().FindModule <NFIKernelModule>();
        mClassModule   = NFPluginManager.Instance().FindModule <NFIClassModule>();
        mLoginModule   = NFPluginManager.Instance().FindModule <NFLoginModule>();
        mElementModule = NFPluginManager.Instance().FindModule <NFIElementModule>();

        int       iNum    = 0;
        Transform tParent = this.transform.parent;

        while (tParent)
        {
            rowView = tParent.GetComponent <NFRecordRowView> ();
            if (rowView != null)
            {
                rowView.AddColView(col, this);
                break;
            }

            iNum++;
            if (iNum > 3)
            {
                break;
            }

            tParent = tParent.parent;
        }
    }
Exemplo n.º 3
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.º 4
0
    private void Awake()
    {
        mEventModule   = NFRoot.Instance().GetPluginManager().FindModule <NFIEventModule>();
        mKernelModule  = NFRoot.Instance().GetPluginManager().FindModule <NFIKernelModule>();
        mElementModule = NFRoot.Instance().GetPluginManager().FindModule <NFIElementModule>();
        mClassModule   = NFRoot.Instance().GetPluginManager().FindModule <NFIClassModule>();

        mSceneModule    = NFRoot.Instance().GetPluginManager().FindModule <NFSceneModule>();
        mLanguageModule = NFRoot.Instance().GetPluginManager().FindModule <NFLanguageModule>();
        mNetModule      = NFRoot.Instance().GetPluginManager().FindModule <NFNetModule>();
        mLoginModule    = NFRoot.Instance().GetPluginManager().FindModule <NFLoginModule>();
        mUIModule       = NFRoot.Instance().GetPluginManager().FindModule <NFUIModule>();
        mHelpModule     = NFRoot.Instance().GetPluginManager().FindModule <NFHelpModule>();
    }
Exemplo n.º 5
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);
    }
Exemplo n.º 6
0
    public bool ShowAddItem(int nWidth, int nHeight)
    {
        NFIElementModule xElementModule    = NFCKernelModule.Instance.GetElementModule();
        NFIClassModule   xLogicClassModule = NFCKernelModule.Instance.GetLogicClassModule();

        if (null == xLogicClassModule || null == xElementModule)
        {
            return(false);
        }

        int nElementWidth  = 150;
        int nElementHeight = 20;

        GUI.color     = Color.green;
        mstrItemID    = GUI.TextField(new Rect(nElementWidth * 1, nElementHeight, nElementWidth * 1, nElementHeight), mstrItemID);
        mstrItemCount = GUI.TextField(new Rect(nElementWidth * 2, nElementHeight, nElementWidth * 1, nElementHeight), mstrItemCount);
        GUI.color     = Color.white;
        if (GUI.Button(new Rect(nElementWidth * 3, nElementHeight, nElementWidth / 2, nElementHeight), "Add"))
        {
            long nItemCount = 1;
            long.TryParse(mstrItemCount, out nItemCount);

            //NFNetController.Instance.mxNetSender.RequireNormalGM(NFNetController.Instance.xMainRoleID, NFMsg.ReqCommand.EGameCommandType.EGCT_MODIY_ITEM, mstrItemID, mstrItemID, nItemCount, 0.0f, new NFGUID());
        }

        NFIClass xItemClass  = xLogicClassModule.GetElement("Item");
        NFIClass xEquipClass = xLogicClassModule.GetElement("Equip");

        List <string> xItemIDList  = null;
        List <string> xEquipIDList = null;

        if (null != xItemClass)
        {
            xItemIDList = xItemClass.GetConfigNameList();
        }

        if (null != xEquipClass)
        {
            xEquipIDList = xEquipClass.GetConfigNameList();
        }


        int nmaxCount = xItemIDList.Count;

        if (nmaxCount < xEquipIDList.Count)
        {
            nmaxCount = xEquipIDList.Count;
        }

        AddItemscrollPositionFirst = GUI.BeginScrollView(new Rect(0, nElementHeight * 2, nWidth, nHeight), AddItemscrollPositionFirst, new Rect(0, 0, nElementWidth * 2.5f, nmaxCount * (nElementHeight)));
        for (int i = 0; i < nmaxCount; i++)
        {
            string strItemID  = "";
            string strEquipID = "";

            if (i < xItemIDList.Count)
            {
                strItemID = xItemIDList[i];
            }
            if (i < xEquipIDList.Count)
            {
                strEquipID = xEquipIDList[i];
            }


            int BeginHeight = 0;

            BeginHeight = nElementHeight + nElementHeight * i;
            if (strItemID != "")
            {
                if (GUI.Button(new Rect(nElementWidth * 1, BeginHeight, nElementWidth, nElementHeight), strItemID))
                {
                    mstrItemID = strItemID;
                }
            }

            if (strEquipID != "")
            {
                if (GUI.Button(new Rect(nElementWidth * 2, BeginHeight, nElementWidth, nElementHeight), strEquipID))
                {
                    mstrItemID = strEquipID;
                }
            }
        }

        GUI.EndScrollView();

        return(true);
    }