Пример #1
0
    void LoadMapInfoTable()
    {
        cont_MapInfo = new Dictionary<int, TB_MapInfo>();

        StringTable st = new StringTable();

        if (false == st.Build("Table/TB_MapInfo")) { return; }

        int iRowCount = st.row;

        for (int x = 0; x < iRowCount; ++x)
        {
            TB_MapInfo tbMapInfo = new TB_MapInfo();

            tbMapInfo.mMapNo = st.GetValueAsInt(x, "MapNo");
            tbMapInfo.mEnableBattle = st.GetValueAsInt(x, "EnableBattleScene");

            for (int i = 0; i < 5; ++i)
            {
                string stRegenMon = "RegenMon" + i.ToString();
                tbMapInfo.mArrRegenMosters[i] = st.GetValueAsInt(x, stRegenMon);
            }

            int key = tbMapInfo.mMapNo;
            if (cont_MapInfo.ContainsKey(key))
            {
                Debug.LogError("Already exist key. " + key.ToString());
            }

            cont_MapInfo.Add(key, tbMapInfo);
        }
    }
Пример #2
0
    void OnLevelWasLoaded(int iLevel)
    {
        if (TBManager.Instance().cont_MapInfo == null) return;

        if (!TBManager.Instance().cont_MapInfo.ContainsKey(iLevel)) return;

        mTableMapInfo = TBManager.Instance().cont_MapInfo[iLevel];
        if (mTableMapInfo == null) return;

        mFieldPlayer = GameObject.Find ("Player");
        if (mFieldPlayer == null)
        {
            Debug.LogError ("Not find field Player");
        }

        mFieldMainCamera = GameObject.Find("PlayerCamera");
        if (mFieldMainCamera == null)
        {
            Debug.LogError ("Not find field PlayerCamera");
        }

        mCamera2DControl = mFieldMainCamera.GetComponent<CreativeSpore.RpgMapEditor.Camera2DController> ();

        EffectManager.Instance().EffectLoad();
    }